[PATCH] D30751: [MachineCopyPropagation] Extend pass to do COPY source forwarding

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 13:43:18 PDT 2017


gberry marked 2 inline comments as done.
gberry added inline comments.


================
Comment at: lib/CodeGen/MachineCopyPropagation.cpp:455
+      if (MOUse.getSubReg())
+        NewUseReg = TRI->getSubReg(NewUseReg, MOUse.getSubReg());
+      // If the original use subreg isn't valid on the new src reg, we can't
----------------
qcolombet wrote:
> gberry wrote:
> > qcolombet wrote:
> > > That's invalid per the MachineVerifier
> > Can you elaborate on this?  I'm not sure what you are referring to as being invalid.
> Sorry. Physical registers don't have subreg indices. The machine verifier checks that.
In this case, the MOUse may not be a physical register.  We are replacing a possibly virtual reg (MOUse) with a physical reg (NewUseReg), so we need to make sure to translate the subreg on MOUse.  I've added a comment to hopefully clarify this a bit.


https://reviews.llvm.org/D30751





More information about the llvm-commits mailing list