cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif
2010-07-09 15:40:10 +00:00
parent 7556cf541b
commit 7656018c22
2 changed files with 10 additions and 7 deletions
+3 -2
View File
@@ -771,8 +771,9 @@ void IndVarSimplify::SinkUnusedInvariants(Loop *L) {
bool UsedInLoop = false;
for (Value::use_iterator UI = I->use_begin(), UE = I->use_end();
UI != UE; ++UI) {
BasicBlock *UseBB = cast<Instruction>(UI)->getParent();
if (PHINode *P = dyn_cast<PHINode>(UI)) {
User *U = *UI;
BasicBlock *UseBB = cast<Instruction>(U)->getParent();
if (PHINode *P = dyn_cast<PHINode>(U)) {
unsigned i =
PHINode::getIncomingValueNumForOperand(UI.getOperandNo());
UseBB = P->getIncomingBlock(i);