[llvm-branch-commits] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)

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

https://github.com/boomanaiden154 created 
https://github.com/llvm/llvm-project/pull/76788

This patch adds support for additional types of validation counters and also 
adds mappings between these new validation counter types and physical counters 
on the hardware for microarchitectures that I have the ability to test on.

>From 05901b26b1225dc631a4b89950b3816fbe542e3b Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Tue, 2 Jan 2024 22:54:35 -0800
Subject: [PATCH] [llvm-exegesis] Add additional validation counters

This patch adds support for additional types of validation counters and
also adds mappings between these new validation counter types and
physical counters on the hardware for microarchitectures that I have the
ability to test on.
---
 llvm/include/llvm/Target/TargetPfmCounters.td |  7 
 llvm/lib/Target/X86/X86PfmCounters.td | 42 ---
 .../llvm-exegesis/lib/BenchmarkResult.cpp | 24 +++
 .../tools/llvm-exegesis/lib/BenchmarkResult.h |  6 +++
 llvm/tools/llvm-exegesis/llvm-exegesis.cpp| 18 ++--
 5 files changed, 88 insertions(+), 9 deletions(-)

diff --git a/llvm/include/llvm/Target/TargetPfmCounters.td 
b/llvm/include/llvm/Target/TargetPfmCounters.td
index d162327afea2cf..0bfefd5d31211e 100644
--- a/llvm/include/llvm/Target/TargetPfmCounters.td
+++ b/llvm/include/llvm/Target/TargetPfmCounters.td
@@ -33,6 +33,13 @@ class ValidationEvent  {
 }
 
 def InstructionRetired  : ValidationEvent<0>;
+def L1DCacheLoadMiss : ValidationEvent<1>;
+def L1DCacheStoreMiss : ValidationEvent<2>;
+def L1ICacheLoadMiss : ValidationEvent<3>;
+def DataTLBLoadMiss : ValidationEvent<4>;
+def DataTLBStoreMiss : ValidationEvent<5>;
+def InstructionTLBLoadMiss : ValidationEvent<6>;
+
 
 // Validation counters can be tied to a specific event
 class PfmValidationCounter
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td 
b/llvm/lib/Target/X86/X86PfmCounters.td
index 52c86b1f74c1cb..4403b9845be920 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -121,7 +121,12 @@ def HaswellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"HWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"haswell", HaswellPfmCounters>;
@@ -140,7 +145,12 @@ def BroadwellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"BWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"broadwell", BroadwellPfmCounters>;
@@ -159,7 +169,12 @@ def SkylakeClientPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"SKLPort7", "uops_dispatched_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>;
@@ -178,7 +193,12 @@ def SkylakeServerPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"SKXPort7", "uops_dispatched_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>;
@@ -297,7 +317,12 @@ def ZnVer2PfmCounters : ProcPfmCounters {
 PfmIssueCounter<"Zn2Divider", "div_op_count">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"znver2", ZnVer2PfmCounters>;
@@ -313,7 +338,12 @@ def ZnVer3PfmCounters : ProcPfmCounters {
 PfmIssueCounter<"Zn3Divider", "div_op_count">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"znver3", ZnVer3PfmCounters>;
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index d3f69beb19c46f..bec96c13672782 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -197,12 +197,36 @@ const char 
*validationEventToString(exegesis::ValidationEvent VE) {
   switch (VE) {
   case exegesis::ValidationEvent::InstructionRetired:
   

[llvm-branch-commits] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)

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

llvmbot wrote:




@llvm/pr-subscribers-tools-llvm-exegesis

Author: Aiden Grossman (boomanaiden154)


Changes

This patch adds support for additional types of validation counters and also 
adds mappings between these new validation counter types and physical counters 
on the hardware for microarchitectures that I have the ability to test on.

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


5 Files Affected:

- (modified) llvm/include/llvm/Target/TargetPfmCounters.td (+7) 
- (modified) llvm/lib/Target/X86/X86PfmCounters.td (+36-6) 
- (modified) llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp (+24) 
- (modified) llvm/tools/llvm-exegesis/lib/BenchmarkResult.h (+6) 
- (modified) llvm/tools/llvm-exegesis/llvm-exegesis.cpp (+15-3) 


``diff
diff --git a/llvm/include/llvm/Target/TargetPfmCounters.td 
b/llvm/include/llvm/Target/TargetPfmCounters.td
index d162327afea2cf..0bfefd5d31211e 100644
--- a/llvm/include/llvm/Target/TargetPfmCounters.td
+++ b/llvm/include/llvm/Target/TargetPfmCounters.td
@@ -33,6 +33,13 @@ class ValidationEvent  {
 }
 
 def InstructionRetired  : ValidationEvent<0>;
+def L1DCacheLoadMiss : ValidationEvent<1>;
+def L1DCacheStoreMiss : ValidationEvent<2>;
+def L1ICacheLoadMiss : ValidationEvent<3>;
+def DataTLBLoadMiss : ValidationEvent<4>;
+def DataTLBStoreMiss : ValidationEvent<5>;
+def InstructionTLBLoadMiss : ValidationEvent<6>;
+
 
 // Validation counters can be tied to a specific event
 class PfmValidationCounter
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td 
b/llvm/lib/Target/X86/X86PfmCounters.td
index 52c86b1f74c1cb..4403b9845be920 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -121,7 +121,12 @@ def HaswellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"HWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"haswell", HaswellPfmCounters>;
@@ -140,7 +145,12 @@ def BroadwellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"BWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"broadwell", BroadwellPfmCounters>;
@@ -159,7 +169,12 @@ def SkylakeClientPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"SKLPort7", "uops_dispatched_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>;
@@ -178,7 +193,12 @@ def SkylakeServerPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"SKXPort7", "uops_dispatched_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>;
@@ -297,7 +317,12 @@ def ZnVer2PfmCounters : ProcPfmCounters {
 PfmIssueCounter<"Zn2Divider", "div_op_count">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"znver2", ZnVer2PfmCounters>;
@@ -313,7 +338,12 @@ def ZnVer3PfmCounters : ProcPfmCounters {
 PfmIssueCounter<"Zn3Divider", "div_op_count">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"znver3", ZnVer3PfmCounters>;
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index d3f69beb19c46f..bec96c13672782 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -197,12 +197,36 @@ const char 
*validationEventToString(exegesis::ValidationEvent VE) {
   switch (VE) {
   case exegesis::ValidationEvent::InstructionRetired:
 return "instructions-retired";
+  case exegesis::ValidationEvent::L1DCacheLoadMiss:
+return "l1d-cache-load-misses";
+  case exegesis::ValidationEvent::L1DCacheStoreMiss:
+return "l1d-cache-store-misses";
+  case exegesis::ValidationEvent::L1ICacheLoadMiss:
+return "l1i-cache-load-misses";
+  case exegesis::ValidationEvent::DataTL

[llvm-branch-commits] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)

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

llvmbot wrote:




@llvm/pr-subscribers-backend-x86

Author: Aiden Grossman (boomanaiden154)


Changes

This patch adds support for additional types of validation counters and also 
adds mappings between these new validation counter types and physical counters 
on the hardware for microarchitectures that I have the ability to test on.

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


5 Files Affected:

- (modified) llvm/include/llvm/Target/TargetPfmCounters.td (+7) 
- (modified) llvm/lib/Target/X86/X86PfmCounters.td (+36-6) 
- (modified) llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp (+24) 
- (modified) llvm/tools/llvm-exegesis/lib/BenchmarkResult.h (+6) 
- (modified) llvm/tools/llvm-exegesis/llvm-exegesis.cpp (+15-3) 


``diff
diff --git a/llvm/include/llvm/Target/TargetPfmCounters.td 
b/llvm/include/llvm/Target/TargetPfmCounters.td
index d162327afea2cf..0bfefd5d31211e 100644
--- a/llvm/include/llvm/Target/TargetPfmCounters.td
+++ b/llvm/include/llvm/Target/TargetPfmCounters.td
@@ -33,6 +33,13 @@ class ValidationEvent  {
 }
 
 def InstructionRetired  : ValidationEvent<0>;
+def L1DCacheLoadMiss : ValidationEvent<1>;
+def L1DCacheStoreMiss : ValidationEvent<2>;
+def L1ICacheLoadMiss : ValidationEvent<3>;
+def DataTLBLoadMiss : ValidationEvent<4>;
+def DataTLBStoreMiss : ValidationEvent<5>;
+def InstructionTLBLoadMiss : ValidationEvent<6>;
+
 
 // Validation counters can be tied to a specific event
 class PfmValidationCounter
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td 
b/llvm/lib/Target/X86/X86PfmCounters.td
index 52c86b1f74c1cb..4403b9845be920 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -121,7 +121,12 @@ def HaswellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"HWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"haswell", HaswellPfmCounters>;
@@ -140,7 +145,12 @@ def BroadwellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"BWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"broadwell", BroadwellPfmCounters>;
@@ -159,7 +169,12 @@ def SkylakeClientPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"SKLPort7", "uops_dispatched_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>;
@@ -178,7 +193,12 @@ def SkylakeServerPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"SKXPort7", "uops_dispatched_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>;
@@ -297,7 +317,12 @@ def ZnVer2PfmCounters : ProcPfmCounters {
 PfmIssueCounter<"Zn2Divider", "div_op_count">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"znver2", ZnVer2PfmCounters>;
@@ -313,7 +338,12 @@ def ZnVer3PfmCounters : ProcPfmCounters {
 PfmIssueCounter<"Zn3Divider", "div_op_count">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];
 }
 def : PfmCountersBinding<"znver3", ZnVer3PfmCounters>;
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index d3f69beb19c46f..bec96c13672782 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -197,12 +197,36 @@ const char 
*validationEventToString(exegesis::ValidationEvent VE) {
   switch (VE) {
   case exegesis::ValidationEvent::InstructionRetired:
 return "instructions-retired";
+  case exegesis::ValidationEvent::L1DCacheLoadMiss:
+return "l1d-cache-load-misses";
+  case exegesis::ValidationEvent::L1DCacheStoreMiss:
+return "l1d-cache-store-misses";
+  case exegesis::ValidationEvent::L1ICacheLoadMiss:
+return "l1i-cache-load-misses";
+  case exegesis::ValidationEvent::DataTLBLoadMis

[llvm-branch-commits] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)

2024-01-03 Thread Simon Pilgrim via llvm-branch-commits


@@ -121,7 +121,12 @@ def HaswellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"HWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];

RKSimon wrote:

Could we pull this out into a default list instead of duplicating it? `let 
ValidationCounters = DefaultX86ValidationCounters` or something? 

https://github.com/llvm/llvm-project/pull/76788
___
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] [TySan] A Type Sanitizer (Clang) (PR #76260)

2024-01-03 Thread Erich Keane via llvm-branch-commits

https://github.com/erichkeane commented:

The clang changes are ok, but this needs some level of documentation/release 
notes, which I don't see in the clang release.  As this is a part of a larger 
feature, do we intend to push that later?

Also, the clang-format suggestion makes sense.

https://github.com/llvm/llvm-project/pull/76260
___
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-03 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/4] [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] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)

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

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

>From 0c45220a79dcada7e1d0f54490b452e02a2b8e4f Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Tue, 2 Jan 2024 22:54:35 -0800
Subject: [PATCH] [llvm-exegesis] Add additional validation counters

This patch adds support for additional types of validation counters and
also adds mappings between these new validation counter types and
physical counters on the hardware for microarchitectures that I have the
ability to test on.
---
 llvm/include/llvm/Target/TargetPfmCounters.td |  7 ++
 llvm/lib/Target/X86/X86PfmCounters.td | 10 
 .../llvm-exegesis/lib/BenchmarkResult.cpp | 24 +++
 .../tools/llvm-exegesis/lib/BenchmarkResult.h |  6 +
 llvm/tools/llvm-exegesis/llvm-exegesis.cpp| 18 +++---
 5 files changed, 62 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Target/TargetPfmCounters.td 
b/llvm/include/llvm/Target/TargetPfmCounters.td
index d162327afea2cf..0bfefd5d31211e 100644
--- a/llvm/include/llvm/Target/TargetPfmCounters.td
+++ b/llvm/include/llvm/Target/TargetPfmCounters.td
@@ -33,6 +33,13 @@ class ValidationEvent  {
 }
 
 def InstructionRetired  : ValidationEvent<0>;
+def L1DCacheLoadMiss : ValidationEvent<1>;
+def L1DCacheStoreMiss : ValidationEvent<2>;
+def L1ICacheLoadMiss : ValidationEvent<3>;
+def DataTLBLoadMiss : ValidationEvent<4>;
+def DataTLBStoreMiss : ValidationEvent<5>;
+def InstructionTLBLoadMiss : ValidationEvent<6>;
+
 
 // Validation counters can be tied to a specific event
 class PfmValidationCounter
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td 
b/llvm/lib/Target/X86/X86PfmCounters.td
index 48d68954970915..e6b8cdc430e549 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -20,6 +20,11 @@ def : PfmCountersDefaultBinding;
 // Intel X86 Counters.
 defvar DefaultIntelPfmValidationCounters = [
   PfmValidationCounter
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter
 ];
 
 def PentiumPfmCounters : ProcPfmCounters {
@@ -201,6 +206,11 @@ def : PfmCountersBinding<"tigerlake", IceLakePfmCounters>;
 // AMD X86 Counters.
 defvar DefaultAMDPfmValidationCounters = [
   PfmValidationCounter
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter
 ];
 
 // Set basic counters for AMD cpus that we know libpfm4 supports.
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index d3f69beb19c46f..bec96c13672782 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -197,12 +197,36 @@ const char 
*validationEventToString(exegesis::ValidationEvent VE) {
   switch (VE) {
   case exegesis::ValidationEvent::InstructionRetired:
 return "instructions-retired";
+  case exegesis::ValidationEvent::L1DCacheLoadMiss:
+return "l1d-cache-load-misses";
+  case exegesis::ValidationEvent::L1DCacheStoreMiss:
+return "l1d-cache-store-misses";
+  case exegesis::ValidationEvent::L1ICacheLoadMiss:
+return "l1i-cache-load-misses";
+  case exegesis::ValidationEvent::DataTLBLoadMiss:
+return "data-tlb-load-misses";
+  case exegesis::ValidationEvent::DataTLBStoreMiss:
+return "data-tlb-store-misses";
+  case exegesis::ValidationEvent::InstructionTLBLoadMiss:
+return "instruction-tlb-load-misses";
   }
 }
 
 Expected stringToValidationEvent(StringRef Input) {
   if (Input == "instructions-retired")
 return exegesis::ValidationEvent::InstructionRetired;
+  else if (Input == "l1d-cache-load-misses")
+return exegesis::ValidationEvent::L1DCacheLoadMiss;
+  else if (Input == "l1d-cache-store-misses")
+return exegesis::ValidationEvent::L1DCacheStoreMiss;
+  else if (Input == "l1i-cache-load-misses")
+return exegesis::ValidationEvent::L1ICacheLoadMiss;
+  else if (Input == "data-tlb-load-misses")
+return exegesis::ValidationEvent::DataTLBLoadMiss;
+  else if (Input == "data-tlb-store-misses")
+return exegesis::ValidationEvent::DataTLBStoreMiss;
+  else if (Input == "instruction-tlb-load-misses")
+return exegesis::ValidationEvent::InstructionTLBLoadMiss;
   else
 return make_error("Invalid validation event string",
errc::invalid_argument);
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
index 9fc5d851b29abb..56d907cea0f78a 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
@@ -34,6 +34,12 @@ namespace exegesis {
 
 enum ValidationEvent {
   InstructionRetired,
+  L1DCacheLoadMiss,
+  L1DCacheStoreMiss,
+  L1ICacheLoadMiss,
+  DataTLBLoadMiss,
+  DataTLBStoreMiss,
+  InstructionTLBLoadMiss
 };
 
 enum class BenchmarkPhaseSelectorE {
diff --git a/llvm/t

[llvm-branch-commits] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)

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


@@ -121,7 +121,12 @@ def HaswellPfmCounters : ProcPfmCounters {
 PfmIssueCounter<"HWPort7", "uops_executed_port:port_7">
   ];
   let ValidationCounters = [
-PfmValidationCounter
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter,
+PfmValidationCounter
   ];

boomanaiden154 wrote:

Thanks for the suggestion! I've refactored everything into a default counters 
set that's split across AMD/Intel (as the counters between them differ). We 
might need to adapt as newer/older architectures are brought up, but this 
should be reasonably scalable.

https://github.com/llvm/llvm-project/pull/76788
___
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 additional validation counters (PR #76788)

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

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

>From 0c45220a79dcada7e1d0f54490b452e02a2b8e4f Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Tue, 2 Jan 2024 22:54:35 -0800
Subject: [PATCH 1/2] [llvm-exegesis] Add additional validation counters

This patch adds support for additional types of validation counters and
also adds mappings between these new validation counter types and
physical counters on the hardware for microarchitectures that I have the
ability to test on.
---
 llvm/include/llvm/Target/TargetPfmCounters.td |  7 ++
 llvm/lib/Target/X86/X86PfmCounters.td | 10 
 .../llvm-exegesis/lib/BenchmarkResult.cpp | 24 +++
 .../tools/llvm-exegesis/lib/BenchmarkResult.h |  6 +
 llvm/tools/llvm-exegesis/llvm-exegesis.cpp| 18 +++---
 5 files changed, 62 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Target/TargetPfmCounters.td 
b/llvm/include/llvm/Target/TargetPfmCounters.td
index d162327afea2cf..0bfefd5d31211e 100644
--- a/llvm/include/llvm/Target/TargetPfmCounters.td
+++ b/llvm/include/llvm/Target/TargetPfmCounters.td
@@ -33,6 +33,13 @@ class ValidationEvent  {
 }
 
 def InstructionRetired  : ValidationEvent<0>;
+def L1DCacheLoadMiss : ValidationEvent<1>;
+def L1DCacheStoreMiss : ValidationEvent<2>;
+def L1ICacheLoadMiss : ValidationEvent<3>;
+def DataTLBLoadMiss : ValidationEvent<4>;
+def DataTLBStoreMiss : ValidationEvent<5>;
+def InstructionTLBLoadMiss : ValidationEvent<6>;
+
 
 // Validation counters can be tied to a specific event
 class PfmValidationCounter
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td 
b/llvm/lib/Target/X86/X86PfmCounters.td
index 48d68954970915..e6b8cdc430e549 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -20,6 +20,11 @@ def : PfmCountersDefaultBinding;
 // Intel X86 Counters.
 defvar DefaultIntelPfmValidationCounters = [
   PfmValidationCounter
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter
 ];
 
 def PentiumPfmCounters : ProcPfmCounters {
@@ -201,6 +206,11 @@ def : PfmCountersBinding<"tigerlake", IceLakePfmCounters>;
 // AMD X86 Counters.
 defvar DefaultAMDPfmValidationCounters = [
   PfmValidationCounter
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter
 ];
 
 // Set basic counters for AMD cpus that we know libpfm4 supports.
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index d3f69beb19c46f..bec96c13672782 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -197,12 +197,36 @@ const char 
*validationEventToString(exegesis::ValidationEvent VE) {
   switch (VE) {
   case exegesis::ValidationEvent::InstructionRetired:
 return "instructions-retired";
+  case exegesis::ValidationEvent::L1DCacheLoadMiss:
+return "l1d-cache-load-misses";
+  case exegesis::ValidationEvent::L1DCacheStoreMiss:
+return "l1d-cache-store-misses";
+  case exegesis::ValidationEvent::L1ICacheLoadMiss:
+return "l1i-cache-load-misses";
+  case exegesis::ValidationEvent::DataTLBLoadMiss:
+return "data-tlb-load-misses";
+  case exegesis::ValidationEvent::DataTLBStoreMiss:
+return "data-tlb-store-misses";
+  case exegesis::ValidationEvent::InstructionTLBLoadMiss:
+return "instruction-tlb-load-misses";
   }
 }
 
 Expected stringToValidationEvent(StringRef Input) {
   if (Input == "instructions-retired")
 return exegesis::ValidationEvent::InstructionRetired;
+  else if (Input == "l1d-cache-load-misses")
+return exegesis::ValidationEvent::L1DCacheLoadMiss;
+  else if (Input == "l1d-cache-store-misses")
+return exegesis::ValidationEvent::L1DCacheStoreMiss;
+  else if (Input == "l1i-cache-load-misses")
+return exegesis::ValidationEvent::L1ICacheLoadMiss;
+  else if (Input == "data-tlb-load-misses")
+return exegesis::ValidationEvent::DataTLBLoadMiss;
+  else if (Input == "data-tlb-store-misses")
+return exegesis::ValidationEvent::DataTLBStoreMiss;
+  else if (Input == "instruction-tlb-load-misses")
+return exegesis::ValidationEvent::InstructionTLBLoadMiss;
   else
 return make_error("Invalid validation event string",
errc::invalid_argument);
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
index 9fc5d851b29abb..56d907cea0f78a 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
@@ -34,6 +34,12 @@ namespace exegesis {
 
 enum ValidationEvent {
   InstructionRetired,
+  L1DCacheLoadMiss,
+  L1DCacheStoreMiss,
+  L1ICacheLoadMiss,
+  DataTLBLoadMiss,
+  DataTLBStoreMiss,
+  InstructionTLBLoadMiss
 };
 
 enum class BenchmarkPhaseSelectorE {
diff --git a/ll

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

2024-01-03 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/5] [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] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)

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

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

>From c665ef230d082dc6dddbe6707f0ad43fe28d680c Mon Sep 17 00:00:00 2001
From: Aiden Grossman 
Date: Tue, 2 Jan 2024 22:54:35 -0800
Subject: [PATCH 1/2] [llvm-exegesis] Add additional validation counters

This patch adds support for additional types of validation counters and
also adds mappings between these new validation counter types and
physical counters on the hardware for microarchitectures that I have the
ability to test on.
---
 llvm/include/llvm/Target/TargetPfmCounters.td |  7 ++
 llvm/lib/Target/X86/X86PfmCounters.td | 10 
 .../llvm-exegesis/lib/BenchmarkResult.cpp | 24 +++
 .../tools/llvm-exegesis/lib/BenchmarkResult.h |  6 +
 llvm/tools/llvm-exegesis/llvm-exegesis.cpp| 18 +++---
 5 files changed, 62 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Target/TargetPfmCounters.td 
b/llvm/include/llvm/Target/TargetPfmCounters.td
index d162327afea2cf..0bfefd5d31211e 100644
--- a/llvm/include/llvm/Target/TargetPfmCounters.td
+++ b/llvm/include/llvm/Target/TargetPfmCounters.td
@@ -33,6 +33,13 @@ class ValidationEvent  {
 }
 
 def InstructionRetired  : ValidationEvent<0>;
+def L1DCacheLoadMiss : ValidationEvent<1>;
+def L1DCacheStoreMiss : ValidationEvent<2>;
+def L1ICacheLoadMiss : ValidationEvent<3>;
+def DataTLBLoadMiss : ValidationEvent<4>;
+def DataTLBStoreMiss : ValidationEvent<5>;
+def InstructionTLBLoadMiss : ValidationEvent<6>;
+
 
 // Validation counters can be tied to a specific event
 class PfmValidationCounter
diff --git a/llvm/lib/Target/X86/X86PfmCounters.td 
b/llvm/lib/Target/X86/X86PfmCounters.td
index 48d68954970915..e6b8cdc430e549 100644
--- a/llvm/lib/Target/X86/X86PfmCounters.td
+++ b/llvm/lib/Target/X86/X86PfmCounters.td
@@ -20,6 +20,11 @@ def : PfmCountersDefaultBinding;
 // Intel X86 Counters.
 defvar DefaultIntelPfmValidationCounters = [
   PfmValidationCounter
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter
 ];
 
 def PentiumPfmCounters : ProcPfmCounters {
@@ -201,6 +206,11 @@ def : PfmCountersBinding<"tigerlake", IceLakePfmCounters>;
 // AMD X86 Counters.
 defvar DefaultAMDPfmValidationCounters = [
   PfmValidationCounter
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter,
+  PfmValidationCounter
 ];
 
 // Set basic counters for AMD cpus that we know libpfm4 supports.
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
index d3f69beb19c46f..bec96c13672782 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
@@ -197,12 +197,36 @@ const char 
*validationEventToString(exegesis::ValidationEvent VE) {
   switch (VE) {
   case exegesis::ValidationEvent::InstructionRetired:
 return "instructions-retired";
+  case exegesis::ValidationEvent::L1DCacheLoadMiss:
+return "l1d-cache-load-misses";
+  case exegesis::ValidationEvent::L1DCacheStoreMiss:
+return "l1d-cache-store-misses";
+  case exegesis::ValidationEvent::L1ICacheLoadMiss:
+return "l1i-cache-load-misses";
+  case exegesis::ValidationEvent::DataTLBLoadMiss:
+return "data-tlb-load-misses";
+  case exegesis::ValidationEvent::DataTLBStoreMiss:
+return "data-tlb-store-misses";
+  case exegesis::ValidationEvent::InstructionTLBLoadMiss:
+return "instruction-tlb-load-misses";
   }
 }
 
 Expected stringToValidationEvent(StringRef Input) {
   if (Input == "instructions-retired")
 return exegesis::ValidationEvent::InstructionRetired;
+  else if (Input == "l1d-cache-load-misses")
+return exegesis::ValidationEvent::L1DCacheLoadMiss;
+  else if (Input == "l1d-cache-store-misses")
+return exegesis::ValidationEvent::L1DCacheStoreMiss;
+  else if (Input == "l1i-cache-load-misses")
+return exegesis::ValidationEvent::L1ICacheLoadMiss;
+  else if (Input == "data-tlb-load-misses")
+return exegesis::ValidationEvent::DataTLBLoadMiss;
+  else if (Input == "data-tlb-store-misses")
+return exegesis::ValidationEvent::DataTLBStoreMiss;
+  else if (Input == "instruction-tlb-load-misses")
+return exegesis::ValidationEvent::InstructionTLBLoadMiss;
   else
 return make_error("Invalid validation event string",
errc::invalid_argument);
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h 
b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
index 9fc5d851b29abb..56d907cea0f78a 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
@@ -34,6 +34,12 @@ namespace exegesis {
 
 enum ValidationEvent {
   InstructionRetired,
+  L1DCacheLoadMiss,
+  L1DCacheStoreMiss,
+  L1ICacheLoadMiss,
+  DataTLBLoadMiss,
+  DataTLBStoreMiss,
+  InstructionTLBLoadMiss
 };
 
 enum class BenchmarkPhaseSelectorE {
diff --git a/ll

[llvm-branch-commits] [llvm] [compiler-rt] [lldb] [libc] [clang-tools-extra] [libcxxabi] [flang] [libcxx] [clang] [Clangd] Migrate command line options parsing to opttable. (PR #76767)

2024-01-03 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


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

>From 787722d1b26003ff5ab4e197ae60874e4a6fbc40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 3 Jan 2024 00:07:13 +
Subject: [PATCH 1/2] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index ea122d1a585c84..ea155b8bf9435d 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -478,7 +478,6 @@ enum class ErrorResultCode : int {
   CheckFailed = 3
 };
 
-
 int clangdMain(int argc, char *argv[]) {
   // Clang could run on the main thread. e.g., when the flag '-check' or 
'-sync'
   // is enabled.

>From d242f164d69ec606db9418c02c9588bffa429928 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 3 Jan 2024 01:40:40 +
Subject: [PATCH 2/2] change uint to unsigned

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index ea155b8bf9435d..c846c7130e27c9 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -69,16 +69,16 @@
 namespace {
 
 #if defined(__GLIBC__) && CLANGD_MALLOC_TRIM
-static constexpr uint MallocTrimVis = (1 << 8);
+static constexpr unsigned MallocTrimVis = (1 << 8);
 #else
-static constexpr uint MallocTrimVis = 0;
+static constexpr unsigned MallocTrimVis = 0;
 #endif
 
 #if CLANGD_ENABLE_REMOTE
 // FIXME(kirillbobyrev): Should this be the location of compile_commands.json?
-static constexpr uint RemoteVis = (1 << 9);
+static constexpr unsigned RemoteVis = (1 << 9);
 #else
-static constexpr uint RemoteVis = 0;
+static constexpr unsigned RemoteVis = 0;
 #endif
 
 using namespace llvm;

___
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] 687396b - Revert "[Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations (#76677)"

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

Author: Erich Keane
Date: 2024-01-03T15:15:38-08:00
New Revision: 687396b5f4ba0713d103ebd172b308e92eb930cc

URL: 
https://github.com/llvm/llvm-project/commit/687396b5f4ba0713d103ebd172b308e92eb930cc
DIFF: 
https://github.com/llvm/llvm-project/commit/687396b5f4ba0713d103ebd172b308e92eb930cc.diff

LOG: Revert "[Clang][Sema] Diagnose unexpanded packs in the template argument 
lists of function template specializations (#76677)"

This reverts commit 7fbc1de9896029636dd572a692ee90ba88285943.

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaDecl.cpp
clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 778ce0e0e52d06..a3107c4a695321 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -518,7 +518,6 @@ Improvements to Clang's diagnostics
 - Clang now diagnoses definitions of friend function specializations, e.g. 
``friend void f<>(int) {}``.
 - Clang now diagnoses narrowing conversions involving const references.
   (`#63151: `_).
-- Clang now diagnoses unexpanded packs within the template argument lists of 
function template specializations.
 
 
 Improvements to Clang's time-trace

diff  --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 8e46c4984d93dc..2de631941325fa 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9900,15 +9900,15 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, 
DeclContext *DC,
 // Match up the template parameter lists with the scope specifier, then
 // determine whether we have a template or a template specialization.
 bool Invalid = false;
-TemplateIdAnnotation *TemplateId =
-D.getName().getKind() == UnqualifiedIdKind::IK_TemplateId
-? D.getName().TemplateId
-: nullptr;
 TemplateParameterList *TemplateParams =
 MatchTemplateParametersToScopeSpecifier(
 D.getDeclSpec().getBeginLoc(), D.getIdentifierLoc(),
-D.getCXXScopeSpec(), TemplateId, TemplateParamLists, isFriend,
-isMemberSpecialization, Invalid);
+D.getCXXScopeSpec(),
+D.getName().getKind() == UnqualifiedIdKind::IK_TemplateId
+? D.getName().TemplateId
+: nullptr,
+TemplateParamLists, isFriend, isMemberSpecialization,
+Invalid);
 if (TemplateParams) {
   // Check that we can declare a template here.
   if (CheckTemplateDeclScope(S, TemplateParams))
@@ -9921,11 +9921,6 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, 
DeclContext *DC,
 if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
   Diag(NewFD->getLocation(), diag::err_destructor_template);
   NewFD->setInvalidDecl();
-  // Function template with explicit template arguments.
-} else if (TemplateId) {
-  Diag(D.getIdentifierLoc(), diag::err_function_template_partial_spec)
-  << SourceRange(TemplateId->LAngleLoc, TemplateId->RAngleLoc);
-  NewFD->setInvalidDecl();
 }
 
 // If we're adding a template to a dependent context, we may need to
@@ -9978,11 +9973,6 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, 
DeclContext *DC,
 << FixItHint::CreateRemoval(RemoveRange)
 << FixItHint::CreateInsertion(InsertLoc, "<>");
   Invalid = true;
-
-  // Recover by faking up an empty template argument list.
-  HasExplicitTemplateArgs = true;
-  TemplateArgs.setLAngleLoc(InsertLoc);
-  TemplateArgs.setRAngleLoc(InsertLoc);
 }
   }
 } else {
@@ -9996,33 +9986,6 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, 
DeclContext *DC,
   if (TemplateParamLists.size() > 0)
 // For source fidelity, store all the template param lists.
 NewFD->setTemplateParameterListsInfo(Context, TemplateParamLists);
-
-  // "friend void foo<>(int);" is an implicit specialization decl.
-  if (isFriend && TemplateId)
-isFunctionTemplateSpecialization = true;
-}
-
-// If this is a function template specialization and the unqualified-id of
-// the declarator-id is a template-id, convert the template argument list
-// into our AST format and check for unexpanded packs.
-if (isFunctionTemplateSpecialization && TemplateId) {
-  HasExplicitTemplateArgs = true;
-
-  TemplateArgs.setLAngleLoc(TemplateId->LAngleLoc);
-  TemplateArgs.setRAngleLoc(TemplateId->RAngleLoc);
-  ASTTemplateArgsPtr TemplateArgsPtr(TemplateId->getTemplateArgs(),
- TemplateId->NumArgs);
-  translateTemplateArguments(TemplateArgsPtr, TemplateArgs);
-
-  // FIXME: Should we check for unexpanded packs if this was an (inval

[llvm-branch-commits] [llvm] [BOLT] Add CallSiteInfo entries in YAMLBAT (PR #76896)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76896



Test Plan: Updated bolt/test/X86/bolt-address-translation-yaml.test



___
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] [BOLT] Add BOLT Address Translation documentation (PR #76898)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76898



Test Plan: Open the page in browser



___
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] [BOLT] Encode BAT using ULEB128 (PR #76899)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76899

Reduces BAT section size, bytes:
- large binary: 38676872 -> 23262524 (0.60x),
- medium binary (trunk clang): 5938004 -> 3213504 (0.54x),
- small binary (X86/bolt-address-translation.test): 1436 -> 680 (0.47x).

Test Plan: Updated bolt/test/X86/bolt-address-translation.test



___
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] [BOLT] Delta-encode offsets in BAT (PR #76900)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76900

This change further reduces the size of BAT:
- large binary: to 13073904 bytes (0.34x original),
- medium binary: to 1703116 bytes (0.29x original),
- small binary: to 436 bytes (0.30x original).

Test Plan: Updated bolt/test/X86/bolt-address-translation.test



___
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] [BOLT] Delta-encode function start addresses in BAT (PR #76902)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76902

Further reduce the size of BAT section:
- large binary: to 12716312 bytes (0.33x original),
- medium binary: to 1649472 bytes (0.28x original),
- small binary: to 428 bytes (0.30x original).

Test Plan: Updated bolt/test/X86/bolt-address-translation.test



___
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] [BOLT] Embed cold mapping info into function entry in BAT (PR #76903)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76903

Reduces BAT section size:
- large binary: to 12283500 bytes (0.32x original size),
- medium binary: to 1616020 bytes (0.27x original size),
- small binary: to 404 bytes (0.28x original size).

Test Plan: Updated bolt/test/X86/bolt-address-translation.test



___
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] [BOLT] Use continuous output addresses in delta encoding in BAT (PR #76904)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76904



Test Plan:
Reduces BAT section size to:
- large binary: 12218860 bytes (0.32x original),
- medium binary: 1606580 bytes (0.27x original),
- small binary: 404 bytes (0.28x original),



___
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] [BOLT] Deduplicate equal offsets in BAT (PR #76905)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76905

Encode BRANCHENTRY bits as bitmask for deduplicated entries.

Reduces BAT section size:
- large binary: to 11834216 bytes (0.31x original),
- medium binary: to 1565584 bytes (0.26x original),
- small binary: to 336 bytes (0.23x original).

Test Plan: Updated bolt/test/X86/bolt-address-translation.test



___
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] [BOLT][NFC] Pass BF/BB hashes to BAT (PR #76906)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76906



Test Plan: NFC



___
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] [BOLT] Write and parse BF/BB hashes in BAT (PR #76907)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76907

This increases BAT section size to:
- large binary: 34832976 bytes (0.90x original),
- medium binary: 3586800 bytes (0.60x original),
- small binary: 816 bytes (0.57x original).

Test Plan: Updated bolt/test/X86/bolt-address-translation.test



___
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] [BOLT][NFC] Const-ify DataAggregator::getLocationName (PR #76908)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76908



Test Plan: NFC



___
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] [BOLT][NFC] Expose YAMLProfileWriter::convert function (PR #76909)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76909



Test Plan: NFC



___
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] [BOLT] Output YAML profile in BAT mode (PR #76910)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76910

Relax assumptions that YAML output is not supported in BAT mode.
Set up basic infrastructure for emitting YAML for functions not covered
by BAT, such as from `.bolt.org.text` section (code identical to input binary
sans external refs), or non-rewritten functions in non-relocation mode (where
the function stays in the same section but BAT mapping is not emitted).

Test Plan: Added bolt/test/X86/bolt-address-translation-yaml.test



___
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] [BOLT] Emit intra-function control flow in YAMLBAT (PR #76911)

2024-01-03 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/76911



Test Plan: Updated bolt/test/X86/bolt-address-translation-yaml.test



___
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] [BOLT] Deduplicate equal offsets in BAT (PR #76905)

2024-01-03 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 d19c0176523151e10e65538f1e3493c6f01d0b9c 
3165055eacc16e2cc21cd150237ac3c7d4505af6 -- 
bolt/include/bolt/Profile/BoltAddressTranslation.h 
bolt/lib/Profile/BoltAddressTranslation.cpp
``





View the diff from clang-format here.


``diff
diff --git a/bolt/lib/Profile/BoltAddressTranslation.cpp 
b/bolt/lib/Profile/BoltAddressTranslation.cpp
index f28077afbc..a3c8f318f8 100644
--- a/bolt/lib/Profile/BoltAddressTranslation.cpp
+++ b/bolt/lib/Profile/BoltAddressTranslation.cpp
@@ -127,7 +127,7 @@ APInt 
BoltAddressTranslation::calculateBranchEntriesBitMask(MapTy &Map,
   return BitMask;
 }
 
-size_t BoltAddressTranslation::getNumEqualOffsets(const MapTy& Map) const {
+size_t BoltAddressTranslation::getNumEqualOffsets(const MapTy &Map) const {
   size_t EqualOffsets = 0;
   for (const std::pair &KeyVal : Map) {
 const uint32_t OutputOffset = KeyVal.first;

``




https://github.com/llvm/llvm-project/pull/76905
___
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] [BOLT][NFC] Pass BF/BB hashes to BAT (PR #76906)

2024-01-03 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 8cf8215c0173bea7908d0641ed3b4360e2756be1 
1e2b86ac93cca125c9f93f33ee63bc5497d55935 -- 
bolt/include/bolt/Profile/BoltAddressTranslation.h 
bolt/lib/Profile/BoltAddressTranslation.cpp bolt/lib/Rewrite/RewriteInstance.cpp
``





View the diff from clang-format here.


``diff
diff --git a/bolt/lib/Profile/BoltAddressTranslation.cpp 
b/bolt/lib/Profile/BoltAddressTranslation.cpp
index e8f7e85bcc..2d1071df29 100644
--- a/bolt/lib/Profile/BoltAddressTranslation.cpp
+++ b/bolt/lib/Profile/BoltAddressTranslation.cpp
@@ -432,7 +432,8 @@ void BoltAddressTranslation::saveMetadata(BinaryContext 
&BC) {
 FuncHashes[BF.getAddress()].first = BF.computeHash();
 BF.computeBlockHashes();
 for (const BinaryBasicBlock &BB : BF)
-  FuncHashes[BF.getAddress()].second.emplace(BB.getInputOffset(), 
BB.getHash());
+  FuncHashes[BF.getAddress()].second.emplace(BB.getInputOffset(),
+ BB.getHash());
   }
 }
 } // namespace bolt

``




https://github.com/llvm/llvm-project/pull/76906
___
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] [BOLT] Output YAML profile in BAT mode (PR #76910)

2024-01-03 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 d60db34faa482127779ef0a0103d63e86c4a7025 
4d82ba03b6caa5d4d67d9406dcb9cffe694b922f -- 
bolt/include/bolt/Profile/BoltAddressTranslation.h 
bolt/include/bolt/Profile/DataAggregator.h bolt/lib/Profile/DataAggregator.cpp 
bolt/lib/Rewrite/RewriteInstance.cpp
``





View the diff from clang-format here.


``diff
diff --git a/bolt/lib/Profile/DataAggregator.cpp 
b/bolt/lib/Profile/DataAggregator.cpp
index 46392f3575..26eec1c5ab 100644
--- a/bolt/lib/Profile/DataAggregator.cpp
+++ b/bolt/lib/Profile/DataAggregator.cpp
@@ -2283,8 +2283,8 @@ DataAggregator::writeAggregatedFile(StringRef 
OutputFilename) const {
   return std::error_code();
 }
 
-std::error_code
-DataAggregator::writeBATYAML(BinaryContext &BC, StringRef OutputFilename) 
const {
+std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
+ StringRef OutputFilename) const {
   std::error_code EC;
   raw_fd_ostream OutFile(OutputFilename, EC, sys::fs::OpenFlags::OF_None);
   if (EC)
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp 
b/bolt/lib/Rewrite/RewriteInstance.cpp
index 364830d4fb..c6f38db17f 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -199,10 +199,9 @@ static cl::opt RelocationMode(
 "relocs", cl::desc("use relocations in the binary (default=autodetect)"),
 cl::cat(BoltCategory));
 
-cl::opt
-SaveProfile("w",
-  cl::desc("save recorded profile to a file"),
-  cl::cat(BoltOutputCategory));
+cl::opt SaveProfile("w",
+ cl::desc("save recorded profile to a file"),
+ cl::cat(BoltOutputCategory));
 
 static cl::list
 SkipFunctionNames("skip-funcs",

``




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