[PATCH] D20944: LICM: Don't sink stores out of loops that may throw.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 21:02:59 PDT 2016


hfinkel added inline comments.

================
Comment at: lib/Transforms/Scalar/LICM.cpp:936
@@ +935,3 @@
+    // Currently, this code just special-cases alloca instructions.
+    if (!isa<AllocaInst>(GetUnderlyingObject(SomePtr, MDL)))
+      return false;
----------------
The assumption here is that stores to allocas much be unobservable after the function unwinds, and I agree with that. However, what if the exception is caught in this function. In that case, such a store might still be observable.

Also, it would be friendlier to call GetUnderlyingObjects and check whether any are not allocas (if we can determine that there are no relevant landingpads?).



http://reviews.llvm.org/D20944





More information about the llvm-commits mailing list