mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
- Fix bug: Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
llvm-svn: 3917
This commit is contained in:
parent
7fafece8e0
commit
2cf19d980a
@ -79,8 +79,13 @@ static inline bool isSafeAlloca(const AllocaInst *AI) {
|
||||
// Only allow direct loads and stores...
|
||||
for (Value::use_const_iterator UI = AI->use_begin(), UE = AI->use_end();
|
||||
UI != UE; ++UI) // Loop over all of the uses of the alloca
|
||||
if (!isa<LoadInst>(*UI) && !isa<StoreInst>(*UI))
|
||||
return false; // Not a load or store?
|
||||
if (!isa<LoadInst>(*UI))
|
||||
if (const StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
|
||||
if (SI->getOperand(0) == AI)
|
||||
return false; // Don't allow a store of the AI, only INTO the AI.
|
||||
} else {
|
||||
return false; // Not a load or store?
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user