[PATCH] D39785: [PowerPC] Remove redundant register copies in late peephole

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 06:05:23 PST 2017


nemanjai added inline comments.


================
Comment at: lib/Target/PowerPC/PPCPreEmitPeephole.cpp:80
+          } else if ((RedundantPairMI = hasRedundantPair(MI))) {
+            InstrsToErase.push_back(RedundantPairMI);
+            NumRedundantPairsFound++;
----------------
inouehrs wrote:
> Do you eliminate only the second `mr`, not both `mr`s?
> We have additional opportunity to erase first `mr` by rewriting uses of r3 with r30.
This isn't safe to do in general. The motivating test case for example has a call. That call needs the value to be in r3, so I can't just tell it to use r30.


Repository:
  rL LLVM

https://reviews.llvm.org/D39785





More information about the llvm-commits mailing list