Wed Jul 12 08:32:04 PDT 2006  [EMAIL PROTECTED]
  * Experimental flag -fdicts-cheap
  
  This experimental flag, -fdicts-cheap, makes a let-binding that bind a
  value of dictionary type look cheap.  That in turn leads to more
  eta expansion.  Instead of
        f = /\a. \(d1:Ord a). let d2:Ord [a] = dfOrd a d1 in
                   \(x:a). <stuff>
  which has arity 1, you get
        f = /\a. \(d1:Ord a). \(x:a).
                 let d2:Ord [a] = dfOrd a d1 in <stuff>
  Now f has arity 2.
  
  This can cretainly waste dictionary-construction work, if f is
  partially applied to its dictionary argument.  However it has knock-on
  effects.  Because f has arity 2, we won't float (f Int d) out of
        \x. h (f Int d)
  Floating f out of this lambda makes it impossible for an h/f fusion
  rule to fire; and this unexpected loss of RULE application was the
  immediate reason for implementing this flag. (Roman Leshchinskiy came
  across this when working on array fusion.)
  
  
  I've implemented the change only in CoreUtils.arityType, which
  only affects eta expansion.  I thought of putting the change in
  exprIsCheap, which is a more systematic place (the former calls
  the latter) but
  
        a) I wanted this under flag control, and the flags 
        are not readily available to all callers of exprIsCheap
  
        b) I'm not 100% convinced that this change is a good
        idea, so it's reasonable to do the narrowest change
        that solves the immediate problem.

    M ./compiler/coreSyn/CoreUtils.lhs -26 +50
    M ./compiler/main/DynFlags.hs +2
    M ./compiler/simplCore/SimplUtils.lhs -5 +5
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to