aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-06-08 12:51:29 +0200
committerNikita Popov <npopov@redhat.com>2022-06-09 10:12:13 +0200
commit56c9976d46ba078799f98bc5440f1792edcb71ad (patch)
tree19e49171aac266cfb84e8c1103bd126487f56594 /llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
parentf971e77fb4ec12256f4486fe6174e67639f06661 (diff)
downloadllvm-56c9976d46ba078799f98bc5440f1792edcb71ad.zip
llvm-56c9976d46ba078799f98bc5440f1792edcb71ad.tar.gz
llvm-56c9976d46ba078799f98bc5440f1792edcb71ad.tar.bz2
[IndVarSimplify] Don't assert that terminator is not SCEVable (PR55925)
The IV widening code currently asserts that terminators aren't SCEVable -- however, this is not the case for invokes with a returned attribute. As far as I can tell, this assertions is not necessary -- even if we have a critical edge (the second test case), the trunc gets inserted in a legal position. Fixes https://github.com/llvm/llvm-project/issues/55925. Differential Revision: https://reviews.llvm.org/D127288
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyIndVar.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyIndVar.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index 6617fde..dbef1ff 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -1757,10 +1757,6 @@ Instruction *WidenIV::widenIVUse(WidenIV::NarrowIVDefUse DU, SCEVExpander &Rewri
truncateIVUse(DU, DT, LI);
return nullptr;
}
- // Assume block terminators cannot evaluate to a recurrence. We can't to
- // insert a Trunc after a terminator if there happens to be a critical edge.
- assert(DU.NarrowUse != DU.NarrowUse->getParent()->getTerminator() &&
- "SCEV is not expected to evaluate a block terminator");
// Reuse the IV increment that SCEVExpander created as long as it dominates
// NarrowUse.