aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index ddce360..056111b 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2906,7 +2906,11 @@ static unsigned ComputeNumSignBitsImpl(const Value *V,
case Instruction::ShuffleVector: {
// Collect the minimum number of sign bits that are shared by every vector
// element referenced by the shuffle.
- auto *Shuf = cast<ShuffleVectorInst>(U);
+ auto *Shuf = dyn_cast<ShuffleVectorInst>(U);
+ if (!Shuf) {
+ // FIXME: Add support for shufflevector constant expressions.
+ return 1;
+ }
APInt DemandedLHS, DemandedRHS;
// For undef elements, we don't know anything about the common state of
// the shuffle result.