From: Gabor Greif Date: Mon, 12 Jul 2010 14:15:58 +0000 (+0000) Subject: cache result of operator* X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=40119ceeecafdd6d47bd7bb7f520262858b931df;p=oota-llvm.git cache result of operator* git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108147 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombinePHI.cpp b/lib/Transforms/InstCombine/InstCombinePHI.cpp index 65f03936870..f7fc62f9dc4 100644 --- a/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/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(UI)) continue; - if (StoreInst *SI = dyn_cast(*UI)) { + User *U = *UI; + if (isa(U)) continue; + if (StoreInst *SI = dyn_cast(U)) { // If storing TO the alloca, then the address isn't taken. if (SI->getOperand(1) == AI) continue; }