[PATCH] D65267: [PowerPC][PreEmitPeephole] Remove redundant copies of immediate numbers after TailDup

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 22:49:52 PDT 2019


lkail added a comment.

In D65267#1625969 <https://reviews.llvm.org/D65267#1625969>, @jsji wrote:

> Have you considered extend MachineCopyPropagation to cover this? Looks like to me that this is a 'backward' COPY propagation.


Yes, it's indeed a backward COPY problem. But I suggest not to implement it in machine-cp. I've inspected MIR of arm64 and x86-64, no such pattern is generated after taildup. If I implement it in machine-cp, I might write some like `isMoveImmediate` and invoke target hook like `TII->FoldImmediate`. However currently only `PowerPC` implements specific `TII->FoldImmediate`. Taking above into account, this issues seems not general enough to implement in machine-cp.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65267





More information about the llvm-commits mailing list