[llvm] 8241106 - [Exegesis] Print epsilon value in the sched model inconsistency report (#80080)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 09:13:44 PST 2024


Author: Min-Yih Hsu
Date: 2024-01-31T09:13:38-08:00
New Revision: 8241106bf30fa74f27e324ba23c42a3503ab5707

URL: https://github.com/llvm/llvm-project/commit/8241106bf30fa74f27e324ba23c42a3503ab5707
DIFF: https://github.com/llvm/llvm-project/commit/8241106bf30fa74f27e324ba23c42a3503ab5707.diff

LOG: [Exegesis] Print epsilon value in the sched model inconsistency report (#80080)

Since I've formatted the epsilon value, I don't think it's necessary to
escape it.

Added: 
    

Modified: 
    llvm/test/tools/llvm-exegesis/X86/analysis-epsilons.test
    llvm/tools/llvm-exegesis/lib/Analysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-exegesis/X86/analysis-epsilons.test b/llvm/test/tools/llvm-exegesis/X86/analysis-epsilons.test
index 9d9b09d0c6a10..405b15a986218 100644
--- a/llvm/test/tools/llvm-exegesis/X86/analysis-epsilons.test
+++ b/llvm/test/tools/llvm-exegesis/X86/analysis-epsilons.test
@@ -20,10 +20,12 @@
 # CHECK-CLUSTERS-ONE-NEXT: {{^}}0,
 # CHECK-CLUSTERS-ONE-SAME: ,100.00{{$}}
 
+# CHECK-INCONSISTENCIES-FAIL: Epsilon: <span class="mono">0.10</span>
 # CHECK-INCONSISTENCIES-FAIL: contains instructions whose performance characteristics do not match that of LLVM
 # CHECK-INCONSISTENCIES-FAIL: contains instructions whose performance characteristics do not match that of LLVM
 # CHECK-INCONSISTENCIES-FAIL-NOT: contains instructions whose performance characteristics do not match that of LLVM
 
+# CHECK-INCONSISTENCIES-PASS: Epsilon: <span class="mono">100.00</span>
 # CHECK-INCONSISTENCIES-PASS-NOT: contains instructions whose performance characteristics do not match that of LLVM
 
 ---

diff  --git a/llvm/tools/llvm-exegesis/lib/Analysis.cpp b/llvm/tools/llvm-exegesis/lib/Analysis.cpp
index 418fee8be74f0..be10c32cf08d5 100644
--- a/llvm/tools/llvm-exegesis/lib/Analysis.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Analysis.cpp
@@ -524,6 +524,9 @@ Error Analysis::run<Analysis::PrintSchedClassInconsistencies>(
   OS << "</span></h3><h3>Cpu: <span class=\"mono\">";
   writeEscaped<kEscapeHtml>(OS, FirstPoint.CpuName);
   OS << "</span></h3>";
+  OS << "<h3>Epsilon: <span class=\"mono\">"
+     << format("%0.2f", std::sqrt(AnalysisInconsistencyEpsilonSquared_))
+     << "</span></h3>";
 
   const auto &SI = State_.getSubtargetInfo();
   for (const auto &RSCAndPoints : makePointsPerSchedClass()) {


        


More information about the llvm-commits mailing list