Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,253
    • Issues 4,253
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 394
    • Merge Requests 394
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4960

Closed
Open
Opened Feb 15, 2011 by Simon Peyton Jones@simonpjDeveloper

Better inlining test in CoreUnfold

Consider this

f x = let 
        $j y = case x of { True -> e1; False -> e2 }
      in
      case x of 
        True -> ...$j y1...
        False -> ...$j y2...

If a function that scrutinises its argument is applied to a constructor, it becomes much keener to inline. But in this example the function scrutinises a free variable that is evaluated to a known constructor at the call site. At the moment this is ignored, and $j may well not be inlined in situations where it would be jolly good to do so.

This shows up in test perf/should_run/MethSharing where the join points created early only inline because exprIsDupable is just generous enough to do so. If you reduce CoreUtils.dupAppSize by 1, the join point doesn't inline any more. But it should.

The solution is fairly easy: compute discounts on free varaibles as well as arguments. I'm making a ticket because I don't want to execute on this today.

Trac metadata
Trac field Value
Version 7.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#4960