Save LaneMask with livein registers
[oota-llvm.git] / lib / CodeGen / TailDuplication.cpp
index ca929d9fa4504f5b80f8ec872c40147839de5994..4a71c668623f37a89a64499fb976a1713fc80fa1 100644 (file)
@@ -791,8 +791,8 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB,
       RS->enterBasicBlock(PredBB);
       if (!PredBB->empty())
         RS->forward(std::prev(PredBB->end()));
-      for (unsigned LI : TailBB->liveins()) {
-        if (!RS->isRegUsed(LI, false))
+      for (const auto &LI : TailBB->liveins()) {
+        if (!RS->isRegUsed(LI.PhysReg, false))
           // If a register is previously livein to the tail but it's not live
           // at the end of predecessor BB, then it should be added to its
           // livein list.