mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-19 04:28:20 +00:00
cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -69,11 +69,12 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
|
|||||||
|
|
||||||
// Only allow direct and non-volatile loads and stores...
|
// Only allow direct and non-volatile loads and stores...
|
||||||
for (Value::const_use_iterator UI = AI->use_begin(), UE = AI->use_end();
|
for (Value::const_use_iterator UI = AI->use_begin(), UE = AI->use_end();
|
||||||
UI != UE; ++UI) // Loop over all of the uses of the alloca
|
UI != UE; ++UI) { // Loop over all of the uses of the alloca
|
||||||
if (const LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
|
const User *U = *UI;
|
||||||
|
if (const LoadInst *LI = dyn_cast<LoadInst>(U)) {
|
||||||
if (LI->isVolatile())
|
if (LI->isVolatile())
|
||||||
return false;
|
return false;
|
||||||
} else if (const StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
|
} else if (const StoreInst *SI = dyn_cast<StoreInst>(U)) {
|
||||||
if (SI->getOperand(0) == AI)
|
if (SI->getOperand(0) == AI)
|
||||||
return false; // Don't allow a store OF the AI, only INTO the AI.
|
return false; // Don't allow a store OF the AI, only INTO the AI.
|
||||||
if (SI->isVolatile())
|
if (SI->isVolatile())
|
||||||
@@ -81,6 +82,7 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user