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
This commit is contained in:
Gabor Greif 2010-03-24 10:12:54 +00:00
parent bbdca3f68e
commit 5eff285d8d

View File

@ -440,8 +440,9 @@ static bool FindAllMemoryUses(Instruction *I,
} }
if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) { if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
if (UI.getOperandNo() == 0) return true; // Storing addr, not into addr. unsigned opNo = UI.getOperandNo();
MemoryUses.push_back(std::make_pair(SI, UI.getOperandNo())); if (opNo == 0) return true; // Storing addr, not into addr.
MemoryUses.push_back(std::make_pair(SI, opNo));
continue; continue;
} }