Skip to content

Commit a575afd

Browse files
jaladreipsigcbot
authored andcommitted
Fix a crash in EmitVISAPass
Fix a crash where we look for a previous instruction but it's not there, resulting in dyn_casting a nullptr.
1 parent 5f4fc0e commit a575afd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5503,7 +5503,7 @@ void EmitPass::emitSimdShuffle(llvm::Instruction *inst) {
55035503

55045504
bool bAllowLVNMatchingForAnd = true;
55055505
if (isSimd32 && data->GetType() == ISA_TYPE_F) {
5506-
if (auto *prevInst = dyn_cast<llvm::Instruction>(inst->getPrevNode()))
5506+
if (auto *prevInst = dyn_cast_or_null<llvm::Instruction>(inst->getPrevNode()))
55075507
if (GetOpCode(prevInst) == EOPCODE::llvm_fadd)
55085508
bAllowLVNMatchingForAnd = false;
55095509
}

0 commit comments

Comments
 (0)