forked from OSchip/llvm-project
ConstantFold - ConstantFoldSelectInstruction - assume constant vector elements are constant. NFCI.
Goes a bit further than rL372743 which added the early out - elements should be Constant so use cast<Constant> instead (and rely on the assert if anything fails). llvm-svn: 373321
This commit is contained in:
parent
d6d5eddcdb
commit
d71315f2ae
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue