Skip to content
GitLab
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 5,400
    • Issues 5,400
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 588
    • Merge requests 588
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4299
Closed
Open
Issue created Sep 09, 2010 by Simon Marlow@simonmarDeveloper

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