diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-03-24 10:12:54 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-03-24 10:12:54 +0000 |
commit | 11ff53146f307802a5dfbfdd9ab7b0cd428113f8 (patch) | |
tree | 9d5e5877a097a6a7fb597c19a5f877322deddb2e /llvm/lib | |
parent | 8712da360bed828ce235138cda62daaa051abda5 (diff) | |
download | bcm5719-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.cpp | 5 |
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; } |