Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • 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,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 457
    • Merge requests 457
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #21457
Closed
Open
Created Apr 29, 2022 by Andreas Klebinger@AndreasKDeveloper

SpecConstr should treat local and top level non-recursive bindings the same.

SpecConstr currently specializes local non recursive let bindings. But doesn't specialize top level non-recursive let bindings.

This means if we change the local binding in a way which allows it to float to the top performance can suddenly tank as we no longer get specialization for it.


This is however not as trivial as it sounds. In order to make this work coherently in the current design we would need to analyze the whole module for call patterns before we generate a specialization.

But we analyze the whole module for call patterns already! So maybe we could get away with:

  • Do what we do now but keep around all call patterns for non-recursive top level bindings.
  • We collected all the call patterns and specialize all the recursive bindings.
  • Then do one pass over the non-recursive bindings generating specializations for their call patterns as well.

Seems plausible at least.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking