]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #88968 - tmiasko:start-block-no-predecessors, r=davidtwco
authorbors <bors@rust-lang.org>
Sun, 19 Sep 2021 01:38:17 +0000 (01:38 +0000)
committerbors <bors@rust-lang.org>
Sun, 19 Sep 2021 01:38:17 +0000 (01:38 +0000)
Start block is not allowed to have basic block predecessors

* The MIR validator is extended to detect potential violations.
* The start block has no predecessors after building MIR, so no changes are required there.
* The SimplifyCfg could previously violate this requirement when collapsing goto chains, so transformation is disabled for the start block, which also substantially simplifies the implementation.
* The LLVM function entry block also must not have basic block predecessors. Previously, to ensure that code generation had to perform necessary adjustments. This now became unnecessary.

The motivation behind the change is to align with analogous requirement in LLVM, and to avoid potential latent bugs like the one reported in #88043.


Trivial merge