[llvm-commits] [llvm] r53470 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Owen Anderson
resistor at mac.com
Fri Jul 11 13:05:13 PDT 2008
Author: resistor
Date: Fri Jul 11 15:05:13 2008
New Revision: 53470
URL: http://llvm.org/viewvc/llvm-project?rev=53470&view=rev
Log:
Don't call lookupNumber more than we have to.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=53470&r1=53469&r2=53470&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Jul 11 15:05:13 2008
@@ -1267,11 +1267,14 @@
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
More information about the llvm-commits
mailing list