[llvm-commits] [llvm] r117766 - /llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
Jim Grosbach
grosbach at apple.com
Fri Oct 29 18:40:17 PDT 2010
Author: grosbach
Date: Fri Oct 29 20:40:16 2010
New Revision: 117766
URL: http://llvm.org/viewvc/llvm-project?rev=117766&view=rev
Log:
Avoid re-evaluating MI.getNumOperands() every iteration of the loop.
Modified:
llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp?rev=117766&r1=117765&r2=117766&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp Fri Oct 29 20:40:16 2010
@@ -293,7 +293,7 @@
// Convert a list of GPRs into a bitfield (R0 -> bit 0). For each
// register in the list, set the corresponding bit.
unsigned Binary = 0;
- for (unsigned i = Op; i < MI.getNumOperands(); ++i) {
+ for (unsigned i = Op, e = MI.getNumOperands(); i < e; ++i) {
unsigned regno = getARMRegisterNumbering(MI.getOperand(i).getReg());
Binary |= 1 << regno;
}
More information about the llvm-commits
mailing list