summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-03-24 10:12:54 +0000
committerGabor Greif <ggreif@gmail.com>2010-03-24 10:12:54 +0000
commit11ff53146f307802a5dfbfdd9ab7b0cd428113f8 (patch)
tree9d5e5877a097a6a7fb597c19a5f877322deddb2e /llvm/lib
parent8712da360bed828ce235138cda62daaa051abda5 (diff)
downloadbcm5719-llvm-11ff53146f307802a5dfbfdd9ab7b0cd428113f8.tar.gz
bcm5719-llvm-11ff53146f307802a5dfbfdd9ab7b0cd428113f8.zip
cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way
llvm-svn: 99394
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Utils/AddrModeMatcher.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp b/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp
index be6b3834f27..c70bab5492e 100644
--- a/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp
+++ b/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp
@@ -440,8 +440,9 @@ static bool FindAllMemoryUses(Instruction *I,
}
if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
- if (UI.getOperandNo() == 0) return true; // Storing addr, not into addr.
- MemoryUses.push_back(std::make_pair(SI, UI.getOperandNo()));
+ unsigned opNo = UI.getOperandNo();
+ if (opNo == 0) return true; // Storing addr, not into addr.
+ MemoryUses.push_back(std::make_pair(SI, opNo));
continue;
}
OpenPOWER on IntegriCloud