[PATCH] D109302: [PowerPC] Check subregister defines before removing XXMFACC/XXMTACC

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 06:57:38 PDT 2021


nemanjai added a comment.

Accumulator prime and deprime instructions are quite expensive. The logic of this patch seems to be contrary to what we actually want. Namely, this will ensure that we don't remove redundant `XXMTACC/XXMFACC` pairs if some subregister of the associated accumulator is **undefined** (or defined in another basic block). If it is undefined, we don't care what its value is so it doesn't seem like a good idea to activate MMA simply because of such poorly written code.
Honestly, anything is likely better than keeping these - including simply defining the undefined register to all zeros using `XXLXORz`. But of course, we can't simply change this code to zero out the register in case it is actually defined in another block.

Would it be possible to delete the instructions just like we currently do and then use `LivePhysRegs` to eliminate any uses of dead registers? Basically, what I mean is that if any changes were made in this peephole, we do what is effectively dead instruction elimination as the last thing the peephole does on the entire function.

Doing so would turn the function in the test case into an empty one (which would be the correct thing to do here).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109302



More information about the llvm-commits mailing list