Skip to content

Commit 8028263

Browse files
committed
Recommit "[ConstraintElim] Enable pass by default."
This reverts commit 695ce48. The compile-time regression causing the revert has been fixed. Recommit the original patch. Original commit message: The pass should help to close a functional gap when it comes to reasoning about related conditions in a relatively general way. It addresses multiple existing issues (linked below) and the need for a more powerful reasoning system was also discussed recently in https://discourse.llvm.org/t/rfc-alternative-approach-of-dealing-with-implications-from-comparisons-through-pos-analysis/65601/7 On AArch64, the new pass performs ~2000 simplifications on MultiSource,SPEC2006,SPEC2017 with -O3. Compile-time impact: NewPM-O3: +0.20% NewPM-ReleaseThinLTO: +0.32% NewPM-ReleaseLTO-g: +0.28% https://llvm-compile-time-tracker.com/compare.php?from=f01a3a893c147c1594b9a3fbd817456b209dabbf&to=577688758ef64fb044215ec3e497ea901bb2db28&stat=instructions:u Fixes #49344. Fixes #47888. Fixes #48253. Fixes #49229. Fixes #58074. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D135915
1 parent 4b8fdb6 commit 8028263

8 files changed

+8
-1
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static cl::opt<bool> CountCGSCCVisits(
270270
"CGSCC pipeline as a statistic"));
271271

272272
static cl::opt<bool> EnableConstraintElimination(
273-
"enable-constraint-elimination", cl::init(false), cl::Hidden,
273+
"enable-constraint-elimination", cl::init(true), cl::Hidden,
274274
cl::desc(
275275
"Enable pass to eliminate conditions based on linear constraints"));
276276

llvm/test/Other/new-pm-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
156156
; CHECK-O-NEXT: Running pass: InstCombinePass
157157
; CHECK-O3-NEXT: AggressiveInstCombinePass
158+
; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
158159
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
159160
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
160161
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass

llvm/test/Other/new-pm-lto-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
; CHECK-O23SZ-NEXT: Running pass: DeadArgumentEliminationPass
8585
; CHECK-O23SZ-NEXT: Running pass: InstCombinePass
8686
; CHECK-EP-Peephole-NEXT: Running pass: NoOpFunctionPass
87+
; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
8788
; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
8889
; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
8990
; CHECK-O23SZ-NEXT: Running pass: SROAPass on foo

llvm/test/Other/new-pm-thinlto-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
132132
; CHECK-O-NEXT: Running pass: InstCombinePass
133133
; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
134+
; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
134135
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
135136
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
136137
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass

llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
9595
; CHECK-O-NEXT: Running pass: InstCombinePass
9696
; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
97+
; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
9798
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
9899
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
99100
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass

llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
104104
; CHECK-O-NEXT: Running pass: InstCombinePass
105105
; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
106+
; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
106107
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
107108
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
108109
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass

llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
; CHECK-O-DAG: Running analysis: BranchProbabilityAnalysis on foo
132132
; CHECK-O-DAG: Running analysis: PostDominatorTreeAnalysis on foo
133133
; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
134+
; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
134135
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
135136
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
136137
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass

llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
9999
; CHECK-O-NEXT: Running pass: InstCombinePass
100100
; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
101+
; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
101102
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
102103
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
103104
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass

0 commit comments

Comments
 (0)