Skip to content

Commit d14d202

Browse files
committed
Auto merge of #142879 - Mark-Simulacrum:opt-cleanup, r=WaffleLapkin
Remove dead instructions in terminate blocks Terminate blocks look pretty in the IR I've looked at, so no actual perf delta from this. But it seems reasonable to note produce unused IR.
2 parents 8cf5fad + a46ef2d commit d14d202

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

compiler/rustc_codegen_gcc/src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,9 +1591,9 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
15911591
(value1, value2)
15921592
}
15931593

1594-
fn filter_landing_pad(&mut self, pers_fn: RValue<'gcc>) -> (RValue<'gcc>, RValue<'gcc>) {
1594+
fn filter_landing_pad(&mut self, pers_fn: RValue<'gcc>) {
15951595
// TODO(antoyo): generate the correct landing pad
1596-
self.cleanup_landing_pad(pers_fn)
1596+
self.cleanup_landing_pad(pers_fn);
15971597
}
15981598

15991599
#[cfg(feature = "master")]

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,11 +1166,10 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
11661166
(self.extract_value(landing_pad, 0), self.extract_value(landing_pad, 1))
11671167
}
11681168

1169-
fn filter_landing_pad(&mut self, pers_fn: &'ll Value) -> (&'ll Value, &'ll Value) {
1169+
fn filter_landing_pad(&mut self, pers_fn: &'ll Value) {
11701170
let ty = self.type_struct(&[self.type_ptr(), self.type_i32()], false);
11711171
let landing_pad = self.landing_pad(ty, pers_fn, 1);
11721172
self.add_clause(landing_pad, self.const_array(self.type_ptr(), &[]));
1173-
(self.extract_value(landing_pad, 0), self.extract_value(landing_pad, 1))
11741173
}
11751174

11761175
fn resume(&mut self, exn0: &'ll Value, exn1: &'ll Value) {

compiler/rustc_codegen_ssa/src/traits/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ pub trait BuilderMethods<'a, 'tcx>:
516516

517517
// These are used by everyone except msvc
518518
fn cleanup_landing_pad(&mut self, pers_fn: Self::Function) -> (Self::Value, Self::Value);
519-
fn filter_landing_pad(&mut self, pers_fn: Self::Function) -> (Self::Value, Self::Value);
519+
fn filter_landing_pad(&mut self, pers_fn: Self::Function);
520520
fn resume(&mut self, exn0: Self::Value, exn1: Self::Value);
521521

522522
// These are used only by msvc

0 commit comments

Comments
 (0)