Don't call lookupNumber more than we have to.

llvm-svn: 53470
This commit is contained in:
Owen Anderson 2008-07-11 20:05:13 +00:00
parent eb04d356e3
commit cc861329ee

View File

@ -1267,11 +1267,14 @@ bool GVN::performPRE(Function& F) {
Value* op = BI->getOperand(i);
if (isa<Argument>(op) || isa<Constant>(op) || isa<GlobalValue>(op))
PREInstr->setOperand(i, op);
else if (!lookupNumber(PREPred, VN.lookup(op))) {
success = false;
break;
} else
PREInstr->setOperand(i, lookupNumber(PREPred, VN.lookup(op)));
else {
Value* V = lookupNumber(PREPred, VN.lookup(op));
if (!V) {
success = false;
break;
} else
PREInstr->setOperand(i, V);
}
}
// Fail out if we encounter an operand that is not available in