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,321
    • Issues 4,321
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • 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
  • Merge Requests
  • !4833

Closed
Opened Jan 15, 2021 by Sebastian Graf@sgraf812Developer
  • Report abuse
Report abuse

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b "wip/T19224" "origin/wip/T19224"

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "master"
git merge --no-ff "wip/T19224"

Step 4. Push the result of the merge to GitLab

git push origin "master"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

CoreToStg.Prep: Speculative evaluation

  • Overview 24
  • Commits 1
  • Pipelines 2
  • Changes 1

From Note [Speculative evaluation]:

Since call-by-value is much cheaper than call-by-need, we case-bind arguments that are either

  1. Strictly evaluated anyway, according to the StrictSig of the callee, or
  2. ok-for-spec, according to 'exprOkForSpeculation'

While (1) is a no-brainer and always beneficial, (2) is a bit more subtle, as the careful haddock for 'exprOkForSpeculation' points out. Still, by case-binding the argument we don't need to allocate a thunk for it, whose closure must be retained as long as the callee might evaluate it. And if it is evaluated on most code paths anyway, we get to turn the unknown eval in the callee into a known call at the call site.

NoFib Results:

--------------------------------------------------------------------------------
        Program         Allocs    Instrs
--------------------------------------------------------------------------------
           ansi          -9.4%    -10.4%
       maillist          -0.1%     -0.1%
      paraffins          -0.7%     -0.5%
            scc          -0.0%     +0.1%
       treejoin          -0.0%     -0.1%
--------------------------------------------------------------------------------
            Min          -9.4%    -10.4%
            Max           0.0%     +0.1%
 Geometric Mean          -0.1%     -0.1%

And binary sizes go down by 0.2%. TODO: Investigate what's happening in ansi.

Fixes #19224 (closed).

Edited Jan 15, 2021 by Sebastian Graf
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
Reference: ghc/ghc!4833
Source branch: wip/T19224