cache result of operator*

llvm-svn: 108147
This commit is contained in:
Gabor Greif 2010-07-12 14:15:58 +00:00
parent f9c38b5a45
commit 96fedcb136
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}