diff options
author | Florian Hahn <flo@fhahn.com> | 2024-10-21 21:46:47 -0700 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2024-10-21 21:46:48 -0700 |
commit | 2437784a178adb299cf6e363427e98611e3d2460 (patch) | |
tree | c8c27227548ca27a0c2fcc45add9aa1f8a3d6679 /llvm/lib | |
parent | 38fca7b7db2ba1647c87679d6750fc4a4bfe72e1 (diff) | |
download | llvm-2437784a178adb299cf6e363427e98611e3d2460.zip llvm-2437784a178adb299cf6e363427e98611e3d2460.tar.gz llvm-2437784a178adb299cf6e363427e98611e3d2460.tar.bz2 |
[LV] Replace unreachable by folding into else with assert (NFC).
Simplify code as suggested post-commit in
https://github.com/llvm/llvm-project/pull/110576/.
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index a88989a..60a94ca 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2795,14 +2795,14 @@ void InnerLoopVectorizer::fixupIVUsers(PHINode *OrigPhi, Escape = B.CreateSub(EndValue, Step); else if (EndValue->getType()->isPointerTy()) Escape = B.CreatePtrAdd(EndValue, B.CreateNeg(Step)); - else if (EndValue->getType()->isFloatingPointTy()) { + else { + assert(EndValue->getType()->isFloatingPointTy() && + "Unexpected induction type"); Escape = B.CreateBinOp(II.getInductionBinOp()->getOpcode() == Instruction::FAdd ? Instruction::FSub : Instruction::FAdd, EndValue, Step); - } else { - llvm_unreachable("all possible induction types must be handled"); } Escape->setName("ind.escape"); MissingVals[UI] = Escape; |