diff options
| author | Gabor Greif <ggreif@gmail.com> | 2010-07-12 14:15:58 +0000 |
|---|---|---|
| committer | Gabor Greif <ggreif@gmail.com> | 2010-07-12 14:15:58 +0000 |
| commit | 96fedcb1364f0b7eb1940eb0db198e3fe1376c08 (patch) | |
| tree | ca35f308739e6f4f708109b6b78b31f7198e16da | |
| parent | f9c38b5a4569f7a58f3fa429239dfce945baddb5 (diff) | |
| download | bcm5719-llvm-96fedcb1364f0b7eb1940eb0db198e3fe1376c08.tar.gz bcm5719-llvm-96fedcb1364f0b7eb1940eb0db198e3fe1376c08.zip | |
cache result of operator*
llvm-svn: 108147
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp index 65f03936870..f7fc62f9dc4 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -230,8 +230,9 @@ static bool isSafeAndProfitableToSinkLoad(LoadInst *L) { bool isAddressTaken = false; for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end(); UI != E; ++UI) { - if (isa<LoadInst>(UI)) continue; - if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) { + User *U = *UI; + if (isa<LoadInst>(U)) continue; + if (StoreInst *SI = dyn_cast<StoreInst>(U)) { // If storing TO the alloca, then the address isn't taken. if (SI->getOperand(1) == AI) continue; } |

