[PATCH] D39536: [PowerPC] Eliminate redundant register copys after register allocation

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 02:49:03 PST 2017


inouehrs added a comment.

> If we're adding a new peephole, it likely won't only be used for this one purpose. A more general name might be in order.

I changed the pass name. Do you have any suggestion on an alternative name?

> This seems a bit fragile. I'm not sure there's any hard guarantee that the flag will be on the last source operand.

I modified to check the flag for both input operands.

> These loops as well as a check for whether the instruction is a call seem a little odd. Why is it inadequate to use MachineInstr::readsRegister() and MachineInstr::modifiesRegister() for these purposes. Given the TRI, they should return the correct value for any instruction (including calls).

`readsRegister` checks whether the instruction reads the specified register or its super register, but it does not check about sub register access. I need to check sub register access for safety.


https://reviews.llvm.org/D39536





More information about the llvm-commits mailing list