[Haskell] Expecting more inlining for bit shifting

Simon Peyton-Jones simonpj at microsoft.com
Wed Oct 11 06:23:59 EDT 2006

| Do you think it should be that general?  I was thinking the discount
| should only apply in the situtation where a case expression contains
| expression with one free varaible that is a function argument, and all
| operations are primitive.

Well, if you see
	x >=# 0
then it'd be good to inline if argument x was bound to a literal, even
if the >= is not scrutinised by a case.  Why?  Because then we can
constant-fold it away.  But perhaps the discount should be smaller?

| So, is there a way of deciding if a primitive op will be rewritten if
| its arguements are given?

The constant-folding rules for the primops are all in
in function primOpRules.  Please add more rules.  For example, I see
	x +# 0 = x
is not in there!


More information about the Glasgow-haskell-users mailing list