Skip to content

Commit 2437784

Browse files
committed
[LV] Replace unreachable by folding into else with assert (NFC).
Simplify code as suggested post-commit in #110576.
1 parent 38fca7b commit 2437784

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,14 +2795,14 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi,
27952795
Escape = B.CreateSub(EndValue, Step);
27962796
else if (EndValue->getType()->isPointerTy())
27972797
Escape = B.CreatePtrAdd(EndValue, B.CreateNeg(Step));
2798-
else if (EndValue->getType()->isFloatingPointTy()) {
2798+
else {
2799+
assert(EndValue->getType()->isFloatingPointTy() &&
2800+
"Unexpected induction type");
27992801
Escape = B.CreateBinOp(II.getInductionBinOp()->getOpcode() ==
28002802
Instruction::FAdd
28012803
? Instruction::FSub
28022804
: Instruction::FAdd,
28032805
EndValue, Step);
2804-
} else {
2805-
llvm_unreachable("all possible induction types must be handled");
28062806
}
28072807
Escape->setName("ind.escape");
28082808
MissingVals[UI] = Escape;

0 commit comments

Comments
 (0)