[PATCH] D21189: Create subranges for new intervals resulting from live interval splitting

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 09:27:45 PDT 2016


kparzysz added inline comments.

================
Comment at: lib/CodeGen/TargetInstrInfo.cpp:381-385
@@ -380,3 +380,7 @@
   MachineInstr *MI = MBB.getParent()->CloneMachineInstr(&Orig);
-  MI->substituteRegister(MI->getOperand(0).getReg(), DestReg, SubIdx, TRI);
+  MachineOperand &DefOp = MI->getOperand(0);
+  assert(DefOp.isReg() && DefOp.isDef());
+  MI->substituteRegister(DefOp.getReg(), DestReg, SubIdx, TRI);
+  if (!DefOp.getSubReg())
+    DefOp.setIsUndef(false);
   MBB.insert(I, MI);
----------------
kparzysz wrote:
> MatzeB wrote:
> > This will fail if there is more than 1 definition or implicit definitions. It would probably be better to patch MachineOperand::substVirtReg() which in turn is used by MachineInstr::substituteRegister()
> This one is still not done.  I will post a separate patch for this on Monday.
It was substPhysReg that needed to be updated and the change was fairly trivial, so I just fixed it in r279437.


Repository:
  rL LLVM

https://reviews.llvm.org/D21189





More information about the llvm-commits mailing list