mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Fixed bug: test/Regression/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2423 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5061263285
commit
68d024dde4
@ -79,6 +79,9 @@ static inline bool isSafeAlloca(const AllocaInst *AI) {
|
||||
|
||||
// Only allow nonindexed memory access instructions...
|
||||
if (MemAccessInst *MAI = dyn_cast<MemAccessInst>(*UI)) {
|
||||
if (MAI->getPointerOperand() != (Value*)AI)
|
||||
return false; // Reject stores of alloca pointer into some other loc.
|
||||
|
||||
if (MAI->hasIndices()) { // indexed?
|
||||
// Allow the access if there is only one index and the index is
|
||||
// zero.
|
||||
|
Loading…
Reference in New Issue
Block a user