Skip to content

Commit 5cd9a9b

Browse files
committed
Revert r282872 "CVP. Turn marking adds as no wrap on by default"
While not CVP's fault, this caused miscompiles (PR31181). Reverting until those are resolved. (This also reverts the follow-ups r288154 and r288161 which removed the flag.) llvm-svn: 296030
1 parent 1181328 commit 5cd9a9b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ STATISTIC(NumSDivs, "Number of sdiv converted to udiv");
4141
STATISTIC(NumAShrs, "Number of ashr converted to lshr");
4242
STATISTIC(NumSRems, "Number of srem converted to urem");
4343

44+
static cl::opt<bool> DontProcessAdds("cvp-dont-process-adds", cl::init(true));
45+
4446
namespace {
4547
class CorrelatedValuePropagation : public FunctionPass {
4648
public:
@@ -405,6 +407,9 @@ static bool processAShr(BinaryOperator *SDI, LazyValueInfo *LVI) {
405407
static bool processAdd(BinaryOperator *AddOp, LazyValueInfo *LVI) {
406408
typedef OverflowingBinaryOperator OBO;
407409

410+
if (DontProcessAdds)
411+
return false;
412+
408413
if (AddOp->getType()->isVectorTy() || hasLocalDefs(AddOp))
409414
return false;
410415

llvm/test/Transforms/CorrelatedValuePropagation/add.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -correlated-propagation -S | FileCheck %s
1+
; RUN: opt < %s -correlated-propagation -cvp-dont-process-adds=false -S | FileCheck %s
22

33
; CHECK-LABEL: @test0(
44
define void @test0(i32 %a) {

0 commit comments

Comments
 (0)