[PATCH] D28170: [LICM] When promoting scalars, allow inserting stores to thread-local allocas

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 14:16:34 PST 2017


trentxintong added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Scalar/LICM.cpp:1037
     SafeToInsertStore =
-        isAllocLikeFn(Object, TLI) && !PointerMayBeCaptured(Object, true, true);
+        (isAllocLikeFn(Object, TLI) || isa<AllocaInst>(Object)) &&
+        !PointerMayBeCaptured(Object, true, true);
----------------
The question I really want to ask is whether the check for MayNotBeCaptured is necessary for Alloca. Should not alloca be implicitly thread local ? The language reference does not explicitly state it.


Repository:
  rL LLVM

https://reviews.llvm.org/D28170





More information about the llvm-commits mailing list