There was an error fetching the commit references. Please try again later.
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
Showing
- libraries/base/GHC/Arr.hs 37 additions, 3 deletionslibraries/base/GHC/Arr.hs
- testsuite/tests/simplCore/should_run/AmapCoerce.hs 25 additions, 0 deletionstestsuite/tests/simplCore/should_run/AmapCoerce.hs
- testsuite/tests/simplCore/should_run/AmapCoerce.stdout 3 additions, 0 deletionstestsuite/tests/simplCore/should_run/AmapCoerce.stdout
- testsuite/tests/simplCore/should_run/all.T 1 addition, 0 deletionstestsuite/tests/simplCore/should_run/all.T
Please register or sign in to comment