[PATCH] D99460: [X86][update_llc_test_checks] Use a less greedy regular expression for replacing constant pool labels in tests.

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 27 21:47:48 PDT 2021


pengfei added a comment.

In D99460#2654427 <https://reviews.llvm.org/D99460#2654427>, @craig.topper wrote:

> In D99460#2654420 <https://reviews.llvm.org/D99460#2654420>, @pengfei wrote:
>
>> 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 <https://reviews.llvm.org/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.



================
Comment at: llvm/test/CodeGen/X86/WidenArith.ll:14
 ; X86-NEXT:    vandps %ymm1, %ymm0, %ymm0
-; X86-NEXT:    vandps {{\.LCPI.*}}, %ymm0, %ymm0
+; X86-NEXT:    vandps {{\.LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0
 ; X86-NEXT:    retl
----------------
Nit: Should this be simplified to [0-9_]+?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99460/new/

https://reviews.llvm.org/D99460



More information about the llvm-commits mailing list