]> git.lizzy.rs Git - rust.git/commit
Auto merge of #94123 - bjorn3:cg_ssa_singleton_builder, r=tmiasko
authorbors <bors@rust-lang.org>
Thu, 24 Feb 2022 12:28:19 +0000 (12:28 +0000)
committerbors <bors@rust-lang.org>
Thu, 24 Feb 2022 12:28:19 +0000 (12:28 +0000)
commit3d127e2040b57157936f5f24e114a8b4c9a505ef
treeeda8d0fab2d62b7abbf0fde7d455c9d2bd979093
parent7ccfe2ff1d59666dc0188dfd5847304fec257565
parent96cf7999ab64ead0c06384da51eb8586ffebfc1e
Auto merge of #94123 - bjorn3:cg_ssa_singleton_builder, r=tmiasko

Partially move cg_ssa towards using a single builder

Not all codegen backends can handle hopping between blocks well. For example Cranelift requires blocks to be terminated before switching to building a new block. Rust-gpu requires a `RefCell` to allow hopping between blocks and cg_gcc currently has a buggy implementation of hopping between blocks. This PR reduces the amount of cases where cg_ssa switches between blocks before they are finished and mostly fixes the block hopping in cg_gcc. (~~only `scalar_to_backend` doesn't handle it correctly yet in cg_gcc~~ fixed that one.)

`@antoyo` please review the cg_gcc changes.
compiler/rustc_codegen_ssa/src/mir/block.rs