Skip to content

Commit 241210f

Browse files
committed
[CodeGen][NFC] Guard copy propogation in machine CSE against undefs
1 parent aa3589f commit 241210f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/MachineCSE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ bool MachineCSE::PerformTrivialCopyPropagation(MachineInstr *MI,
184184
continue;
185185
bool OnlyOneUse = MRI->hasOneNonDBGUse(Reg);
186186
MachineInstr *DefMI = MRI->getVRegDef(Reg);
187-
if (!DefMI->isCopy())
187+
if (!DefMI || !DefMI->isCopy())
188188
continue;
189189
Register SrcReg = DefMI->getOperand(1).getReg();
190190
if (!SrcReg.isVirtual())

0 commit comments

Comments
 (0)