llvm.org GIT mirror llvm / 821fe06
[ValueTracking] Revert r310583 which enabled functionality that still is causing compile time issues. Moreover, the patch *deleted* the flag in addition to changing the default, and links to a code review that doesn't even discuss the flag and just has an update to a Clang test case. I've followed up on the commit thread to ask for numbers on compile time at this point, leaving the flag in place until things stabilize, and pointing at specific code that seems to exhibit excessive compile time with this patch. Original commit message for r310583: """ [ValueTracking] Enabling ValueTracking patch by default (recommit). Part 2. 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. """" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310816 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 2 years ago
2 changed file(s) with 9 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
5252 // dominating comparisons.
5353 static cl::opt DomConditionsMaxUses("dom-conditions-max-uses",
5454 cl::Hidden, cl::init(20));
55
56 // This optimization is known to cause performance regressions is some cases,
57 // keep it under a temporary flag for now.
58 static cl::opt
59 DontImproveNonNegativePhiBits("dont-improve-non-negative-phi-bits",
60 cl::Hidden, cl::init(true));
5561
5662 /// Returns the bitwidth of the given scalar or pointer type. For vector types,
5763 /// returns the element type's bitwidth.
12501256
12511257 Known.Zero.setLowBits(std::min(Known2.countMinTrailingZeros(),
12521258 Known3.countMinTrailingZeros()));
1259
1260 if (DontImproveNonNegativePhiBits)
1261 break;
12531262
12541263 auto *OverflowOp = dyn_cast(LU);
12551264 if (OverflowOp && OverflowOp->hasNoSignedWrap()) {
+0
-27
test/Analysis/ValueTracking/non-negative-phi-bits.ll less more
None ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: opt -instcombine < %s -S | FileCheck %s
2
3 define void @test() #0 {
4 ; CHECK-LABEL: @test(
5 ; CHECK-NEXT: entry:
6 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
7 ; CHECK: for.body:
8 ; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
9 ; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
10 ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ult i64 [[INDVARS_IV_NEXT]], 40
11 ; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_END:%.*]], label [[FOR_BODY]]
12 ; CHECK: for.end:
13 ; CHECK-NEXT: ret void
14 ;
15 entry:
16 br label %for.body
17
18 for.body: ; preds = %for.body, %entry
19 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
20 %indvars.iv.next = add nsw i64 %indvars.iv, 1
21 %exitcond = icmp slt i64 %indvars.iv.next, 40
22 br i1 %exitcond, label %for.end, label %for.body
23
24 for.end: ; preds = %for.body
25 ret void
26 }