diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 0f440f001f0..1cc5c8f0da8 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -1034,7 +1034,8 @@ bool llvm::promoteLoopAccessesToScalars( if (!SafeToInsertStore) { Value *Object = GetUnderlyingObject(SomePtr, MDL); SafeToInsertStore = - isAllocLikeFn(Object, TLI) && !PointerMayBeCaptured(Object, true, true); + (isAllocLikeFn(Object, TLI) || isa<AllocaInst>(Object)) && + !PointerMayBeCaptured(Object, true, true); } // If we've still failed to prove we can sink the store, give up. |