aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit11ff53146f307802a5dfbfdd9ab7b0cd428113f8 (patch)
tree9d5e5877a097a6a7fb597c19a5f877322deddb2e /llvm/lib/Transforms/Utils/AddrModeMatcher.cpp
parent8712da360bed828ce235138cda62daaa051abda5 (diff)
downloadllvm-11ff53146f307802a5dfbfdd9ab7b0cd428113f8.zip
llvm-11ff53146f307802a5dfbfdd9ab7b0cd428113f8.tar.gz
llvm-11ff53146f307802a5dfbfdd9ab7b0cd428113f8.tar.bz2
cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way
llvm-svn: 99394
Diffstat (limited to 'llvm/lib/Transforms/Utils/AddrModeMatcher.cpp')
-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 be6b383..c70bab5 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;
}