Static data and RULES

Ben Gamari ben at well-typed.com
Fri Feb 17 03:34:51 UTC 2017


David Feuer <david at well-typed.com> writes:

> On Friday, February 17, 2017 12:33:12 AM EST Simon Peyton Jones via ghc-devs 
> wrote:
>> The "L" rule becomes problematic when we try to identify static data the
>> simplifier shouldn't have to try to optimize. If it identifies LCon 0 as
>> static, the "L" rule will never fire.
>  
>> Why doesn’t it fire?
>> 
>> I’m afraid I still do not understand what change is proposed, so I’m finding
>> it difficult to see how to fix problems with it.
>
> I'm sorry; I wasn't trying to be obtuse; easy to drop context by mistake. The 
> idea, at least roughly, is to have a "static" flag on each term. A term is 
> considered static if it's
>
> 1. A Core literal,
> 2. A nullary constructor, or
> 3. A constructor whose arguments are all static.
>
> Once a term is flagged static, the simplifier simply shouldn't try to optimize 
> it--doing so is simply a waste of time.
>
For the record, David is referring to the proposal I briefly describe in
ticket #13282. I started on a patch implementing this idea earlier this
week, but eventually encountered enough tricky cases that I decided to
put it aside for now to focus on the 8.2 release. Moreover, I have a
sneaking suspicion Simon might be working along some similar threads.

Cheers,

- Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170216/22153466/attachment.sig>


More information about the ghc-devs mailing list