Mikolaj Konarski pushed to branch wip/T28016-inline-boring-work-free at Glasgow Haskell Compiler / GHC
Commits:
-
06d164e6
by Mikolaj Konarski at 2026-10-26T22:11:40+01:00
1 changed file:
Changes:
| ... | ... | @@ -308,8 +308,11 @@ tryUnfolding env logger id lone_variable arg_infos |
| 308 | 308 | UnfNever -> traceInline logger opts id str (text "UnfNever") Nothing
|
| 309 | 309 | |
| 310 | 310 | UnfWhen { ug_arity = uf_arity, ug_unsat_ok = unsat_ok, ug_boring_ok = boring_ok }
|
| 311 | - | enough_args && (boring_ok || some_benefit || unfoldingVeryAggressive opts)
|
|
| 311 | + | enough_args && ((boring_ok && (uf_arity > 0 || is_wf))
|
|
| 312 | + || some_benefit || unfoldingVeryAggressive opts)
|
|
| 312 | 313 | -- See Note [INLINE for small functions] (3)
|
| 314 | + -- EXPERIMENT (#28016): a binding with no arguments is
|
|
| 315 | + -- inlined in a boring context only if that duplicates no work.
|
|
| 313 | 316 | -> traceInline logger opts id str (mk_doc some_benefit empty True) (Just unf_template)
|
| 314 | 317 | | otherwise
|
| 315 | 318 | -> traceInline logger opts id str (mk_doc some_benefit empty False) Nothing
|