1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Fixed bug: test/Regression/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll

llvm-svn: 2423
This commit is contained in:
Chris Lattner 2002-05-01 15:38:23 +00:00
parent 2d267a0074
commit 8a6104c3cb

View File

@ -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.