Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,826
    • Issues 4,826
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 449
    • Merge requests 449
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #20325

Closed
Open
Created Sep 01, 2021 by Andreas Klebinger@AndreasKDeveloper

Applying WW should be based on a cost model.

While it's hard to say exactly when WW makes things worse we have a rough id.

Generating calls with a lot of arguments is bad. Unboxing variables is good.

So we could perhaps apply a heuristic of where we have:

let cost = (num_args ^ taper_factor) * arg_factor -- We want to avoid "infinite" reboxing so increase cost of each additional argument.
    discount = (removed_boxes * boxfactor) + removed_args * dead_arg_factor
    benefit = discount - cost

And then unbox if the benefit crosses a certain threshold. We already thread through a boolean that says unbox yes/no. We would just replace it with slightly more complex monoid.

That being said without a good idea if what the cost factors should maybe we off just as good with the current threshold-based approach.

Edited Sep 01, 2021 by Andreas Klebinger
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking