simonpj     2005/01/31 05:25:50 PST

  Modified files:
    ghc/compiler/coreSyn CoreLint.lhs CorePrep.lhs CoreTidy.lhs 
    ghc/compiler/prelude primops.txt.pp 
    ghc/compiler/simplCore SimplEnv.lhs Simplify.lhs 
    ghc/compiler/types   Unify.lhs 
  Log:
        ---------------------------
        Types and evaluated-ness in
          CoreTidy and CorePrep
        ---------------------------
  
  This commmit fixes two problems.
  
  1.  DataToTagOp requires its argument to be evaluated, otherwise it silently
      gives the wrong answer.  This was not happening because we had
        case (tag2Enum x) of y -> ...(dataToTag y)...
      and the tag2Enum was being inlined (it's non-speculative), giving
        ...(dataToTag (tag2Enum x))...
  
      Rather than relying on a somewhat-delicate global invariant, CorePrep
      now establishes the invariant that DataToTagOp's argument is evaluated.
      It does so by putting up-to-date is-evaluated information into each
      binder's UnfoldingInfo; not a full unfolding, just the (OtherCon [])
      for evaluated binders.
  
      Then there's a special case for DataToTag where applications are dealt 
with.
  
      Finally, we make DataToTagOp strict, which it really is.
  
  2.  CoreTidy now does GADT refinement as it goes. This is important to ensure 
that
      each variable occurrence has informative type information, which in turn 
is
      essential to make exprType work (otherwise it can simply crash).
      [This happened in test gadt/tdpe]
  
      CorePrep has the same problem, but the solution is a little different:
      when looking up in the cloning environment, use the type at the occurrence
      site if we're inside a GADT.  It might be cleaner to use the same story as
      CoreTidy, but then we'd need to keep an in-scope set for type variables.
      No big deal either way.
  
  Revision  Changes    Path
  1.86      +4 -6      fptools/ghc/compiler/coreSyn/CoreLint.lhs
  1.37      +117 -48   fptools/ghc/compiler/coreSyn/CorePrep.lhs
  1.81      +40 -5     fptools/ghc/compiler/coreSyn/CoreTidy.lhs
  1.32      +4 -1      fptools/ghc/compiler/prelude/primops.txt.pp
  1.42      +4 -6      fptools/ghc/compiler/simplCore/SimplEnv.lhs
  1.157     +8 -11     fptools/ghc/compiler/simplCore/Simplify.lhs
  1.22      +28 -14    fptools/ghc/compiler/types/Unify.lhs
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to