[PATCH] D22644: [GVNHoist] Don't clone allocas (PR28606)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 13:41:46 PDT 2016


hans marked an inline comment as done.

================
Comment at: lib/Transforms/Scalar/GVNHoist.cpp:609-614
@@ -608,2 +608,8 @@
     // Also copy Val.
     if (Val) {
+      // Don't copy allocas: it can either pessimize the program by turning a
+      // static alloca into a dynamic one, or worse it could break the program
+      // if it's inserted in the live range of an inalloca.
+      if (isa<AllocaInst>(Val))
+        return false;
+
----------------
majnemer wrote:
> This should logic should go earlier, before we cloned the gep.
Oops, thanks!


https://reviews.llvm.org/D22644





More information about the llvm-commits mailing list