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,869
    • Issues 4,869
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 453
    • Merge requests 453
  • 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
  • #20056
Closed
Open
Created Jun 28, 2021 by Matthew Pickering@mpickeringDeveloper

-fignore-interface-pragmas doesn't work well with --make

Interfaces files are currently only read once but how they are read depends on -fignore-interface-pragmas. If the flag is turned on then the files are read without pragma information (unfolding info, rules, demand info and so on). This causes problems with --make, if a later module is compiled with optimisation and requires the same interface file because it has already been loaded and stripped -- during optimization imported identifiers will not have pragma info and so optimisation decisions will be different.

There are quite a few tickets reporting this, this ticket tracks progress to fixing them all: #13002, #12847 (closed), #9370, #8635, #20021

Proposed Solution

The proposed solution is to always read pragma information from an interface file and then decide at the use site whether to make use of it or not.

There are the currently serialised pragmas:

data IfaceInfoItem
  = HsArity         Arity
  | HsDmdSig        DmdSig
  | HsCprSig        CprSig
  | HsInline        InlinePragma
  | HsUnfold        Bool             -- True <=> isStrongLoopBreaker is true
                    IfaceUnfolding   -- See Note [Expose recursive functions]
  | HsNoCafRefs
  | HsLevity                         -- Present <=> never representation-polymorphic
  | HsLFInfo        IfaceLFInf

The other place the flag takes effect is when deserialising IfaceRules.

The current iteration of this/per proposed approach is at !6080. We always read all info from an interface file but then only guard the use sites of HsUnfold and RULES pragmas. This prevents cross-module inlining and cross-module rule firings. Reading the other pragmas seems to have a generally positive effect on compile-time.

Edited Jun 28, 2021 by Matthew Pickering
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking