From 00a6365c1749c13e4dc466bf2720834f23474f50 Mon Sep 17 00:00:00 2001 From: Min Hsu Date: Tue, 30 Jan 2024 14:50:09 -0800 Subject: [PATCH] [Exegesis] Print epsilon value in the sched model inconsistency report --- llvm/test/tools/llvm-exegesis/X86/analysis-epsilons.test | 2 ++ llvm/tools/llvm-exegesis/lib/Analysis.cpp | 3 +++ 2 files changed, 5 insertions(+) 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: 0.10 # 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: 100.00 # 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( OS << "

Cpu: "; writeEscaped(OS, FirstPoint.CpuName); OS << "

"; + OS << "

Epsilon: " + << format("%0.2f", std::sqrt(AnalysisInconsistencyEpsilonSquared_)) + << "

"; const auto &SI = State_.getSubtargetInfo(); for (const auto &RSCAndPoints : makePointsPerSchedClass()) {