Skip to content

Commit 19560ab

Browse files
Auto merge of #150940 - dianqk:rm-simplify_comparison_integral, r=<try>
Removes SimplifyComparisonIntegral pass
2 parents f57eac1 + b2d9dc5 commit 19560ab

File tree

36 files changed

+534
-1441
lines changed

36 files changed

+534
-1441
lines changed

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ declare_passes! {
194194
AfterConstProp,
195195
Final
196196
};
197-
mod simplify_comparison_integral : SimplifyComparisonIntegral;
198197
mod single_use_consts : SingleUseConsts;
199198
mod sroa : ScalarReplacementOfAggregates;
200199
mod strip_debuginfo : StripDebugInfo;
@@ -747,7 +746,6 @@ pub(crate) fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'
747746
&o1(simplify_branches::SimplifyConstCondition::AfterConstProp),
748747
&jump_threading::JumpThreading,
749748
&early_otherwise_branch::EarlyOtherwiseBranch,
750-
&simplify_comparison_integral::SimplifyComparisonIntegral,
751749
&o1(simplify_branches::SimplifyConstCondition::Final),
752750
&o1(remove_noop_landing_pads::RemoveNoopLandingPads),
753751
&o1(simplify::SimplifyCfg::Final),

compiler/rustc_mir_transform/src/simplify_comparison_integral.rs

Lines changed: 0 additions & 249 deletions
This file was deleted.

tests/codegen-llvm/hint/likely.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn test4(x: u64) {
7070
}
7171

7272
// CHECK-LABEL: @test4(
73-
// CHECK: br i1 %0, label %bb3, label %bb2, !prof ![[NUM2:[0-9]+]]
73+
// CHECK: br i1 {{.*}}, label %bb3, label %bb2, !prof ![[NUM2:[0-9]+]]
7474
// CHECK: bb3:
7575
// CHECK: path_a
7676
// CHECK: bb2:

tests/codegen-llvm/hint/unlikely.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn test4(x: u64) {
7070
}
7171

7272
// CHECK-LABEL: @test4(
73-
// CHECK: br i1 %0, label %bb4, label %bb2, !prof ![[NUM2:[0-9]+]]
73+
// CHECK: br i1 {{.*}}, label %bb4, label %bb2, !prof ![[NUM2:[0-9]+]]
7474
// CHECK: bb4:
7575
// CHECK: path_a
7676
// CHECK: bb2:

tests/mir-opt/funky_arms.float_to_exponential_common.GVN.32bit.panic-abort.diff

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@
2929
debug precision => _8;
3030
let _8: usize;
3131
scope 5 (inlined Formatter::<'_>::precision) {
32-
let mut _22: u32;
32+
let mut _22: bool;
3333
let mut _23: u32;
34-
let mut _24: usize;
35-
let mut _25: u16;
34+
let mut _24: u32;
35+
let mut _25: usize;
36+
let mut _26: u16;
3637
}
3738
}
3839
}
@@ -71,10 +72,12 @@
7172
StorageLive(_6);
7273
StorageLive(_22);
7374
StorageLive(_23);
74-
_23 = copy (((*_1).0: std::fmt::FormattingOptions).0: u32);
75-
_22 = BitAnd(move _23, const core::fmt::flags::PRECISION_FLAG);
76-
StorageDead(_23);
77-
switchInt(move _22) -> [0: bb10, otherwise: bb11];
75+
StorageLive(_24);
76+
_24 = copy (((*_1).0: std::fmt::FormattingOptions).0: u32);
77+
_23 = BitAnd(move _24, const core::fmt::flags::PRECISION_FLAG);
78+
StorageDead(_24);
79+
_22 = Eq(move _23, const 0_u32);
80+
switchInt(move _22) -> [0: bb10, otherwise: bb9];
7881
}
7982

8083
bb4: {
@@ -142,26 +145,27 @@
142145
}
143146

144147
bb9: {
145-
_7 = discriminant(_6);
146-
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb12];
148+
StorageDead(_23);
149+
_6 = const Option::<usize>::None;
150+
goto -> bb11;
147151
}
148152

149153
bb10: {
150-
StorageDead(_22);
151-
_6 = const Option::<usize>::None;
152-
goto -> bb9;
154+
StorageDead(_23);
155+
StorageLive(_25);
156+
StorageLive(_26);
157+
_26 = copy (((*_1).0: std::fmt::FormattingOptions).2: u16);
158+
_25 = move _26 as usize (IntToInt);
159+
StorageDead(_26);
160+
_6 = Option::<usize>::Some(move _25);
161+
StorageDead(_25);
162+
goto -> bb11;
153163
}
154164

155165
bb11: {
156166
StorageDead(_22);
157-
StorageLive(_24);
158-
StorageLive(_25);
159-
_25 = copy (((*_1).0: std::fmt::FormattingOptions).2: u16);
160-
_24 = move _25 as usize (IntToInt);
161-
StorageDead(_25);
162-
_6 = Option::<usize>::Some(move _24);
163-
StorageDead(_24);
164-
goto -> bb9;
167+
_7 = discriminant(_6);
168+
switchInt(move _7) -> [1: bb4, 0: bb6, otherwise: bb12];
165169
}
166170

167171
bb12: {

0 commit comments

Comments
 (0)