aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils/AddrModeMatcher.cpp
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
commit90b5b74fdcef687b02fba78307ca38e27bc63a67 (patch)
tree2851b34db043b456c04c791ddf1acdf186e8ad86 /lib/Transforms/Utils/AddrModeMatcher.cpp
parent8ea37e8776fc3ddb7deecdb92dc32684ed76bd51 (diff)
downloadexternal_llvm-90b5b74fdcef687b02fba78307ca38e27bc63a67.zip
external_llvm-90b5b74fdcef687b02fba78307ca38e27bc63a67.tar.gz
external_llvm-90b5b74fdcef687b02fba78307ca38e27bc63a67.tar.bz2
cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/AddrModeMatcher.cpp')
-rw-r--r--lib/Transforms/Utils/AddrModeMatcher.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/AddrModeMatcher.cpp b/lib/Transforms/Utils/AddrModeMatcher.cpp
index be6b383..c70bab5 100644
--- a/lib/Transforms/Utils/AddrModeMatcher.cpp
+++ b/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;
}