We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 255ca18 commit 3816c15Copy full SHA for 3816c15
compiler/rustc_mir_transform/src/ssa.rs
@@ -78,14 +78,10 @@ impl SsaLocals {
78
visitor.assignments[local] = Set1::One(LocationExtended::Arg);
79
}
80
81
- if body.basic_blocks.len() > 2 {
82
- for (bb, data) in traversal::reverse_postorder(body) {
83
- visitor.visit_basic_block_data(bb, data);
84
- }
85
- } else {
86
- for (bb, data) in body.basic_blocks.iter_enumerated() {
87
88
+ // For SSA assignments, a RPO visit will see the assignment before it sees any use.
+ // We only visit reachable nodes: computing `dominates` on an unreachable node ICEs.
+ for (bb, data) in traversal::reverse_postorder(body) {
+ visitor.visit_basic_block_data(bb, data);
89
90
91
for var_debug_info in &body.var_debug_info {
0 commit comments