[PATCH] D36539: [NewGVN] Add command-line option to control the generation of phi-of-ops. NFC.

Chad Rosier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 12:17:04 PDT 2017

mcrosier created this revision.
Herald added a subscriber: Prazek.

Useful for testing and debugging.  I'll let Danny/Davide decide if this should be disabled by default, but for the time being it remains enabled.



Index: lib/Transforms/Scalar/NewGVN.cpp
--- lib/Transforms/Scalar/NewGVN.cpp
+++ lib/Transforms/Scalar/NewGVN.cpp
@@ -127,6 +127,11 @@
 static cl::opt<bool> EnableStoreRefinement("enable-store-refinement",
                                            cl::init(false), cl::Hidden);
+/// Currently, the generation "phi of ops" can result in correctness issues.
+/// This flag lets us keep it working while we work on these issues.
+static cl::opt<bool> EnablePhiOfOps("enable-phi-of-ops", cl::init(true),
+                                    cl::Hidden);
 //                                GVN Pass
@@ -2442,6 +2447,8 @@
 static bool okayForPHIOfOps(const Instruction *I) {
+  if (!EnablePhiOfOps)
+    return false;
   return isa<BinaryOperator>(I) || isa<SelectInst>(I) || isa<CmpInst>(I) ||

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36539.110448.patch
Type: text/x-patch
Size: 1063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170809/6a58d574/attachment.bin>

More information about the llvm-commits mailing list