[PATCH] D24854: [SROA] Drop lifetime.start/end intrinsics when they block promotion.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 10:19:06 PDT 2016


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/SROA.cpp:2897-2901
+    bool IsWholeAlloca = NewBeginOffset == NewAllocaBeginOffset &&
+                         NewEndOffset == NewAllocaEndOffset;
+    if (!II.getFunction()->hasFnAttribute(Attribute::SanitizeAddress) &&
+        !IsWholeAlloca)
+      return true;
----------------
chandlerc wrote:
> FWIW, I think this is sufficient to avoid regressing ASan while allowing promotion through partial lifetime markers. Is there something that breaks if you make this change and not the changes above? If so, I'd like to find a way to temporarily work around them as I think fully handling ASan + lifetime markers + promotable allocas is going to be a big project.
The assertion on 2262 ("assert(CanSROA);") fails without the other changes.

I can probably narrow the other checks so they only trigger on partial lifetime markers, if you think that would be an improvement.


Repository:
  rL LLVM

https://reviews.llvm.org/D24854





More information about the llvm-commits mailing list