[llvm-commits] [llvm] r109222 - /llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.cpp
Gabor Greif
ggreif at gmail.com
Fri Jul 23 03:23:01 PDT 2010
Author: ggreif
Date: Fri Jul 23 05:23:01 2010
New Revision: 109222
URL: http://llvm.org/viewvc/llvm-project?rev=109222&view=rev
Log:
do not (implicitly) dereference iterator many times, cache it instead
Modified:
llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.cpp
Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.cpp?rev=109222&r1=109221&r2=109222&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.cpp Fri Jul 23 05:23:01 2010
@@ -171,8 +171,9 @@
for (Module::iterator MI = M.begin(), E = M.end(); MI != E; ++MI) {
for (Value::use_iterator I = MI->use_begin(), E = MI->use_end(); I != E;
++I) {
- if ((!isa<CallInst>(I) && !isa<InvokeInst>(I))
- || !CallSite(cast<Instruction>(I)).isCallee(I)) {
+ User *U = *I;
+ if ((!isa<CallInst>(U) && !isa<InvokeInst>(U))
+ || !CallSite(cast<Instruction>(U)).isCallee(I)) {
setColor(MI, ++IndirectCallColor);
break;
}
More information about the llvm-commits
mailing list