1. 25 Jun, 2001 4 commits
    • simonpj's avatar
      [project @ 2001-06-25 08:08:32 by simonpj] · 3622a7de
      simonpj authored
      ---------------------------
      	Add a new case optimisation
      	---------------------------
      
      I found that lib/std/PrelCError had a case-expression that was
      generating terrible code.   Something like this
      
      	x | p `is` 1 -> e1
      	  | p `is` 2 -> e2
      	...etc...
      
      where @is@ was something like
      
      	p `is` n = p /= (-1) && p == n
      
      This gave rise to a horrible sequence of cases
      
      	case p of
      	  (-1) -> $j p
      	  1    -> e1
      	  DEFAULT -> $j p
      
      and similarly in cascade for all the join points!
      
      
      Solution: add the following transformation:
      
      	case e of		=====>     case e of
      	  C _ -> <expr>			     D v -> ....v....
      	  D v -> ....v....		     DEFAULT -> <expr>
      	  DEFAULT -> <expr>
      
      The point is that we merge common RHSs, at least for the DEFAULT case.
      [One could do something more elaborate but I've never seen it needed.]
      
      This transformation is implemented in SimplUtils.mkCase
      
      
      *** WARNING ***
      	To make this transformation easy, I have switched the convention
      	for DEFAULT clauses.  They must now occur FIRST in the list of
      	alternatives for a Core case expression.  (The semantics is
      	unchanged: they still are a catch-all case.)
      
      	The reason is that DEFAULT clauses sometimes need special treatment,
      	and it's a lot easier to find them at the front.
      
      	The easiest way to be insensitive to this change is to use
      	CoreUtils.findDefault to pull the default clause out.
      
      I've made the (surprisingly few) changes consequent on this changed
      of convention, but they aren't in this commit.  Instead they are part
      of the big commit on newtypes I'm doing at the same time.
      3622a7de
    • simonpj's avatar
      [project @ 2001-06-25 08:01:16 by simonpj] · a12bed53
      simonpj authored
      ----------------------------------
      	Fix a predicate-simplification bug
      	----------------------------------
      
      Fixes a bug pointed out by Marcin
      
          data R = R {f :: Int}
          foo:: (?x :: Int) => R -> R
          foo r = r {f = ?x}
      
          Test.hs:4:
      	Could not deduce `?x :: Int' from the context ()
      	arising from use of implicit parameter `?x' at Test.hs:4
      	In the record update: r {f = ?x}
      	In the definition of `foo': r {f = ?x}
      
      The predicate simplifier was declining to 'inherit' an
      implicit parameter.  This is right for a let-binding, but
      wrong for an expression binding.  For example, a simple
      expression type signature:
      
      		(?x + 1) :: Int
      
      This was rejected because the ?x constraint could not be
      floated out -- but that's wrong for expressions.
      a12bed53
    • sof's avatar
      [project @ 2001-06-25 05:25:31 by sof] · ef934bae
      sof authored
      One RCS  will do
      ef934bae
    • sof's avatar
      [project @ 2001-06-25 01:35:07 by sof] · 2917a645
      sof authored
      With -no-hs-main, don't force PrelMain.o to be linked (=> Main.o)
      2917a645
  2. 23 Jun, 2001 2 commits
  3. 22 Jun, 2001 8 commits
  4. 18 Jun, 2001 4 commits
  5. 15 Jun, 2001 8 commits
  6. 14 Jun, 2001 7 commits
    • rrt's avatar
      [project @ 2001-06-14 16:41:46 by rrt] · 82db18e4
      rrt authored
      Add getExecDir to return current directory of executable on Windows (to find
      config information).
      82db18e4
    • simonpj's avatar
      [project @ 2001-06-14 15:42:35 by simonpj] · 54f9adfa
      simonpj authored
      Windows wibbles
      54f9adfa
    • simonmar's avatar
      [project @ 2001-06-14 14:14:53 by simonmar] · 6e694be0
      simonmar authored
      - CURRENT_DIR isn't used any more
      - TmpFiles doesn't exist
      6e694be0
    • simonmar's avatar
      [project @ 2001-06-14 13:29:30 by simonmar] · e50a36b1
      simonmar authored
      fix typo in Simon's commit (cGHC_RAWCPP ==> GHC_RAWCPP)
      e50a36b1
    • simonpj's avatar
      [project @ 2001-06-14 12:50:05 by simonpj] · 16d5d1c7
      simonpj authored
      ----------------------
      	Installation packaging
      	----------------------
      
      GHC runs various system programs like
      	cp, touch
      	gcc, as, ld etc
      
      On Windows we plan to deliver these programs along with GHC,
      so we have to be careful about where to find them.
      
      This commit isolates all these dependencies in a single module
      
      	main/SysTools.lhs
      
      Most of the #ifdefery for mingw has moved into this module.
      There's some documentation in SysTools.lhs
      
      Along the way I did lots of other cleanups.  In particular
      
        * There is no more 'globbing' needed when calling runSomething
        * All file removal goes via the standard Directory.removeFile
        * TmpFiles.hs has gone; absorbed into SysTools
        * Some DynFlag stuff has moved from DriverFlags to CmdLineOpts
      
      
      Still to do:
      
        **	I'm a bit concerned that calling removeFile one at a time
      	when deleting masses of split-object files is going to be
      	rather slow
      
        **	GHC now expects to find split,mangle,unlit in
      		libdir/extra-bin
      	instead of just
      		libdir
      
      	So something needs to change in the Unix installation scripts
      
        **    The "ineffective C preprocessor" is a perversion and should die
      16d5d1c7
    • simonmar's avatar
      [project @ 2001-06-14 11:46:55 by simonmar] · 8245241e
      simonmar authored
      just move some code around.
      8245241e
    • simonmar's avatar
      [project @ 2001-06-14 09:47:37 by simonmar] · a30fbb32
      simonmar authored
      comment fixes
      a30fbb32
  7. 13 Jun, 2001 7 commits