While working on D97208 I noticed that these greedy regular
expressions prevent tests from failing when (%rip) appears after
a constant pool label when it didn't before.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
26,400 ms | x64 windows > Clang.Driver::linux-ld.c |
Event Timeline
Are these changed manually? Can we update them with --no_x86_scrub_rip, i.e.
llvm/utils/update_llc_test_checks.py llvm/test/CodeGen/X86/WidenArith.ll --no_x86_scrub_rip
I modified asm.py and made it print this now. Most of the affected tests are 32-bit tests that don't use %rip so -no_x86_scrub_rip wouldn't affect them.
For 64-bit tests scrubbing rip replaces any tests before (%rip) with a regular expression like {{.*}}(%rip). The test check line will always contain %rip if it is part of the assembly. This matches before the LCP match. So for most 64-bit tests the presence of %rip prevents the LCP from being replaced with {{\.LCPI.*}}.
For cases affected by D97208, %rip is not currently present so the LCP scrub kicks in. Producing {{\.LCPI.*}} followed by a comma. Because that regex is greedy it will match up to the next comma. So whether there is an %rip in asm or not the regex will alway match. If you apply the X86InstrInfo.cpp and run the script on avx-cmp.ll and mmx-fold-zero.ll you'll get
{{.*}}(%rip)
If you add -no_x86_scrub_rip you'll get
{{LCPI.*}}(%rip)
I see, thanks.
llvm/test/CodeGen/X86/WidenArith.ll | ||
---|---|---|
14 | Nit: Should this be simplified to [0-9_]+? |
llvm/test/CodeGen/X86/WidenArith.ll | ||
---|---|---|
14 | We could but I thought it was best to keep it in sync with the scrub regex SCRUB_X86_LCP_RE = re.compile(r'\.LCPI[0-9]+_[0-9]+') |
Nit: Should this be simplified to [0-9_]+?