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 (closed) 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 (closed).