[GHC] #15821: Implement constant folding for Naturals

#15821: Implement constant folding for Naturals -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.6.1 Keywords: newcomer | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- #14465 has already gone a long way in improving the runtime performance of `Natural` numbers. However, we still lack constant folding for these numbers so there is money left on the table. To fix this you will want to implement rules similar to those for `Integer` in the `PrelRules` module. Additionally, you will need to comment back in the `CONSTANT_FOLDED` pragmas in `GHC.Natural` (see Phab:D5267) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15821 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15821: Implement more constant folding for Naturals -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15821#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15821: Implement more constant folding for Naturals -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Additionally, working out why we fail to reduce the case in [T14465](https://phabricator.haskell.org/D5267#inline-41421) would be great. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15821#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15821: Implement more constant folding for Naturals -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hsyl20): I'm currently resurrecting my work-in-progress on this topic. It's taking some time because I would like to make it generic enough that it would be easy to add new rules for Int8#, Int16# and the like when they will be merged in. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15821#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15821: Implement more constant folding for Naturals -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.6.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by martijnbastiaan): leonschool(@github) and I have been working on this when we discovered the missing foldings caused issues with the project we're working on. We've got a first implementation up: https://github.com/leonschoorl/ghc/commit/114981b040c8731702466246a0f7f6afb7... (don't mind the trace calls, WIP!). @hsyl20, maybe we could work together? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15821#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC