cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way
llvm-svn: 99394
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 @@
}
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;
}