[GHC] #13044: make it possible to apply GHC rewrite rules to class methods
GHC
ghc-devs at haskell.org
Wed Jan 4 10:51:29 UTC 2017
#13044: make it possible to apply GHC rewrite rules to class methods
-------------------------------------+-------------------------------------
Reporter: George | Owner:
Type: task | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
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 nomeata):
Currently, rewrite rules, as well as unfolding (i.e. inlining) are active
in certain phases, which are currently counted down from, I belive, 3 to
0. Exending this system of phases to something more expressive has always
been a thought. Maybe it would help here?
The smallest delta that might help is simply adding a a number of extra
phases, say, from 7 to 4. The compiler would annotate all type class
dictionary access functions (i.e. class methods) with `INLINE [~4]`, which
would prevent them from being rewritten to the actual implementation. Then
rewrite rules active in phases 7, 6 and 5 would have a pretty good chance
of applying to class methods.
Would this work?
Obviously, one might want nicer ways of specifying phases (i.e. fixed
names, or even arbitrary news with ordering constraints), but that is a
slightly orthogonal discussion.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13044#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list