Skip to content
Snippets Groups Projects
Commit df2eca94 authored by Sebastian Graf's avatar Sebastian Graf Committed by Marge Bot
Browse files

CPR analysis: Use CPR of scrutinee for Case Binder CPR (#19232)

For years we have lived in a supposedly sweet spot that gave case
binders the CPR property, unconditionally. Which is an optimistic hack
that is now described in `Historical Note [Optimistic case binder CPR]`.

In #19232 the concern was raised that this might do more harm than good
and that might be better off simply by taking the CPR property of the
scrutinee for the CPR type of the case binder. And indeed that's what we
do now.

Since `Note [CPR in a DataAlt case alternative]` is now only about field
binders, I renamed and garbage collected it into
`Note [Optimistic field binder CPR]`.

NoFib approves:
```
NoFib Results

--------------------------------------------------------------------------------
        Program         Allocs    Instrs
--------------------------------------------------------------------------------
           anna          +0.1%     +0.1%
       nucleic2          -1.2%     -0.6%
          sched           0.0%     +0.9%
      transform          -0.0%     -0.1%
--------------------------------------------------------------------------------
            Min          -1.2%     -0.6%
            Max          +0.1%     +0.9%
 Geometric Mean          -0.0%     +0.0%
```

Fixes #19232.
parent c3ff35bb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment