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

David Greene via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 13:39:14 PST 2022


greened added a comment.

In D116832#3245756 <https://reviews.llvm.org/D116832#3245756>, @pengfei wrote:

> Although the new regexp looks much concise, you still haven't solved the second question @hvdijk raised.



> I cannot imagine there will be a simple method that can keep the register corresponding relationship between instructions while keep them unchanged with minor instruction changes.

Define "minor."  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.  I would classify those as "minor" changes.  Changing whole swaths of asm is not "minor" in my mind.

> Counting the register number won't solve the problem either. Imagine the first instruction is removed or scheduled somewhere, will be all register names changed too? Isn't it even wores? And I evaluated it on D64174 <https://reviews.llvm.org/D64174> and think the problem is still there.

If a test is going to check all of the asm generated for it, then yes, if the instruction counts change, scheduling changes, etc. then the FileCheck variable names will change, because there are different uses and defs.  Remember that this enhancement is in the context of other enhancements.  Namely, I have a patch (which I plan to submit soon) to filter the output such that smaller bits of asm can be checked.  Then the register generalizing is applied after that.  It's much less likely for small bits of focused asm to change the number of instructions, for example.

You're right that for D64174 <https://reviews.llvm.org/D64174> there will be some name changes, because the number of instructions changed.  I agree that there isn't a good solution for that outside of triming down what the test is looking at.  Do those tests really have to look at *all* of the generated insrtuctions?  I suspect not.  If you narrow the scope of the check, you'll naturally get fewer register dependency changes in that scope.


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