From 11ff53146f307802a5dfbfdd9ab7b0cd428113f8 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Wed, 24 Mar 2010 10:12:54 +0000 Subject: cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way llvm-svn: 99394 --- llvm/lib/Transforms/Utils/AddrModeMatcher.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms') 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(*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; } -- cgit v1.2.3