1
Fork 0

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`
This commit is contained in:
Matthias Krüger 2024-03-26 17:06:39 +01:00 committed by GitHub
commit d549d4f5a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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