Change CONSTANT_FOLDED from NOINLINE to INLINE[0]
It's a shame that we mark Integer ops from GHC.Num.Integer as NOINLINE to allow constant-folding in GHC.Core.Opt.ConstantFold. They should be marked INLINE[0] instead:
- To delay their inlining long enough for the constant-folding rules defined in
GHC.Core.Opt.ConstantFoldto fire - To inline them late, so that the boxes they allocate are often fused away.
Here is a history of motivation:
- It leads to regressions in Nested CPR !1866 (closed): !1866 (comment 267523)
-
decodeDoubleIntegerwill allocate a box if not constant folded #18092 (closed)
Edited by Sylvain Henry