This was causing two test failures when I applied D129208 to enable
extra verification of LiveIntervals:
LLVM :: CodeGen/AMDGPU/optimize-negated-cond-exec-masking-wave32.mir
LLVM :: CodeGen/AMDGPU/optimize-negated-cond-exec-masking.mir
Differential Revision: https://reviews.llvm.org/D147721
LIS->removeVRegDefAt(*SelLI, SelIdx.getRegSlot());
LIS->RemoveMachineInstrFromMaps(*Sel);
+ bool ShrinkSel = Sel->getOperand(0).readsReg();
Sel->eraseFromParent();
+ if (ShrinkSel) {
+ // The result of the V_CNDMASK was a subreg def which counted as a read
+ // from the other parts of the reg. Shrink their live ranges.
+ LIS->shrinkToUses(SelLI);
+ }
}
}