Skip to content

Commit 999f45a

Browse files
committed
fix VL may contain PoisonValue
1 parent 1097781 commit 999f45a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,10 +1229,13 @@ static InstructionsState getSameOpcode(ArrayRef<Value *> VL,
12291229

12301230
if (IsBinOp) {
12311231
auto FindOp = [&](ArrayRef<InterchangeableInstruction> CandidateOp) {
1232-
for (Value *V : VL)
1232+
for (Value *V : VL) {
1233+
if (!isa<Instruction>(V))
1234+
continue;
12331235
for (const InterchangeableInstruction &I : CandidateOp)
12341236
if (cast<Instruction>(V)->getOpcode() == I.Opcode)
12351237
return cast<Instruction>(V);
1238+
}
12361239
llvm_unreachable(
12371240
"Cannot find the candidate instruction for InstructionsState.");
12381241
};

0 commit comments

Comments
 (0)