From: simonpj@microsoft.com Date: Thu, 6 Mar 2008 12:00:04 +0000 (+0000) Subject: Improve SpecConstr for local bindings: seed specialisation from the calls X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e5adcaf845207c73da65cb44cff4ef83b76dd4a9;hp=e5adcaf845207c73da65cb44cff4ef83b76dd4a9;p=ghc-hetmet.git Improve SpecConstr for local bindings: seed specialisation from the calls This patch makes a significant improvement to SpecConstr, based on Roman's experience with using it for stream fusion. The main change is this: * For local (not-top-level) declarations, seed the specialisation loop from the calls in the body of the 'let'. See Note [Local recursive groups] for discussion and example. Top-level declarations are treated just as before. Other changes in this patch: * New flag -fspec-constr-count=N sets the maximum number of specialisations for any single function to N. -fno-spec-constr-count removes the limit. * Refactoring in specLoop and friends; new algebraic data types OneSpec and SpecInfo instead of the tuples that were there before * Be less keen to specialise on variables that are simply in scope. Example f p q = letrec g a y = ...g.... in g q p We probably do not want to specialise 'g' for calls with exactly the arguments 'q' and 'p', since we know nothing about them. ---