[PATCH] D29092: PR31729: [GVNHoist] Don't hoist unsafe scalars at -Oz

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 11:57:34 PST 2017


hiraditya added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVNHoist.cpp:510
     // where they are partially needed.
-    if (OptForMinSize)
+    if (OptForMinSize && isSafeToSpeculativelyExecute(I))
       return true;
----------------
majnemer wrote:
> Shouldn't we unconditionally do `isSafeToSpeculativelyExecute`?
GVNHoist already has facilities to check the dependencies, safety etc. which is more efficient than calling isSafeToSpeculativelyExecute all the time for each instruction.


https://reviews.llvm.org/D29092





More information about the llvm-commits mailing list