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,867
    • Issues 4,867
    • 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
  • #16831
Closed
Open
Created Jun 16, 2019 by Andreas Klebinger@AndreasKDeveloper

Always inline code which would result in static indirections.

Motivation

Certain code will always be compiled to a static indirection.

In particular this is true if all a binding does is coercing a value to a different type like b in the example below.

This is bad since we have to follow the indirection at runtime, and can't short it out at compile time.

module B where

import A (a)

newtype Foo = Foo Int

{-# NOINLINE b #-}
b = Foo a

------------------------------

module C where

import B

data C = C !Foo

c = C b

Proposal

GHC in these cases should ignore the NOINLINE pragma and always force b to be inlined.

This would also help with avoiding untagged things ending up in strict fields. See #14677 (closed)

Edited Jun 16, 2019 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