Skip to content

Commit ae3a7db

Browse files
committed
Removes SimplifyComparisonIntegral pass
1 parent bf87e33 commit ae3a7db

39 files changed

Lines changed: 497 additions & 1683 deletions

File tree

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ declare_passes! {
193193
AfterConstProp,
194194
Final
195195
};
196-
mod simplify_comparison_integral : SimplifyComparisonIntegral;
197196
mod single_use_consts : SingleUseConsts;
198197
mod sroa : ScalarReplacementOfAggregates;
199198
mod strip_debuginfo : StripDebugInfo;
@@ -749,7 +748,6 @@ pub(crate) fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'
749748
&o1(simplify_branches::SimplifyConstCondition::AfterConstProp),
750749
&jump_threading::JumpThreading,
751750
&early_otherwise_branch::EarlyOtherwiseBranch,
752-
&simplify_comparison_integral::SimplifyComparisonIntegral,
753751
&o1(simplify_branches::SimplifyConstCondition::Final),
754752
&o1(remove_noop_landing_pads::RemoveNoopLandingPads),
755753
&o1(simplify::SimplifyCfg::Final),

compiler/rustc_mir_transform/src/simplify_comparison_integral.rs

Lines changed: 0 additions & 256 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(copy _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)