[AMDGPU] Added assert in SIFoldOperands before ptr use. NFC.

This commit is contained in:
Stanislav Mekhanoshin 2019-11-04 13:21:19 -08:00
parent 3eecd601ed
commit 1bfcc60828
1 changed files with 1 additions and 0 deletions

View File

@ -1208,6 +1208,7 @@ void SIFoldOperands::foldInstOperand(MachineInstr &MI,
Copy->addImplicitDefUseOperands(*MF);
for (FoldCandidate &Fold : FoldList) {
assert(!Fold.isReg() || Fold.OpToFold);
if (Fold.isReg() && Register::isVirtualRegister(Fold.OpToFold->getReg())) {
Register Reg = Fold.OpToFold->getReg();
MachineInstr *DefMI = Fold.OpToFold->getParent();