Skip to content

Commit 54082dd

Browse files
committed
Merge basic blocks where possible when generating LLVM IR.
In `codegen_assert_terminator` we decide if a BB's successor is a candidate for merging, which requires that it be the only successor, and that it only have one predecessor. That result then gets passed down, and if it reaches `funclet_br` with the appropriate BB characteristics, then no `br` instruction is issued, a `MergingSucc::True` result is passed back, and the merging proceeds in `codegen_block`. The commit also adds `CachedLlbb`, a new type to help keep track of each BB that has been merged into its predecessor.
1 parent 68194aa commit 54082dd

File tree

4 files changed

+261
-144
lines changed

4 files changed

+261
-144
lines changed

compiler/rustc_codegen_ssa/src/lib.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2-
#![feature(box_patterns)]
3-
#![feature(try_blocks)]
4-
#![feature(once_cell)]
52
#![feature(associated_type_bounds)]
6-
#![feature(strict_provenance)]
7-
#![feature(int_roundings)]
3+
#![feature(box_patterns)]
84
#![feature(if_let_guard)]
5+
#![feature(int_roundings)]
6+
#![feature(let_chains)]
97
#![feature(never_type)]
8+
#![feature(once_cell)]
9+
#![feature(strict_provenance)]
10+
#![feature(try_blocks)]
1011
#![recursion_limit = "256"]
1112
#![allow(rustc::potential_query_instability)]
1213

0 commit comments

Comments
 (0)