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

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 16:54:54 PDT 2016


MatzeB added inline comments.

================
Comment at: lib/Target/Hexagon/HexagonExpandCondsets.cpp:466-480
@@ +465,17 @@
+  unsigned VM = MRI->getMaxLaneMaskForVReg(Reg);
+  assert((VM & LM) != 0);
+  for (const MachineOperand &MO : MRI->def_operands(Reg)) {
+    if (!MO.isUndef())
+      continue;
+    unsigned SubReg = MO.getSubReg();
+    assert(SubReg != 0 && "Undef should only be set on subreg defs");
+    LaneBitmask M = TRI->getSubRegIndexLaneMask(SubReg);
+    LaneBitmask UM = VM & ~M;
+    if ((UM & LM) != 0) {
+      const MachineInstr &MI = *MO.getParent();
+      bool EarlyClobber = MO.isEarlyClobber();
+      SlotIndex Pos = Indexes.getInstructionIndex(MI).getRegSlot(EarlyClobber);
+      Undefs.push_back(Pos);
+    }
+  }
+
----------------
kparzysz wrote:
> MatzeB wrote:
> > This block appears to be the same as LiveRangeCalc::computeSubRangeUndefs(). We should find a way to share this code. Like adding a static variant of the function to LiveRangeCalc so you can call it independently of constructing a LiveRangeCalc instance.
> LiveRangeCalc is only available inside CodeGen.  Maybe we can move the "computeSubRangeUndefs" to LiveInterval?
sure


Repository:
  rL LLVM

https://reviews.llvm.org/D21189





More information about the llvm-commits mailing list