1. 07 Mar, 2001 3 commits
  2. 06 Mar, 2001 6 commits
  3. 05 Mar, 2001 12 commits
    • simonpj's avatar
      [project @ 2001-03-05 15:37:25 by simonpj] · c8276ef7
      simonpj authored
      Exploit the 1-shot lambda HACK in etaExpandArity
      We often find code like
      	f :: Int -> IO ()
      	f = \ x -> case ... of
      			p1 -> \s -> ...rhs1...
      			p2 -> \s -> ...rhs2...
      where the \s is a state transformer lambda.  Almost invariably
      these \s things are one-shot; that is, we virtually never say
      	   h = f 3
      	h >> h >> h
      In this case we'd be much better off eta-expanding f, to
      	f :: Int -> IO ()
      	f = \ x \ s -> case ... of
      			   p1 -> ...rhs1...
      			   p2 -> ...rhs2...
      GHC already has a MAJOR HACK in
      which declares that any \s::State# T is a one-shot lambda.  It's
      almost always true, and it makes a big difference.
      This commit simply makes use of isOneShotLambda to improve the
      results of CoreUtils.etaExpandArity.  Which has the desired effect.
      There isn't a flag to control the MAJOR HACK yet.  Maybe there should be.
      Anyway, some of Manuel's array code should improve a lot.
    • simonpj's avatar
      [project @ 2001-03-05 12:46:16 by simonpj] · 757f1ebd
      simonpj authored
      Print debug uniques consistently in base64
    • simonpj's avatar
      [project @ 2001-03-05 12:45:45 by simonpj] · e6dff21d
      simonpj authored
      Improve SpecConstr
      This commit fixes SpecConstr so that it can see the effect of
      enclosing case expressions properly.  That's what the "cons" field
      in ScEnv is for.
      As a result, consider this function:
        data AccessPath = Cont  AccessPath
      		  | Value Int
        demandAll n ap@(Cont (Value (I# i1)))
          = case n of
      	0     -> i1
      	other -> i1 +# demandAll (n-1) ap
      SpecConstr now successfully compiles it to this:
          = \ i1 :: PrelGHC.Int# sc :: PrelGHC.Int# ->
            case sc of ds {
      	0 -> i1;
      	__DEFAULT -> PrelGHC.+# i1 (Foo.$s$wdemandAll i1 (PrelGHC.-# ds 1))
      with the rule
       "SC:$wdemandAll1" __forall i1 :: PrelGHC.Int# ,
      			    sc :: PrelGHC.Int# .
      	Foo.$wdemandAll sc (Foo.$wCont (Foo.$wValue (PrelBase.$wI# i1)))
      	= Foo.$s$wdemandAll i1 sc ;
    • simonpj's avatar
      [project @ 2001-03-05 12:19:37 by simonpj] · b5cad075
      simonpj authored
      Better dump of transformation rules
    • simonpj's avatar
      [project @ 2001-03-05 12:18:43 by simonpj] · ee7e91f5
      simonpj authored
      Remove debug trace
    • simonpj's avatar
      [project @ 2001-03-05 12:18:21 by simonpj] · d14c46d3
      simonpj authored
      Make error message more helpful
    • simonpj's avatar
      [project @ 2001-03-05 12:18:05 by simonpj] · e71eb9f0
      simonpj authored
      Remove dead isSysOcc
    • simonpj's avatar
      [project @ 2001-03-05 10:34:44 by simonpj] · baf7143a
      simonpj authored
      Add a test that Hugs-Feb-2001 fails
    • simonmar's avatar
      [project @ 2001-03-05 10:29:00 by simonmar] · 66331490
      simonmar authored
      remove cruft
    • simonmar's avatar
      [project @ 2001-03-05 10:06:27 by simonmar] · 9c59d745
      simonmar authored
      small rearrangement
    • simonmar's avatar
      [project @ 2001-03-05 10:05:58 by simonmar] · b671b141
      simonmar authored
      fix -fgenerics
    • qrczak's avatar
      [project @ 2001-03-05 00:07:23 by qrczak] · 429854e8
      qrczak authored
      Use custom parser monad instead of Parsec. It remembers the text which
      has been parsed, so it needs not to be reconstructed after parsing.
      Operators containing '--' are now handled correctly. '#' triggers
      special processing only if it's not a part of an operator, i.e. if
      a varsym token is exactly a single '#'.
      Backslash-newline pairs in C lexical world are now handled correctly
      (removed at an early stage).
      Option --keep replaced with --no-compile (stop after writing *.hs_make.c).
  4. 04 Mar, 2001 2 commits
  5. 03 Mar, 2001 1 commit
  6. 02 Mar, 2001 8 commits
    • simonmar's avatar
      [project @ 2001-03-02 17:35:20 by simonmar] · 920d0d7e
      simonmar authored
      Fix :type again, by resurrecting typecheckExpr.  Now the expression
      doesn't get the monomorphism restriction applied to it.
    • simonmar's avatar
      [project @ 2001-03-02 16:15:53 by simonmar] · 435b1086
      simonmar authored
      ASSERT in updateWithIndirection() that we haven't already updated this
      object with an indirection, and fix two places in the RTS where this
      could happen.
      The problem only occurs when we're in a black-hole-style loop, and
      there are multiple update frames on the stack pointing to the same
      object (this is possible because of lazy black-holing).  Both stack
      squeezing and asynchronous exception raising walk down the stack and
      remove update frames, updating their contents with indirections.  If
      we don't protect against multiple updates, the mutable list in the old
      generation may get into a bogus state.
    • simonmar's avatar
      [project @ 2001-03-02 16:12:18 by simonmar] · b126c85f
      simonmar authored
      Add a new closure flag, IND, to identify indirections.
    • simonmar's avatar
      [project @ 2001-03-02 14:36:16 by simonmar] · ffaa2614
      simonmar authored
      Add some ASSERT()s so we can catch updates where updatee==target.
    • simonmar's avatar
      [project @ 2001-03-02 14:28:44 by simonmar] · 18f73b07
      simonmar authored
      Yet another good bug (I'm on a roll today! :-)
      When squeezing update frames, make sure the updatee pointers aren't
      identical before updating one to point to the other.  This is mostly
      harmless, but in one example I have caused the program to go into an
      infinite loop rather than fall down a black hole.
      To be merged into the 4.08 branch.
    • simonmar's avatar
      [project @ 2001-03-02 14:26:40 by simonmar] · 5cd7cb62
      simonmar authored
      Another good bug: the stack check in the AP_UPD entry code was wrong.
      This one is a definite source of crashes.
      To be merged into the 4.08 branch.
    • simonmar's avatar
      [project @ 2001-03-02 14:25:04 by simonmar] · 2efbfc25
      simonmar authored
      A good bug: detectBlackHoles wasn't checking for ThreadRelocated,
      which is why we sometimes get "no threads to run: infinite loop or
      deadlock?" when we should get a NonTermination exception.
      To be merged into the 4.08 branch.
    • simonmar's avatar
      [project @ 2001-03-02 10:52:15 by simonmar] · ac76dbc4
      simonmar authored
      Don't context switch on the timer if the flag +RTS -C0 is given.  This
      gives us reliable/repeatable runs with -C0 (I've been running with a
      similar change for months now, debugging is virtually impossible
      without it).
  7. 01 Mar, 2001 8 commits
    • qrczak's avatar
      [project @ 2001-03-01 21:39:36 by qrczak] · 0c5e53f0
      qrczak authored
      Let ':t \x->x' work by putting a space before the expression.
    • qrczak's avatar
      [project @ 2001-03-01 20:32:51 by qrczak] · 80a9e0ac
      qrczak authored
      #{stuff} is equivalent to #stuff except that it's self-delimited and
      thus needs not to be placed at the end of line or in some brackets.
    • qrczak's avatar
      [project @ 2001-03-01 19:10:16 by qrczak] · 0250da18
      qrczak authored
      Mark fromInt and toInt as deprecated.
    • simonpj's avatar
      [project @ 2001-03-01 17:10:06 by simonpj] · 09518039
      simonpj authored
      Improve IdInfo substitution
      To get rules to work nicely, we need to make rules for recursive functions
      active in the RHS of the very recursive function itself.  This can be
      done nicely: the change is to move the calls to simplIdInfo in Simplify
      to an earlier place.
      The second thing is that when doing simple expression substitution
      in a rule (which we do during simplification for rules attached to an Id)
      we were zapping the occurrence info carefully pinned on the rule binders
      when the rule was put into the Id's rules.  This in turn meant that
      the simplifer ran more iterations than necessary when rules were fired.
      (Andrew Tolmach discovered this.)
      So I tidied up the interface to Subst a little.  The relevant functions
      that have changed are
      	simplBndr, simplBndrs, simplLetId, simplIdInfo,
      	substAndCloneId, substAndCloneIds, substAndCloneRecIds,
      There are consequential changes in other modules, but it compiles
      at least the whole standard libraries happily, and the codegen tests,
      so I'm reasonably confident in it.  But watch out for new strange
    • simonpj's avatar
      [project @ 2001-03-01 17:09:54 by simonpj] · 75e81ca4
      simonpj authored
      Add comments
    • simonpj's avatar
      [project @ 2001-03-01 17:08:31 by simonpj] · 76258fba
      simonpj authored
      Formatting only
    • simonpj's avatar
      [project @ 2001-03-01 17:07:49 by simonpj] · 4d9d0308
      simonpj authored
      Simplify between LiberateCase and SpecConstr
    • simonpj's avatar
      [project @ 2001-03-01 17:06:53 by simonpj] · f4c599d2
      simonpj authored
      Add comment