summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/GuardUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/GuardUtils.cpp')
-rw-r--r--llvm/lib/Analysis/GuardUtils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/GuardUtils.cpp b/llvm/lib/Analysis/GuardUtils.cpp
index 18141069f6a..d4828327985 100644
--- a/llvm/lib/Analysis/GuardUtils.cpp
+++ b/llvm/lib/Analysis/GuardUtils.cpp
@@ -84,7 +84,10 @@ bool llvm::parseWidenableBranch(User *U, Use *&C,Use *&WC,
Value *A, *B;
if (!match(Cond, m_And(m_Value(A), m_Value(B))))
return false;
- auto *And = cast<Instruction>(Cond);
+ auto *And = dyn_cast<Instruction>(Cond);
+ if (!And)
+ // Could be a constexpr
+ return false;
if (match(A, m_Intrinsic<Intrinsic::experimental_widenable_condition>()) &&
A->hasOneUse()) {
OpenPOWER on IntegriCloud