[llvm] r316208 - [ValueTracking] Enabling ValueTracking patch by default
Nikolai Bozhenov via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 20 03:08:47 PDT 2017
Author: n.bozhenov
Date: Fri Oct 20 03:08:47 2017
New Revision: 316208
URL: http://llvm.org/viewvc/llvm-project?rev=316208&view=rev
Log:
[ValueTracking] Enabling ValueTracking patch by default
(recommit #2 after checking for timeout issue).
The original patch was an improvement to IR ValueTracking on
non-negative integers. It has been checked in to trunk (D18777,
r284022). But was disabled by default due to performance regressions.
Perf impact has improved. The patch would be enabled by default.
Reviewers: reames, hfinkel
Differential Revision: https://reviews.llvm.org/D34101
Patch by: Olga Chupina <olga.chupina at intel.com>
Modified:
llvm/trunk/lib/Analysis/ValueTracking.cpp
llvm/trunk/test/Transforms/LoopUnroll/runtime-unroll-remainder.ll
Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=316208&r1=316207&r2=316208&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Fri Oct 20 03:08:47 2017
@@ -83,12 +83,6 @@ const unsigned MaxDepth = 6;
static cl::opt<unsigned> DomConditionsMaxUses("dom-conditions-max-uses",
cl::Hidden, cl::init(20));
-// This optimization is known to cause performance regressions is some cases,
-// keep it under a temporary flag for now.
-static cl::opt<bool>
-DontImproveNonNegativePhiBits("dont-improve-non-negative-phi-bits",
- cl::Hidden, cl::init(true));
-
/// Returns the bitwidth of the given scalar or pointer type. For vector types,
/// returns the element type's bitwidth.
static unsigned getBitWidth(Type *Ty, const DataLayout &DL) {
@@ -1289,9 +1283,6 @@ static void computeKnownBitsFromOperator
Known.Zero.setLowBits(std::min(Known2.countMinTrailingZeros(),
Known3.countMinTrailingZeros()));
- if (DontImproveNonNegativePhiBits)
- break;
-
auto *OverflowOp = dyn_cast<OverflowingBinaryOperator>(LU);
if (OverflowOp && OverflowOp->hasNoSignedWrap()) {
// If initial value of recurrence is nonnegative, and we are adding
Modified: llvm/trunk/test/Transforms/LoopUnroll/runtime-unroll-remainder.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/runtime-unroll-remainder.ll?rev=316208&r1=316207&r2=316208&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopUnroll/runtime-unroll-remainder.ll (original)
+++ llvm/trunk/test/Transforms/LoopUnroll/runtime-unroll-remainder.ll Fri Oct 20 03:08:47 2017
@@ -47,7 +47,7 @@ for.cond.cleanup:
; CHECK: or i64 [[INDVAR0]], 1
; CHECK: or i64 [[INDVAR0]], 2
; CHECK: or i64 [[INDVAR0]], 3
-; CHECK: add nsw i64 [[INDVAR0]], 4
+; CHECK: add nuw nsw i64 [[INDVAR0]], 4
; CHECK: [[SUB:%[a-z.0-9]+]] = add i64 [[ITER]], -4
; CHECK: [[ITER_CMP:%[a-z.0-9]+]] = icmp eq i64 [[SUB]], 0
; CHECK: br i1 [[ITER_CMP]], label %[[LOOP_EXIT:.*]], label %for.body
More information about the llvm-commits
mailing list