[llvm] r310594 - [NewGVN] Add CL option to control the generation of phi-of-ops (disable by default).
Chad Rosier via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 10 07:12:57 PDT 2017
Author: mcrosier
Date: Thu Aug 10 07:12:57 2017
New Revision: 310594
URL: http://llvm.org/viewvc/llvm-project?rev=310594&view=rev
Log:
[NewGVN] Add CL option to control the generation of phi-of-ops (disable by default).
Differential Revision: https://reviews.llvm.org/D36478539
Modified:
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
llvm/trunk/test/Transforms/NewGVN/completeness.ll
llvm/trunk/test/Transforms/NewGVN/pr33461.ll
llvm/trunk/test/Transforms/NewGVN/storeoverstore.ll
Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=310594&r1=310593&r2=310594&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Thu Aug 10 07:12:57 2017
@@ -127,6 +127,10 @@ DEBUG_COUNTER(PHIOfOpsCounter, "newgvn-p
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 @@ void NewGVN::addPhiOfOps(PHINode *Op, Ba
}
static bool okayForPHIOfOps(const Instruction *I) {
+ if (!EnablePhiOfOps)
+ return false;
return isa<BinaryOperator>(I) || isa<SelectInst>(I) || isa<CmpInst>(I) ||
isa<LoadInst>(I);
}
Modified: llvm/trunk/test/Transforms/NewGVN/completeness.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/NewGVN/completeness.ll?rev=310594&r1=310593&r2=310594&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/NewGVN/completeness.ll (original)
+++ llvm/trunk/test/Transforms/NewGVN/completeness.ll Thu Aug 10 07:12:57 2017
@@ -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**) {
Modified: llvm/trunk/test/Transforms/NewGVN/pr33461.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/NewGVN/pr33461.ll?rev=310594&r1=310593&r2=310594&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/NewGVN/pr33461.ll (original)
+++ llvm/trunk/test/Transforms/NewGVN/pr33461.ll Thu Aug 10 07:12:57 2017
@@ -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() {
Modified: llvm/trunk/test/Transforms/NewGVN/storeoverstore.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/NewGVN/storeoverstore.ll?rev=310594&r1=310593&r2=310594&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/NewGVN/storeoverstore.ll (original)
+++ llvm/trunk/test/Transforms/NewGVN/storeoverstore.ll Thu Aug 10 07:12:57 2017
@@ -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"
More information about the llvm-commits
mailing list