Skip the linear search if the answer is already known.
llvm-svn: 30251
This commit is contained in:
parent
5c3bdbad9b
commit
e94f42a740
|
|
@ -501,6 +501,11 @@ Value *PredicateSimplifier::resolve(SetCondInst *SCI,
|
|||
|
||||
Value *SCI0 = resolve(SCI->getOperand(0), KP),
|
||||
*SCI1 = resolve(SCI->getOperand(1), KP);
|
||||
|
||||
ConstantIntegral *CI1 = dyn_cast<ConstantIntegral>(SCI0),
|
||||
*CI2 = dyn_cast<ConstantIntegral>(SCI1);
|
||||
|
||||
if (!CI1 || !CI2) {
|
||||
PropertySet::ConstPropertyIterator NE =
|
||||
KP.findProperty(PropertySet::NE, SCI0, SCI1);
|
||||
|
||||
|
|
@ -520,11 +525,8 @@ Value *PredicateSimplifier::resolve(SetCondInst *SCI,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ConstantIntegral *CI1 = dyn_cast<ConstantIntegral>(SCI0),
|
||||
*CI2 = dyn_cast<ConstantIntegral>(SCI1);
|
||||
|
||||
if (!CI1 || !CI2) return SCI;
|
||||
return SCI;
|
||||
}
|
||||
|
||||
switch(SCI->getOpcode()) {
|
||||
case Instruction::SetLE:
|
||||
|
|
|
|||
Loading…
Reference in New Issue