simonpj at microsoft.com
Fri Dec 14 05:52:42 EST 2007
| I mean I we don't *get* constant folding until P0. That's might be a bit
| too late as we might miss subsequent optimisations in earlier phases.
That's odd. The constant-folding rules defined in PrelRules.primOpRules are always on (they have no "only in this phase" control) so I don't see why they would not fire in earlier phases.
Since divInt# is not a primop, any rules for it should show up in PrelRules.builtInRules.
| Hmm... Can built-in and user-defined rules for the same function
| coexist? If so, this would probably work (with a bit more effort than if
| divInt# was a primop, though).
I don't think it's more effort. And yes, they can co-exist I think.
More information about the Cvs-ghc