} else {
// Otherwise, add it to the renaming set
LiveInterval& I = LI.getOrCreateInterval(SrcReg);
} else {
// Otherwise, add it to the renaming set
LiveInterval& I = LI.getOrCreateInterval(SrcReg);
- unsigned idx = LI.getMBBEndIdx(P->getOperand(i).getMBB());
+ unsigned idx = LI.getMBBEndIdx(P->getOperand(i).getMBB()) - 1;
VNInfo* VN = I.getLiveRangeContaining(idx)->valno;
assert(VN && "No VNInfo for register?");
VNInfo* VN = I.getLiveRangeContaining(idx)->valno;
assert(VN && "No VNInfo for register?");