Re: SpecConstr number of specializations (-fspec-constr-count)

2010-11-29 Thread Simon Marlow

On 25/11/2010 20:01, Roman Leshchinskiy wrote:

On 25/11/2010, at 10:33, José Pedro Magalhães wrote:


Is this a bug, or is the value of spec-constr-count being
manipulated in some way for certain passes?


spec-constr-count decreases for nested specialisations. For instance,
if spec-constr-count is 6 and SpecConstr generates 2 specialisations
for a function foo, then spec-constr-count will be 3 for all
functions nested in foo. You can turn it off completely with
-fno-spec-constr-count.


The messages are a bit counter-intuitive though - I encountered this 
recently too, and was baffled by the fact that the suggested flag, 
-fspec-constr-count, didn't seem to have any effect.


Also, these messages should be clearly labelled as warnings, and there 
should be a way to disable them (I realise they're being generated by 
the SpecConstr pass and we don't normally generate warnings beyond the 
desugarer, but still.)


Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: SpecConstr number of specializations (-fspec-constr-count)

2010-11-25 Thread José Pedro Magalhães
Hi,

2010/11/25 Roman Leshchinskiy 

> On 25/11/2010, at 10:33, José Pedro Magalhães wrote:
>
> > Is this a bug, or is the value of spec-constr-count being manipulated in
> some way for certain passes?
>
> spec-constr-count decreases for nested specialisations. For instance, if
> spec-constr-count is 6 and SpecConstr generates 2 specialisations for a
> function foo, then spec-constr-count will be 3 for all functions nested in
> foo. You can turn it off completely with -fno-spec-constr-count.
>

Ok, thanks!


Pedro


>
> Roman
>
>
>
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: SpecConstr number of specializations (-fspec-constr-count)

2010-11-25 Thread Roman Leshchinskiy
On 25/11/2010, at 10:33, José Pedro Magalhães wrote:

> Is this a bug, or is the value of spec-constr-count being manipulated in some 
> way for certain passes?

spec-constr-count decreases for nested specialisations. For instance, if 
spec-constr-count is 6 and SpecConstr generates 2 specialisations for a 
function foo, then spec-constr-count will be 3 for all functions nested in foo. 
You can turn it off completely with -fno-spec-constr-count.

Roman


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


SpecConstr number of specializations (-fspec-constr-count)

2010-11-25 Thread José Pedro Magalhães
Hi all,

When compiling some program with -O2 using ghc-7.0.1, I got warnings like

> SpecConstr
> Function `$j_s7Xo{v} [lid]'
>   has three call patterns, but the limit is 1
> Use -fspec-constr-count=n to set the bound
> Use -dppr-debug to see specialisations
> SpecConstr
> Function `$j_s7YI{v} [lid]' has 7 call patterns, but the limit is 3
> Use -fspec-constr-count=n to set the bound
> Use -dppr-debug to see specialisations
>

I proceeded to compile with -fspec-constr-count=10, but I still got

> SpecConstr
> Function `$j_s7Xo{v} [lid]' has 7 call patterns, but the limit is 1
> Use -fspec-constr-count=n to set the bound
> Use -dppr-debug to see specialisations
>

With -fspec-constr-count=55, I got

> SpecConstr
> Function `$j_s7Xo{v} [lid]' has 7 call patterns, but the limit is 6
> Use -fspec-constr-count=n to set the bound
> Use -dppr-debug to see specialisations
>

Finally, with -fspec-constr-count=56, the warnings disappear.
Is this a bug, or is the value of spec-constr-count being manipulated in
some way for certain passes?


Thanks,
Pedro
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users