From 1bc8daba4fa3e27c115969c4c996dd1f7d52a3e4 Mon Sep 17 00:00:00 2001 From: David Zarzycki Date: Sun, 24 Jan 2021 08:50:37 -0500 Subject: [PATCH] Fix x86 exegesis tests after c042aff8860df3cad2b274bf0a495e83ae36ddee In c042aff8860df3cad2b274bf0a495e83ae36ddee, unused FileCheck prefixes became an error, which exposed some testing bugs in four exegesis tests. I've tried my best to either fix the testing bugs, or expand the testing to cover more scenarios. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D95287 --- .../X86/analysis-cluster-stabilization.test | 4 ++-- .../X86/analysis-clustering-algorithms.test | 16 ++++++++-------- .../analysis-naive-cluster-stabilization.test | 12 ++++++------ .../X86/analysis-naive-clusterization.test | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/llvm/test/tools/llvm-exegesis/X86/analysis-cluster-stabilization.test b/llvm/test/tools/llvm-exegesis/X86/analysis-cluster-stabilization.test index 1579993c6b7a..8f6981ea1c2e 100644 --- a/llvm/test/tools/llvm-exegesis/X86/analysis-cluster-stabilization.test +++ b/llvm/test/tools/llvm-exegesis/X86/analysis-cluster-stabilization.test @@ -1,6 +1,6 @@ # RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-clustering-epsilon=0.1 -analysis-inconsistency-epsilon=0.1 -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-CLUSTERS %s -# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-ALL,CHECK-INCONSISTENCIES-STABLE %s -# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-display-unstable-clusters -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-ALL,CHECK-INCONSISTENCIES-UNSTABLE %s +# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-STABLE %s +# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-display-unstable-clusters -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-UNSTABLE %s # We have one ADD32rr measurement, and two measurements for SQRTSSr. # The ADD32rr measurement and one of the SQRTSSr measurements are identical, diff --git a/llvm/test/tools/llvm-exegesis/X86/analysis-clustering-algorithms.test b/llvm/test/tools/llvm-exegesis/X86/analysis-clustering-algorithms.test index 00cb1054a691..e56a91483044 100644 --- a/llvm/test/tools/llvm-exegesis/X86/analysis-clustering-algorithms.test +++ b/llvm/test/tools/llvm-exegesis/X86/analysis-clustering-algorithms.test @@ -30,14 +30,14 @@ # And -analysis-clustering=naive every opcode goes into separate cluster. -# CHECK-CLUSTERS-NAIVE-049-NEXT: {{^}}0, -# CHECK-CLUSTERS-NAIVE-049-SAME: ,1.50{{$}} -# CHECK-CLUSTERS-NAIVE-049: {{^}}1, -# CHECK-CLUSTERS-NAIVE-049-SAME: ,2.00{{$}} -# CHECK-CLUSTERS-NAIVE-049: {{^}}2, -# CHECK-CLUSTERS-NAIVE-049-SAME: ,2.50{{$}} -# CHECK-CLUSTERS-NAIVE-049: {{^}}3, -# CHECK-CLUSTERS-NAIVE-049-SAME: ,1.00{{$}} +# CHECK-CLUSTERS-NAIVE-NEXT: {{^}}0, +# CHECK-CLUSTERS-NAIVE-SAME: ,1.50{{$}} +# CHECK-CLUSTERS-NAIVE: {{^}}1, +# CHECK-CLUSTERS-NAIVE-SAME: ,2.00{{$}} +# CHECK-CLUSTERS-NAIVE: {{^}}2, +# CHECK-CLUSTERS-NAIVE-SAME: ,2.50{{$}} +# CHECK-CLUSTERS-NAIVE: {{^}}3, +# CHECK-CLUSTERS-NAIVE-SAME: ,1.00{{$}} # The "value" is manually specified, not measured. diff --git a/llvm/test/tools/llvm-exegesis/X86/analysis-naive-cluster-stabilization.test b/llvm/test/tools/llvm-exegesis/X86/analysis-naive-cluster-stabilization.test index 0ac9bbde8cdf..1d0b892062d8 100644 --- a/llvm/test/tools/llvm-exegesis/X86/analysis-naive-cluster-stabilization.test +++ b/llvm/test/tools/llvm-exegesis/X86/analysis-naive-cluster-stabilization.test @@ -1,17 +1,17 @@ -# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-CLUSTERS-ALL,CHECK-CLUSTERS-05 %s +# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-CLUSTERS-ALL %s # RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-STABLE-05 %s # RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-display-unstable-clusters -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-UNSTABLE-05 %s -# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-clustering-epsilon=0.49 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-CLUSTERS-ALL,CHECK-CLUSTERS-049 %s +# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-clustering-epsilon=0.49 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-CLUSTERS-ALL %s # RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.49 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-STABLE-049 %s # RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.49 -analysis-inconsistency-epsilon=0.5 -analysis-display-unstable-clusters -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-UNSTABLE-049 %s # CHECK-CLUSTERS-ALL: {{^}}cluster_id,opcode_name,config,sched_class,latency{{$}} -# CHECK-CLUSTERS-NEXT-05: {{^}}0, -# CHECK-CLUSTERS-SAME-05: ,90.00{{$}} -# CHECK-CLUSTERS-05: {{^}}0, -# CHECK-CLUSTERS-SAME-05: ,90.50{{$}} +# CHECK-CLUSTERS-ALL-NEXT: {{^}}0, +# CHECK-CLUSTERS-ALL-SAME: ,90.00{{$}} +# CHECK-CLUSTERS-ALL: {{^}}0, +# CHECK-CLUSTERS-ALL-SAME: ,90.50{{$}} # CHECK-INCONSISTENCIES-STABLE-05: ADD32rr # CHECK-INCONSISTENCIES-STABLE-05: ADD32rr diff --git a/llvm/test/tools/llvm-exegesis/X86/analysis-naive-clusterization.test b/llvm/test/tools/llvm-exegesis/X86/analysis-naive-clusterization.test index 9f557a5b9c7b..cfb7b1037001 100644 --- a/llvm/test/tools/llvm-exegesis/X86/analysis-naive-clusterization.test +++ b/llvm/test/tools/llvm-exegesis/X86/analysis-naive-clusterization.test @@ -1,6 +1,6 @@ # RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-clustering-epsilon=0.1 -analysis-inconsistency-epsilon=0.1 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-CLUSTERS %s -# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-ALL,CHECK-INCONSISTENCIES-STABLE %s -# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-display-unstable-clusters -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-ALL,CHECK-INCONSISTENCIES-UNSTABLE %s +# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-STABLE %s +# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-display-unstable-clusters -analysis-numpoints=1 -analysis-clustering=naive | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-UNSTABLE %s # We have two ADD32rr measurements, and two measurements for SQRTSSr. # ADD32rr measurements are neighbours.