summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index ee0ad322f4e..54814bbdaf3 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -746,8 +746,7 @@ Constant *llvm::ConstantFoldSelectInstruction(Constant *Cond,
ConstantInt::get(Ty, i));
Constant *V2Element = ConstantExpr::getExtractElement(V2,
ConstantInt::get(Ty, i));
- Constant *Cond = dyn_cast<Constant>(CondV->getOperand(i));
- if (!Cond) break;
+ auto *Cond = cast<Constant>(CondV->getOperand(i));
if (V1Element == V2Element) {
V = V1Element;
} else if (isa<UndefValue>(Cond)) {
OpenPOWER on IntegriCloud