[GHC] #9796: Implement amap/coerce rule for `Array`
#9796: Implement amap/coerce rule for `Array` -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: new Priority: normal | Milestone: 7.10.1 Component: Core Libraries | Version: 7.9 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 | Type of failure: Runtime hour) | performance bug Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- We have `map/coerce`; there's no reason not to have `amap/coerce` as well. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9796> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9796: Implement amap/coerce rule for `Array` -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Runtime | Blocked By: performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D471 | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => patch * differential: => Phab:D471 Comment: Doing this required me to delay inlining `amap` until phase 1, which required me to rewrite it to avoid relying on list fusion. This has a nice side benefit: the compiled code ends up smaller because it avoids a redundant test relating to `enumFromTo` and redundant array freezing code that went with it. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9796#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9796: Implement amap/coerce rule for `Array` -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: patch Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Runtime | Blocked By: performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D471 | -------------------------------------+------------------------------------- Comment (by Herbert Valerio Riedel <hvr@…>): In [changeset:"603b7be7bd3abaf0e2c210e8d9015b1d613b4715/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="603b7be7bd3abaf0e2c210e8d9015b1d613b4715" Implement amap/coerce for Array (re #9796) Implement an `amap`/`coerce` rule in `GHC.Arr` to match the `map`/`coerce` rule in GHC.Base. In order to do so, delay inlining `amap` until phase 1. To prevent the inlining delay from causing major inefficiencies due to missed list fusion, rewrite `amap` to avoid relying on list fusion. This has the extra benefit of reducing the size of the compiled amap code by skipping the impossible case of an array with a negative size. Reviewed By: nomeata Differential Revision: https://phabricator.haskell.org/D471 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9796#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9796: Implement amap/coerce rule for `Array` -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: closed Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Runtime | Blocked By: performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: Phab:D471 | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9796#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9796: Implement amap/coerce rule for `Array` -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: task | Status: closed Priority: normal | Milestone: 7.10.1 Component: Core | Version: 7.9 Libraries | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Runtime | Blocked By: performance bug | Related Tickets: #8767 Test Case: | Blocking: | Differential Revisions: Phab:D471 | -------------------------------------+------------------------------------- Changes (by thomie): * related: => #8767 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9796#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC