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,241
    • Issues 5,241
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 563
    • Merge requests 563
  • 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
  • Merge requests
  • !1829

`exprOkForSpeculation` for Note [IO hack in the demand analyser]

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Sebastian Graf requested to merge wip/T14998 into master Sep 27, 2019
  • Overview 7
  • Commits 1
  • Pipelines 1
  • Changes 1

In #14998 (closed) I realised that the notion of speculative execution exactly matches eager evaluation of expressions in a case alternative where the scrutinee is an IO action.

Normally we have to deferIO any result from that single case alternative to prevent this speculative execution, so we had a special case in place in the demand analyser that would check if the scrutinee was a prim-op, in which case we assumed that it would be ok to do the eager evaluation.

Now we just check if the scrutinee is exprOkForSpeculation, corresponding to the notion that we want to push evaluation of the scrutinee after eagerly evaluating stuff from the case alternative.

This fixes #14998 (closed), because it resolves the last open Item 4 there.

Edited Sep 28, 2019 by Sebastian Graf
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/T14998