From: Gabor Greif Date: Wed, 24 Mar 2010 10:12:54 +0000 (+0000) Subject: cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5eff285d8df05c7a570377aa83daf9fdfc536b62;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Utils/AddrModeMatcher.cpp b/lib/Transforms/Utils/AddrModeMatcher.cpp index be6b3834f27..c70bab5492e 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(*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; }