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

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 13:37:39 PDT 2016


majnemer added a subscriber: majnemer.

================
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;
+
----------------
This should logic should go earlier, before we cloned the gep.


https://reviews.llvm.org/D22644





More information about the llvm-commits mailing list