Skip to content

Commit e696f4e

Browse files
[llvm-exegesis] Fix LBR checks/test
This patch fixes the LBR check in the local lit config. The test would segfault as the loop body would be basically empty, causing a divide by zero error. More investigation is needed there so we do not actually hit that assertion and report a cleaner error somewhere. Specifying an actual opcode to benchmark fixes the problem. The test would also fail as -mcpu was set to the default x86 CPU rather than the one currently being run on, so it would always fail to find a perf counter. This patch fixes that by simply removing the -mcpu flag. Given these issues, I'm not sure these tests have ever run in the ~5 years they have been in tree. There were some issues reported in \#132861, so I guess we'll see if there are further issues when the testing becomes more broad.
1 parent 847e46c commit e696f4e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/test/tools/llvm-exegesis/X86/lbr/mov-add.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mode=latency --repetition-mode=loop --x86-lbr-sample-period=521 --snippets-file=%p/Inputs/mov_add.att
1+
# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency --repetition-mode=loop --x86-lbr-sample-period=521 --snippets-file=%p/Inputs/mov_add.att
22
# REQUIRES: exegesis-can-execute-x86_64, exegesis-can-measure-latency-lbr
33

44

llvm/test/tools/llvm-exegesis/lit.local.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def can_use_perf_counters(mode, extra_options=[]):
2020
return False
2121
try:
2222
return_code = subprocess.call(
23-
[llvm_exegesis_exe, "-mode", mode, "-snippets-file", "/dev/null"]
23+
[llvm_exegesis_exe, "-mode", mode, "-opcode-name=ADD64rr"]
2424
+ extra_options,
2525
stdout=subprocess.DEVNULL,
2626
stderr=subprocess.DEVNULL,

0 commit comments

Comments
 (0)