[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 14:03:27 PDT 2017
mcrosier updated this revision to Diff 110476.
mcrosier edited the summary of this revision.
mcrosier added a comment.
-Disable this feature by default.
-Update test RUN commands due to change.
https://reviews.llvm.org/D36539
Files:
lib/Transforms/Scalar/NewGVN.cpp
test/Transforms/NewGVN/completeness.ll
test/Transforms/NewGVN/pr33461.ll
test/Transforms/NewGVN/storeoverstore.ll
Index: test/Transforms/NewGVN/storeoverstore.ll
===================================================================
--- test/Transforms/NewGVN/storeoverstore.ll
+++ test/Transforms/NewGVN/storeoverstore.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -newgvn -S < %s | FileCheck %s
-; RUN: opt -passes=newgvn -S -o - %s | FileCheck %s
+; RUN: opt -newgvn -enable-phi-of-ops=true -S < %s | FileCheck %s
+; RUN: opt -passes=newgvn -enable-phi-of-ops=true -S -o - %s | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
Index: test/Transforms/NewGVN/pr33461.ll
===================================================================
--- test/Transforms/NewGVN/pr33461.ll
+++ test/Transforms/NewGVN/pr33461.ll
@@ -1,6 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
;; Ensure the store verifier is not overzealous
-; RUN: opt -newgvn -S %s | FileCheck %s
+; RUN: opt -newgvn -enable-phi-of-ops=true -S %s | FileCheck %s
@b = external global i16, align 2
define void @patatino() {
Index: test/Transforms/NewGVN/completeness.ll
===================================================================
--- test/Transforms/NewGVN/completeness.ll
+++ test/Transforms/NewGVN/completeness.ll
@@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -basicaa -newgvn -S | FileCheck %s
+; RUN: opt < %s -basicaa -newgvn -enable-phi-of-ops=true -S | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
define i32 @test1(i32, i8**) {
Index: lib/Transforms/Scalar/NewGVN.cpp
===================================================================
--- lib/Transforms/Scalar/NewGVN.cpp
+++ lib/Transforms/Scalar/NewGVN.cpp
@@ -127,6 +127,10 @@
static cl::opt<bool> EnableStoreRefinement("enable-store-refinement",
cl::init(false), cl::Hidden);
+/// Currently, the generation "phi of ops" can result in correctness issues.
+static cl::opt<bool> EnablePhiOfOps("enable-phi-of-ops", cl::init(false),
+ cl::Hidden);
+
//===----------------------------------------------------------------------===//
// GVN Pass
//===----------------------------------------------------------------------===//
@@ -2442,6 +2446,8 @@
}
static bool okayForPHIOfOps(const Instruction *I) {
+ if (!EnablePhiOfOps)
+ return false;
return isa<BinaryOperator>(I) || isa<SelectInst>(I) || isa<CmpInst>(I) ||
isa<LoadInst>(I);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36539.110476.patch
Type: text/x-patch
Size: 2605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170809/6360525e/attachment.bin>
More information about the llvm-commits
mailing list