[llvm] r279082 - CVP. Turn marking adds as no wrap (introduced by r278107) off by default

Artur Pilipenko via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 09:08:36 PDT 2016


Author: apilipenko
Date: Thu Aug 18 11:08:35 2016
New Revision: 279082

URL: http://llvm.org/viewvc/llvm-project?rev=279082&view=rev
Log:
CVP. Turn marking adds as no wrap (introduced by r278107) off by default

It causes a regression on our internal benchmark. Introduce cvp-dont-process flag and set it off by default while investigating the regression.

Modified:
    llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
    llvm/trunk/test/Transforms/CorrelatedValuePropagation/add.ll

Modified: llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp?rev=279082&r1=279081&r2=279082&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp Thu Aug 18 11:08:35 2016
@@ -40,6 +40,8 @@ STATISTIC(NumDeadCases, "Number of switc
 STATISTIC(NumSDivs,     "Number of sdiv converted to udiv");
 STATISTIC(NumSRems,     "Number of srem converted to urem");
 
+static cl::opt<bool> DontProcessAdds("cvp-dont-process-adds", cl::init(true));
+
 namespace {
   class CorrelatedValuePropagation : public FunctionPass {
   public:
@@ -385,6 +387,9 @@ static bool processSDiv(BinaryOperator *
 static bool processAdd(BinaryOperator *AddOp, LazyValueInfo *LVI) {
   typedef OverflowingBinaryOperator OBO;
 
+  if (DontProcessAdds)
+    return false;
+
   if (AddOp->getType()->isVectorTy() || hasLocalDefs(AddOp))
     return false;
 

Modified: llvm/trunk/test/Transforms/CorrelatedValuePropagation/add.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CorrelatedValuePropagation/add.ll?rev=279082&r1=279081&r2=279082&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/CorrelatedValuePropagation/add.ll (original)
+++ llvm/trunk/test/Transforms/CorrelatedValuePropagation/add.ll Thu Aug 18 11:08:35 2016
@@ -1,4 +1,4 @@
-; RUN: opt < %s -correlated-propagation -S | FileCheck %s
+; RUN: opt < %s -correlated-propagation -cvp-dont-process-adds=false -S | FileCheck %s
 
 ; CHECK-LABEL: @test0(
 define void @test0(i32 %a) {




More information about the llvm-commits mailing list