Skip to content

Commit d549d4f

Browse files
authored
Rollup merge of #122996 - RalfJung:simplify_branches, r=cjgillot
simplify_branches: add comment I am not quite sure why this simplification is done here and not in InstSimplify but 🤷 r? `@cjgillot`
2 parents 03f5c4f + 42526e1 commit d549d4f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_mir_transform/src/simplify_branches.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl<'tcx> MirPass<'tcx> for SimplifyConstCondition {
1919
let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id());
2020
'blocks: for block in body.basic_blocks_mut() {
2121
for stmt in block.statements.iter_mut() {
22+
// Simplify `assume` of a known value: either a NOP or unreachable.
2223
if let StatementKind::Intrinsic(box ref intrinsic) = stmt.kind
2324
&& let NonDivergingIntrinsic::Assume(discr) = intrinsic
2425
&& let Operand::Constant(ref c) = discr

0 commit comments

Comments
 (0)