[llvm-branch-commits] [llvm] [llvm-exegesis] Add support for validation counters (PR #76653)

2024-01-10 Thread Clement Courbet via llvm-branch-commits


@@ -112,9 +116,11 @@ class Counter {
   PerfEvent Event;
   int FileDescriptor = -1;
   bool IsDummyEvent;
+  std::vector ValidationEvents;

legrosbuffle wrote:

This is a bit weird, because the class `Counter` now holds several perf events. 
If we need several counters, we shoul dbe creating several `Counter` instances.

https://github.com/llvm/llvm-project/pull/76653
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [llvm-exegesis] Add support for validation counters (PR #76653)

2024-01-10 Thread Clement Courbet via llvm-branch-commits


@@ -87,6 +93,8 @@ struct BenchmarkMeasure {
   // This is the per-snippet value, i.e. measured quantity for one repetition 
of
   // the whole snippet.
   double PerSnippetValue;
+  // These are the validation counter values.
+  std::unordered_map ValidationCounters;

legrosbuffle wrote:

Can we make this an ordered map ? This will make the yaml output stable.

https://github.com/llvm/llvm-project/pull/76653
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 038c85c - Revert "[clang][dataflow] Add an early-out to `flowConditionImplies()` / `flowConditionAllows()`. (#77453)"

2024-01-10 Thread via llvm-branch-commits

Author: martinboehme
Date: 2024-01-10T10:49:45+01:00
New Revision: 038c85ca9733404a67c0f328f268ca0124cf5b17

URL: 
https://github.com/llvm/llvm-project/commit/038c85ca9733404a67c0f328f268ca0124cf5b17
DIFF: 
https://github.com/llvm/llvm-project/commit/038c85ca9733404a67c0f328f268ca0124cf5b17.diff

LOG: Revert "[clang][dataflow] Add an early-out to `flowConditionImplies()` / 
`flowConditionAllows()`. (#77453)"

This reverts commit 03a0bfa96a6eb09c4bbae344ac3aa062339aa730.

Added: 


Modified: 
clang/include/clang/Analysis/FlowSensitive/Formula.h
clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp

Removed: 




diff  --git a/clang/include/clang/Analysis/FlowSensitive/Formula.h 
b/clang/include/clang/Analysis/FlowSensitive/Formula.h
index 0e6352403a832f..982e400c1deff1 100644
--- a/clang/include/clang/Analysis/FlowSensitive/Formula.h
+++ b/clang/include/clang/Analysis/FlowSensitive/Formula.h
@@ -75,10 +75,6 @@ class alignas(const Formula *) Formula {
 return static_cast(Value);
   }
 
-  bool isLiteral(bool b) const {
-return kind() == Literal && static_cast(Value) == b;
-  }
-
   ArrayRef operands() const {
 return ArrayRef(reinterpret_cast(this + 1),
 numOperands(kind()));

diff  --git a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp 
b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
index 500fbb39955d20..fa114979c8e326 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
@@ -174,9 +174,6 @@ Solver::Result DataflowAnalysisContext::querySolver(
 
 bool DataflowAnalysisContext::flowConditionImplies(Atom Token,
const Formula &F) {
-  if (F.isLiteral(true))
-return true;
-
   // Returns true if and only if truth assignment of the flow condition implies
   // that `F` is also true. We prove whether or not this property holds by
   // reducing the problem to satisfiability checking. In other words, we 
attempt
@@ -191,9 +188,6 @@ bool DataflowAnalysisContext::flowConditionImplies(Atom 
Token,
 
 bool DataflowAnalysisContext::flowConditionAllows(Atom Token,
   const Formula &F) {
-  if (F.isLiteral(true))
-return true;
-
   llvm::SetVector Constraints;
   Constraints.insert(&arena().makeAtomRef(Token));
   Constraints.insert(&F);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [SPARC] Prefer RDPC over CALL to implement GETPCX for 64-bit target (PR #77196)

2024-01-10 Thread via llvm-branch-commits


@@ -234,8 +244,15 @@ void SparcAsmPrinter::LowerGETPCXAndEmitMCInsts(const 
MachineInstr *MI,
   //   add , %o7, 
 
   OutStreamer->emitLabel(StartLabel);
-  MCOperand Callee =  createPCXCallOP(EndLabel, OutContext);
-  EmitCall(*OutStreamer, Callee, STI);
+  if (!STI.getTargetTriple().isSPARC64() ||
+  STI.hasFeature(Sparc::TuneSlowRDPC)) {
+MCOperand Callee = createPCXCallOP(EndLabel, OutContext);
+EmitCall(*OutStreamer, Callee, STI);
+  } else {
+// TODO make it possible to store PC in other registers
+// so that leaf function optimization becomes possible.

koachan wrote:

I'm not sure how hard would that be, especially given that there seems to be a 
couple places where the %o7-as-output assumption is being made... so we need to 
clean all of those up first, I think?

https://github.com/llvm/llvm-project/pull/77196
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [SPARC] Prefer RDPC over CALL to implement GETPCX for 64-bit target (PR #77196)

2024-01-10 Thread via llvm-branch-commits

https://github.com/koachan updated 
https://github.com/llvm/llvm-project/pull/77196


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [SPARC] Prefer RDPC over CALL to implement GETPCX for 64-bit target (PR #77196)

2024-01-10 Thread via llvm-branch-commits

https://github.com/koachan updated 
https://github.com/llvm/llvm-project/pull/77196


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [SPARC] Prefer RDPC over CALL to implement GETPCX for 64-bit target (PR #77196)

2024-01-10 Thread via llvm-branch-commits


@@ -234,8 +244,15 @@ void SparcAsmPrinter::LowerGETPCXAndEmitMCInsts(const 
MachineInstr *MI,
   //   add , %o7, 

koachan wrote:

Done 
[here](https://github.com/llvm/llvm-project/pull/77196/commits/0c8531249989651c5274149e437184a3362d7677#diff-d68f40b543f55bd7e31c3fc6a3dbe06455d7857fb1f5bd7270bb871d1c39e830R239).
(Seems like github isn't picking up the changes)

https://github.com/llvm/llvm-project/pull/77196
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2024-01-10 Thread Mark de Wever via llvm-branch-commits


@@ -131,13 +138,65 @@ def parseScript(test, preamble):
 script += preamble
 script += scriptInTest
 
+has_std_module = False
+has_std_compat_module = False
+for module in modules:
+if module == "std":
+has_std_module = True
+elif module == "std.compat":
+has_std_compat_module = True
+else:
+script.insert(
+0,
+f"echo \"The module '{module}' is not valid, use 'std' or 
'std.compat'\"",
+)
+script.insert(1, "false")
+return script
+
+if modules:
+# This flag is needed for both modules.
+moduleCompileFlags.append("-fprebuilt-module-path=%T")

mordante wrote:

Thanks for the clarification. I'm not too bothered by it. In libc++ we indeed 
want to build the modules manually to avoid additional dependencies in the 
test-suite. 

https://github.com/llvm/llvm-project/pull/76246
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2024-01-10 Thread Louis Dionne via llvm-branch-commits


@@ -131,13 +138,65 @@ def parseScript(test, preamble):
 script += preamble
 script += scriptInTest
 
+has_std_module = False
+has_std_compat_module = False
+for module in modules:
+if module == "std":
+has_std_module = True
+elif module == "std.compat":
+has_std_compat_module = True
+else:
+script.insert(
+0,
+f"echo \"The module '{module}' is not valid, use 'std' or 
'std.compat'\"",
+)
+script.insert(1, "false")
+return script
+
+if modules:
+# This flag is needed for both modules.
+moduleCompileFlags.append("-fprebuilt-module-path=%T")

ldionne wrote:

@mordante Should we pass `-fmodule-file=std=%T/std.cppm` in that case?

https://github.com/llvm/llvm-project/pull/76246
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++][modules] Adds module testing. (PR #76246)

2024-01-10 Thread Mark de Wever via llvm-branch-commits


@@ -131,13 +138,65 @@ def parseScript(test, preamble):
 script += preamble
 script += scriptInTest
 
+has_std_module = False
+has_std_compat_module = False
+for module in modules:
+if module == "std":
+has_std_module = True
+elif module == "std.compat":
+has_std_compat_module = True
+else:
+script.insert(
+0,
+f"echo \"The module '{module}' is not valid, use 'std' or 
'std.compat'\"",
+)
+script.insert(1, "false")
+return script
+
+if modules:
+# This flag is needed for both modules.
+moduleCompileFlags.append("-fprebuilt-module-path=%T")

mordante wrote:

we don't need too, but it looks better. I'll look into it.

https://github.com/llvm/llvm-project/pull/76246
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang-tools-extra] [llvm-exegesis] Add support for validation counters (PR #76653)

2024-01-10 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 updated 
https://github.com/llvm/llvm-project/pull/76653

>From 76f199f4fc7244c3d972736595c685d7316c5203 Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Sat, 30 Dec 2023 18:18:12 -0800
Subject: [PATCH 1/6] [llvm-exegesis] Add support for validation counters

This patch adds support for validation counters. Validation counters can
be used to measure events that occur during snippet execution like cache
misses to ensure that certain assumed invariants about the benchmark
actually hold. Validation counters are setup within a perf event group,
so are turned on and off at exactly the same time as the "group leader"
counter that measures the desired value.
---
 .../llvm-exegesis/lib/BenchmarkResult.cpp | 52 +++
 .../tools/llvm-exegesis/lib/BenchmarkResult.h | 15 +-
 .../llvm-exegesis/lib/BenchmarkRunner.cpp | 52 +--
 .../tools/llvm-exegesis/lib/BenchmarkRunner.h |  8 ++-
 .../lib/LatencyBenchmarkRunner.cpp| 46 
 .../lib/LatencyBenchmarkRunner.h  |  3 ++
 llvm/tools/llvm-exegesis/lib/PerfHelper.cpp   | 37 +++--
 llvm/tools/llvm-exegesis/lib/PerfHelper.h | 10 +++-
 llvm/tools/llvm-exegesis/lib/Target.cpp   | 35 +
 llvm/tools/llvm-exegesis/lib/Target.h | 13 ++---
 .../llvm-exegesis/lib/UopsBenchmarkRunner.cpp | 37 ++---
 .../llvm-exegesis/lib/UopsBenchmarkRunner.h   |  9 +++-
 llvm/tools/llvm-exegesis/lib/X86/Target.cpp   | 11 +++-
 .../llvm-exegesis/lib/X86/X86Counter.cpp  |  2 +-
 llvm/tools/llvm-exegesis/llvm-exegesis.cpp| 18 ++-
 .../tools/llvm-exegesis/ClusteringTest.cpp| 36 ++---
 .../Mips/BenchmarkResultTest.cpp  | 12 ++---
 .../llvm-exegesis/X86/BenchmarkResultTest.cpp | 12 ++---
 18 files changed, 311 insertions(+), 97 deletions(-)

diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index 02c4da11e032d6..1079df24b457b8 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -14,6 +14,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/bit.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Errc.h"
 #include "llvm/Support/FileOutputBuffer.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Format.h"
@@ -192,6 +193,56 @@ template <> struct 
SequenceElementTraits {
   static const bool flow = false;
 };
 
+const char *validationEventToString(exegesis::ValidationEvent VE) {
+  switch (VE) {
+  case exegesis::ValidationEvent::L1DCacheLoadMiss:
+return "l1d-load-miss";
+  case exegesis::ValidationEvent::InstructionRetired:
+return "instructions-retired";
+  case exegesis::ValidationEvent::DataTLBLoadMiss:
+return "data-tlb-load-misses";
+  case exegesis::ValidationEvent::DataTLBStoreMiss:
+return "data-tlb-store-misses";
+  }
+}
+
+Expected stringToValidationEvent(StringRef Input) {
+  if (Input == "l1d-load-miss")
+return exegesis::ValidationEvent::L1DCacheLoadMiss;
+  else if (Input == "instructions-retired")
+return exegesis::ValidationEvent::InstructionRetired;
+  else if (Input == "data-tlb-load-misses")
+return exegesis::ValidationEvent::DataTLBLoadMiss;
+  else if (Input == "data-tlb-store-misses")
+return exegesis::ValidationEvent::DataTLBStoreMiss;
+  else
+return make_error("Invalid validation event string",
+   errc::invalid_argument);
+}
+
+template <>
+struct CustomMappingTraits<
+std::unordered_map> {
+  static void
+  inputOne(IO &Io, StringRef KeyStr,
+   std::unordered_map &VI) {
+Expected Key = stringToValidationEvent(KeyStr);
+if (!Key) {
+  Io.setError("Key is not a valid validation event");
+  return;
+}
+Io.mapRequired(KeyStr.str().c_str(), VI[*Key]);
+  }
+
+  static void
+  output(IO &Io, std::unordered_map &VI) {
+for (auto &IndividualVI : VI) {
+  Io.mapRequired(validationEventToString(IndividualVI.first),
+ IndividualVI.second);
+}
+  }
+};
+
 // exegesis::Measure is rendererd as a flow instead of a list.
 // e.g. { "key": "the key", "value": 0123 }
 template <> struct MappingTraits {
@@ -203,6 +254,7 @@ template <> struct 
MappingTraits {
 }
 Io.mapRequired("value", Obj.PerInstructionValue);
 Io.mapOptional("per_snippet_value", Obj.PerSnippetValue);
+Io.mapOptional("validation_counters", Obj.ValidationCounters);
   }
   static const bool flow = true;
 };
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
index 0d08febae20cb3..f142da07e0a47d 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
@@ -32,6 +32,13 @@ class Error;
 
 namespace exegesis {
 
+enum ValidationEvent {
+  L1DCacheLoadMiss,
+  InstructionRetired,
+  DataTLBLoadMiss,
+  DataTLBStoreMiss
+};
+
 enu

[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/77702

Add more tests for sanitizer symbolizer markup, that make sure
the output of the symbolizer markup can be symbolized by llvm-symbolizer.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Andres Villegas (avillega)


Changes

Add more tests for sanitizer symbolizer markup, that make sure
the output of the symbolizer markup can be symbolized by llvm-symbolizer.


---
Full diff: https://github.com/llvm/llvm-project/pull/77702.diff


2 Files Affected:

- (added) compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp 
(+34) 
- (added) compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp (+59) 


``diff
diff --git 
a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp 
b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
new file mode 100644
index 00..548ae57b5c3797
--- /dev/null
+++ b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
@@ -0,0 +1,34 @@
+// COM: End to end test for the sanitizer symbolizer markup. Since it uses 
debug info
+// COM: to do offline symbolization we only check that the current module 
correctly is correctly symbolized  
+// REQUIRES: linux
+// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
+// RUN: mkdir -p %t/.build-id/12
+// RUN: cp %t.main %t/.build-id/12/345678.debug
+// RUN: %env_asan_opts=enable_symbolizer_markup=1 not %run %t.main 
2>%t/sanitizer.out
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include 
+
+[[gnu::noinline]]
+char *alloc() {
+  char *x = (char*)malloc(10 * sizeof(char));
+  return x;
+}
+int main() {
+  char *x = alloc();
+  free(x);
+  return x[5];
+}
+// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
+// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
+// CHECK: {{READ of size 1 at 0x.* thread T0}}
+// CHECK: {{#0 0x.* main 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-5]]
+// CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
+// CHECK: {{freed by thread T0 here:}}
+// CHECK: {{#1 0x.* main 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-9]]
+// CHECK: {{previously allocated by thread T0 here:}} 
+// CHECK: {{#1 0x.* alloc\(\) 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-16]]
+// CHECK: {{#2 0x.* main 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-13]]
+// CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} 
application bytes):
+// CHECK: Global redzone:
+// CHECK: ASan internal:
diff --git a/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp 
b/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
new file mode 100644
index 00..5798986d73839e
--- /dev/null
+++ b/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
@@ -0,0 +1,59 @@
+// REQUIRES: linux
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t.main 
+// RUN: mkdir -p %t/.build-id/12
+// RUN: cp %t.main %t/.build-id/12/345678.debug
+// RUN: %env_tsan_opts=enable_symbolizer_markup=1 %deflake %run %t.main 
>%t/sanitizer.out
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s --dump-input=always
+
+#include "test.h"
+
+int Global;
+
+void __attribute__((noinline)) foo1() {
+  Global = 42;
+}
+
+void __attribute__((noinline)) bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+void __attribute__((noinline)) foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+void __attribute__((noinline)) bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[@LINE-40]]
+// CHECK-NEXT: #1 {{0x.*}} bar1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[@LINE-34]]
+// CHECK-NEXT: #2 {{0x.*}} Thread1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[@LINE-17]]
+//  CHECK:   Previous read of size 4 at {{.*}} by main thread:
+//  CHECK: #0 {{0x.*}} foo2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[@LINE-33]]
+// CHECK-NEXT: #1 {{0x.*}} bar2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[@LINE-25]]
+// CHECK-NEXT: #2 {{0x.*}} main{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[@LINE-13]]

``




https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

I plan to add some ubsan and hwasan test aswell, but asan and tsan are just 
faster to add right now.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread via llvm-branch-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff a0ec54f71d12e29d88c24dc8f0482ee4bc26cf0e 
27fb627cc2a1c35140f6665d184ce544a73b8ea1 -- 
compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp 
compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
``





View the diff from clang-format here.


``diff
diff --git 
a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp 
b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
index 548ae57b5c..5b46ced2f4 100644
--- a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
@@ -1,5 +1,5 @@
 // COM: End to end test for the sanitizer symbolizer markup. Since it uses 
debug info
-// COM: to do offline symbolization we only check that the current module 
correctly is correctly symbolized  
+// COM: to do offline symbolization we only check that the current module 
correctly is correctly symbolized
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12
@@ -9,9 +9,8 @@
 
 #include 
 
-[[gnu::noinline]]
-char *alloc() {
-  char *x = (char*)malloc(10 * sizeof(char));
+[[gnu::noinline]] char *alloc() {
+  char *x = (char *)malloc(10 * sizeof(char));
   return x;
 }
 int main() {
@@ -26,7 +25,7 @@ int main() {
 // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
 // CHECK: {{freed by thread T0 here:}}
 // CHECK: {{#1 0x.* main 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-9]]
-// CHECK: {{previously allocated by thread T0 here:}} 
+// CHECK: {{previously allocated by thread T0 here:}}
 // CHECK: {{#1 0x.* alloc\(\) 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-16]]
 // CHECK: {{#2 0x.* main 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-13]]
 // CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} 
application bytes):
diff --git a/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp 
b/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
index 5798986d73..a4f5e0e9d9 100644
--- a/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
+++ b/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
@@ -1,5 +1,5 @@
 // REQUIRES: linux
-// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t.main 
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t.main
 // RUN: mkdir -p %t/.build-id/12
 // RUN: cp %t.main %t/.build-id/12/345678.debug
 // RUN: %env_tsan_opts=enable_symbolizer_markup=1 %deflake %run %t.main 
>%t/sanitizer.out
@@ -9,9 +9,7 @@
 
 int Global;
 
-void __attribute__((noinline)) foo1() {
-  Global = 42;
-}
+void __attribute__((noinline)) foo1() { Global = 42; }
 
 void __attribute__((noinline)) bar1() {
   volatile int tmp = 42;

``




https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread Florian Mayer via llvm-branch-commits

fmayer wrote:

> I plan to add some ubsan and hwasan test aswell, but asan and tsan are just 
> faster to add right now.

FWIW it might be better to add them separately anyway, to make rolling back 
easier if a buildbot breaks.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [compiler-rt] [clang-tools-extra] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp 
b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
index 548ae57b5c3797..323de4ec7a36ed 100644
--- a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
@@ -1,5 +1,5 @@
 // COM: End to end test for the sanitizer symbolizer markup. Since it uses 
debug info
-// COM: to do offline symbolization we only check that the current module 
correctly is correctly symbolized  
+// COM: to do offline symbolization we only check that the current module is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits