aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/PredicateInfo.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-23 19:12:20 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-23 19:36:51 +0200
commitdef48b0e8886ce219b4a77c6e7115a4a86147e04 (patch)
treeaa2635247c7bac162a0059d7f17bd115478a29bf /llvm/lib/Transforms/Utils/PredicateInfo.cpp
parentbfc4294ef61d5cf69fffe6b64287a323c003d90f (diff)
downloadllvm-def48b0e8886ce219b4a77c6e7115a4a86147e04.zip
llvm-def48b0e8886ce219b4a77c6e7115a4a86147e04.tar.gz
llvm-def48b0e8886ce219b4a77c6e7115a4a86147e04.tar.bz2
[PredicateInfo][SCCP] Remove assertion (PR46814)
As long as RenamedOp is not guaranteed to be accurate, we cannot assert here and should just return false. This was already done for the other conditions in this function. Fixes https://bugs.llvm.org/show_bug.cgi?id=46814.
Diffstat (limited to 'llvm/lib/Transforms/Utils/PredicateInfo.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/PredicateInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
index 280d3a9..d9bd77e 100644
--- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp
+++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
@@ -837,7 +837,10 @@ Optional<PredicateConstraint> PredicateBase::getConstraint() const {
}
CmpInst *Cmp = dyn_cast<CmpInst>(Condition);
- assert(Cmp && "Condition should be a CmpInst");
+ if (!Cmp) {
+ // TODO: Make this an assertion once RenamedOp is fully accurate.
+ return None;
+ }
CmpInst::Predicate Pred;
Value *OtherOp;