From: Owen Anderson Date: Fri, 11 Jul 2008 20:05:13 +0000 (+0000) Subject: Don't call lookupNumber more than we have to. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c45996bf7464d4b5bc038abeff362f47fea401d9;p=oota-llvm.git Don't call lookupNumber more than we have to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53470 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 86a8238ee42..18a9661684f 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -1267,11 +1267,14 @@ bool GVN::performPRE(Function& F) { Value* op = BI->getOperand(i); if (isa(op) || isa(op) || isa(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