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
//===----------------------------------------------------------------------===//
}
static bool okayForPHIOfOps(const Instruction *I) {
+ if (!EnablePhiOfOps)
+ return false;
return isa<BinaryOperator>(I) || isa<SelectInst>(I) || isa<CmpInst>(I) ||
isa<LoadInst>(I);
}
; 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**) {
; 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() {
; 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"