[PATCH] D116832: [UpdateLLCTestChecks] Allow replacing register names with variables

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 22:47:46 PST 2022


pengfei added a comment.

> If the instructions basically keep the same number of register operands and the number of instructions remains the same, I think the FileCheck variable names should remain stable.

No, assuming we have a test case:

  define i32 @foo(i32 %0, i32 %0, i32 %0)
  ; CHECK:       # %bb.0:
  ; CHECK-NEXT:    add %R0, %R1
  ; CHECK-NEXT:    add %R0, %R2
  ; CHECK-NEXT:    other_use_def %R1
  ; CHECK-NEXT:    other_use_def %R2

A patch that only exchanges the order of the first add to

  ; CHECK-NEXT:    add %R0, %R2
  ; CHECK-NEXT:    add %R0, %R1

Then, the other use and def of %R1 <https://reviews.llvm.org/diffusion/L/> and %R2 <https://reviews.llvm.org/source/clang-tools-extra/> will remain unchanged.
But if you are numbering the register by order, all the other %R1 <https://reviews.llvm.org/diffusion/L/> and %R2 <https://reviews.llvm.org/source/clang-tools-extra/> will be changed while the expected change won't be shown. This is rather confusing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116832



More information about the llvm-commits mailing list