summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMichael Kuperstein <mkuper@google.com>2016-12-30 01:03:17 +0000
committerMichael Kuperstein <mkuper@google.com>2016-12-30 01:03:17 +0000
commit76e06c8858b144c80f8584e539eeb6b8786690e8 (patch)
treee15578568e2e2979e49dcf3bad2bf2adabe5818b /llvm/lib/Transforms
parentcc76344ef5f2b5752759f92111efe00dd736a11e (diff)
downloadbcm5719-llvm-76e06c8858b144c80f8584e539eeb6b8786690e8.tar.gz
bcm5719-llvm-76e06c8858b144c80f8584e539eeb6b8786690e8.zip
[LICM] When promoting scalars, allow inserting stores to thread-local allocas.
This is similar to the allocfn case - if an alloca is not captured, then it's necessarily thread-local. Differential Revision: https://reviews.llvm.org/D28170 llvm-svn: 290738
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp3
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.
OpenPOWER on IntegriCloud