diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-12 12:03:02 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-12 12:03:02 +0000 |
commit | 782f62412f4697ded32da733c01fa48295fae020 (patch) | |
tree | b250584e8f4c428bfcffc23fa455d088086cff13 /llvm/lib/Transforms | |
parent | 433b975fe2cb75551829a3697e38e72a18cca0c3 (diff) | |
download | bcm5719-llvm-782f62412f4697ded32da733c01fa48295fae020.tar.gz bcm5719-llvm-782f62412f4697ded32da733c01fa48295fae020.zip |
cache dereferenced iterators
llvm-svn: 108138
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/Reassociate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp index 5aca9cdc659..98452f5d82c 100644 --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp @@ -407,13 +407,14 @@ static Value *NegateValue(Value *V, Instruction *BI) { // Okay, we need to materialize a negated version of V with an instruction. // Scan the use lists of V to see if we have one already. for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E;++UI){ - if (!BinaryOperator::isNeg(*UI)) continue; + User *U = *UI; + if (!BinaryOperator::isNeg(U)) continue; // We found one! Now we have to make sure that the definition dominates // this use. We do this by moving it to the entry block (if it is a // non-instruction value) or right after the definition. These negates will // be zapped by reassociate later, so we don't need much finesse here. - BinaryOperator *TheNeg = cast<BinaryOperator>(*UI); + BinaryOperator *TheNeg = cast<BinaryOperator>(U); // Verify that the negate is in this function, V might be a constant expr. if (TheNeg->getParent()->getParent() != BI->getParent()->getParent()) |