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,247
    • Issues 4,247
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 393
    • Merge Requests 393
  • 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
  • #11233

Closed
Open
Opened Dec 15, 2015 by Matthew Pickering@mpickeringDeveloper

Improve optimisation of pattern synonym matching

Currently GHC does a very poor job of optimising pattern matches which include pattern synonyms.

It would be good to modify sameGroup in compiler/deSugar/Match.hs to be a lot smarter about when it is safe to group two pattern matches together.

Grouping was originally disabled as it is a bit trickier than originally thought. See #11224 (closed) for details.

The rule was originally to group two pattern matches together PgSyn p1 and PgSyn p2 when p1 == p2. This rule wasn't safe when p1 had a polymorphic return type and thus could have a different type on each branch even though syntactically identical. A good solution to this ticket would come up with a smarter rule about when it is and isn't safe to group two together in the same spirit as the more complicated rules for view patterns.

Trac metadata
Trac field Value
Version 7.10.3
Type Task
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#11233