diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-05-01 15:38:23 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-05-01 15:38:23 +0000 |
| commit | b3e81510d7602760e297cb9ff6c93a55de9b7e54 (patch) | |
| tree | a2801050bd6a125d5eb1dd50212b0f0f6f2b9bc3 /llvm/lib/Transforms | |
| parent | 65d4dcb6ca9f210f1231c107189f1cc24908489e (diff) | |
| download | bcm5719-llvm-b3e81510d7602760e297cb9ff6c93a55de9b7e54.tar.gz bcm5719-llvm-b3e81510d7602760e297cb9ff6c93a55de9b7e54.zip | |
Fixed bug: test/Regression/Transforms/Mem2Reg/2002-05-01-ShouldNotPromoteThisAlloca.ll
llvm-svn: 2423
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index ee8300215f7..294c39a08f2 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -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. |

