Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.6k
    • Issues 5.6k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 646
    • Merge requests 646
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4299

a less forceful INLINE pragma

The INLINE pragmas currently does two things:

  1. it saves an unoptimised definition of the function in the interface file, and
  2. it unfolds the definition at (almost) every call site, before optimising it further in situ.

I'm proposing that we have a variant of the INLINE pragma that does (1) without necessarily unfolding the definition at every call site. GHC's simplifier already has some well-tuned heuristics for deciding whether to inline something or not based on information about the context, and when we use INLINE we bypass all this and potentially end up with unnecessary code bloat and maybe even a loss of performance in some cases.

If we had an INLINEABLE pragma that did (1) without forcing (2), then the decision about whether to inline or not is deferred to the call site, where the user can decide how they want to trade off code size against speed. Right now the user doesn't get to decide - the library writer does.

Trac metadata
Trac field Value
Version 6.12.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking