[llvm-commits] [llvm] r51661 - /llvm/trunk/lib/Analysis/ValueNumbering.cpp
Gabor Greif
ggreif at gmail.com
Wed May 28 17:51:09 PDT 2008
Author: ggreif
Date: Wed May 28 19:51:08 2008
New Revision: 51661
URL: http://llvm.org/viewvc/llvm-project?rev=51661&view=rev
Log:
convert another operand loop to iterator formulation
Modified:
llvm/trunk/lib/Analysis/ValueNumbering.cpp
Modified: llvm/trunk/lib/Analysis/ValueNumbering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueNumbering.cpp?rev=51661&r1=51660&r2=51661&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueNumbering.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueNumbering.cpp Wed May 28 19:51:08 2008
@@ -244,9 +244,9 @@
// Try to pick a local operand if possible instead of a constant or a global
// that might have a lot of uses.
- for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i)
- if (isa<Instruction>(I.getOperand(i)) || isa<Argument>(I.getOperand(i))) {
- Op = I.getOperand(i);
+ for (User::op_iterator i = I.op_begin() + 1, e = I.op_end(); i != e; ++i)
+ if (isa<Instruction>(*i) || isa<Argument>(*i)) {
+ Op = *i;
break;
}
More information about the llvm-commits
mailing list