ghc-hetmet.git
23 years ago[project @ 2001-03-19 18:23:45 by sewardj]
sewardj [Mon, 19 Mar 2001 18:23:45 +0000 (18:23 +0000)]
[project @ 2001-03-19 18:23:45 by sewardj]
Don't create an installation-time Makefile (target binary-dist).

23 years ago[project @ 2001-03-19 18:15:59 by sewardj]
sewardj [Mon, 19 Mar 2001 18:15:59 +0000 (18:15 +0000)]
[project @ 2001-03-19 18:15:59 by sewardj]
Basic support for the simplified installation story.

23 years ago[project @ 2001-03-19 16:26:09 by simonpj]
simonpj [Mon, 19 Mar 2001 16:26:09 +0000 (16:26 +0000)]
[project @ 2001-03-19 16:26:09 by simonpj]
Comments only

23 years ago[project @ 2001-03-19 16:24:37 by simonpj]
simonpj [Mon, 19 Mar 2001 16:24:37 +0000 (16:24 +0000)]
[project @ 2001-03-19 16:24:37 by simonpj]
---------------------------------------------
Be more eager to inline for an applied coerce
---------------------------------------------

Given this:

(coerce T f) x y

SimplUtils.interestingCallContext was returning False (uninteresting
call context).  This is wrong: it's a very intersting context.

Darn those coerces!  They are scheduled for destruction, but meanwhile,
this makes matters a bit better.

23 years ago[project @ 2001-03-19 16:22:51 by simonpj]
simonpj [Mon, 19 Mar 2001 16:22:51 +0000 (16:22 +0000)]
[project @ 2001-03-19 16:22:51 by simonpj]
-------------------------------------------------------
Be more careful about floating out from  INLINE pragmas
-------------------------------------------------------

Given this:

x = __inline__ (f (g y))

we were floating the (g y) out as a MFE, thus:

lvl = g y
x = __inline__ (f lvl)

This is bad.  The (g y) redex gets outside the __inline__ envelope,
and may never get inlined.

The solution involved a bit of fiddling in SetLevels.

23 years ago[project @ 2001-03-19 16:22:00 by simonmar]
simonmar [Mon, 19 Mar 2001 16:22:01 +0000 (16:22 +0000)]
[project @ 2001-03-19 16:22:00 by simonmar]
Fix a problem with the 'it' variable in GHCi.  New bindings for 'it'
were getting confused with old bindings, because we always used the
same 'it' name.

Now, we generate a new unique for 'it' each time around.

Also, make sure that any existing variables shadowed by new
command-line bindings are correctly removed from the environments to
avoid space leaks.

23 years ago[project @ 2001-03-19 16:20:44 by simonpj]
simonpj [Mon, 19 Mar 2001 16:20:44 +0000 (16:20 +0000)]
[project @ 2001-03-19 16:20:44 by simonpj]
------------------------------------
Be more gung-ho about INLINE pragmas
------------------------------------

When we see

{-# INLINE f #-}
f = g $ h

should we inline f inside a lambda?  Previously we said 'no'
because f looks like a redex, but that's a great mistake sometimes.
So this commit is more gung-ho: if you say INLINE that's what you get.

The changes are to exprIsDupable and exprIsCheap.

23 years ago[project @ 2001-03-19 16:17:44 by simonmar]
simonmar [Mon, 19 Mar 2001 16:17:44 +0000 (16:17 +0000)]
[project @ 2001-03-19 16:17:44 by simonmar]
exprIsAtom shouldn't return True for an SCC.

23 years ago[project @ 2001-03-19 16:17:27 by simonpj]
simonpj [Mon, 19 Mar 2001 16:17:27 +0000 (16:17 +0000)]
[project @ 2001-03-19 16:17:27 by simonpj]
-------------------------------
PS to: Improve orphan-module resolution
-------------------------------

{This comment got missed out of the previous commit.}

I also moved mkFinalIface from HscMain to MkIface, where it is much tidier.
(This is related, because it's mkFinalIface that now sets mi_orphan.)

23 years ago[project @ 2001-03-19 16:15:29 by simonpj]
simonpj [Mon, 19 Mar 2001 16:15:29 +0000 (16:15 +0000)]
[project @ 2001-03-19 16:15:29 by simonpj]
Reorder the calls to
tcSimplifyTop
and
tcCheckMain

in TcModule.  We must to tcCheckMain first, else we get a bogus
complaint when compiling

main = return ()

(Something about ambiguous monad.)

23 years ago[project @ 2001-03-19 16:13:22 by simonpj]
simonpj [Mon, 19 Mar 2001 16:13:23 +0000 (16:13 +0000)]
[project @ 2001-03-19 16:13:22 by simonpj]
-------------------------------
Improve orphan-module resolution
-------------------------------

Consider the following rule (and there are lots of these in
the Prelude):

fromIntegral T = fromIntegral_T

where T is defined in the module being compiled.

is an orphan.  Of course it isn't, an declaring it an orphan would
make the whole module an orphan module, which is bad.

This commit arranges to determine orphan rules, and the orphan-hood
of a module, much later than before.  (Before mi_orphan was set by
the renamer, now it is set by MkIface.)

23 years ago[project @ 2001-03-19 16:08:37 by simonpj]
simonpj [Mon, 19 Mar 2001 16:08:37 +0000 (16:08 +0000)]
[project @ 2001-03-19 16:08:37 by simonpj]
Update NOTES

23 years ago[project @ 2001-03-19 10:23:45 by simonmar]
simonmar [Mon, 19 Mar 2001 10:25:32 +0000 (10:25 +0000)]
[project @ 2001-03-19 10:23:45 by simonmar]
PutFullMVar went away

23 years ago[project @ 2001-03-16 21:47:41 by qrczak]
qrczak [Fri, 16 Mar 2001 21:47:41 +0000 (21:47 +0000)]
[project @ 2001-03-16 21:47:41 by qrczak]
Use strerror instead of our own errno descriptions.

23 years ago[project @ 2001-03-16 18:15:14 by simonmar]
simonmar [Fri, 16 Mar 2001 18:15:14 +0000 (18:15 +0000)]
[project @ 2001-03-16 18:15:14 by simonmar]
Re-instate filtering of the CAF refs for recursive bindings.  This may
be the cause of GC being real slow on a bootstrapped compiler right now.

23 years ago[project @ 2001-03-16 14:36:19 by sewardj]
sewardj [Fri, 16 Mar 2001 14:36:19 +0000 (14:36 +0000)]
[project @ 2001-03-16 14:36:19 by sewardj]
prelude/PrimOp_HC_OPTS += -H80m at least until we figure out why
ghc-5.0 is leaking space so badly.

23 years ago[project @ 2001-03-16 10:29:57 by simonmar]
simonmar [Fri, 16 Mar 2001 10:29:57 +0000 (10:29 +0000)]
[project @ 2001-03-16 10:29:57 by simonmar]
remove 4 old primops

23 years ago[project @ 2001-03-16 10:07:02 by simonmar]
simonmar [Fri, 16 Mar 2001 10:07:02 +0000 (10:07 +0000)]
[project @ 2001-03-16 10:07:02 by simonmar]
wibbles

23 years ago[project @ 2001-03-16 10:05:01 by simonmar]
simonmar [Fri, 16 Mar 2001 10:05:01 +0000 (10:05 +0000)]
[project @ 2001-03-16 10:05:01 by simonmar]
add -package lang

23 years ago[project @ 2001-03-16 10:04:31 by simonmar]
simonmar [Fri, 16 Mar 2001 10:04:31 +0000 (10:04 +0000)]
[project @ 2001-03-16 10:04:31 by simonmar]
remove bogus import

23 years ago[project @ 2001-03-16 09:07:41 by qrczak]
qrczak [Fri, 16 Mar 2001 09:07:41 +0000 (09:07 +0000)]
[project @ 2001-03-16 09:07:41 by qrczak]
Compile hsc2hs with -O.
Remove INLINE pragmas - they actually degrade performance by 2%.

23 years ago[project @ 2001-03-15 20:35:49 by qrczak]
qrczak [Thu, 15 Mar 2001 20:35:50 +0000 (20:35 +0000)]
[project @ 2001-03-15 20:35:49 by qrczak]
Finish the destruct story:
* Add lengthArray0, destructArray, destructArray0 to module MarshalArray.
* Call destruct in withObject, withArray, withArray0.
* Document destruct and friends.

23 years ago[project @ 2001-03-15 16:17:24 by simonmar]
simonmar [Thu, 15 Mar 2001 16:17:24 +0000 (16:17 +0000)]
[project @ 2001-03-15 16:17:24 by simonmar]
markup wibble

23 years ago[project @ 2001-03-15 16:17:06 by simonmar]
simonmar [Thu, 15 Mar 2001 16:17:06 +0000 (16:17 +0000)]
[project @ 2001-03-15 16:17:06 by simonmar]
document -fignore-asserts

23 years ago[project @ 2001-03-15 16:16:24 by simonmar]
simonmar [Thu, 15 Mar 2001 16:16:24 +0000 (16:16 +0000)]
[project @ 2001-03-15 16:16:24 by simonmar]
nearly finished GHCi docs.

23 years ago[project @ 2001-03-15 16:16:05 by simonmar]
simonmar [Thu, 15 Mar 2001 16:16:05 +0000 (16:16 +0000)]
[project @ 2001-03-15 16:16:05 by simonmar]
- document new <command>ghc-pkg</command> tool
- document <literal>source_dirs</literal> field

23 years ago[project @ 2001-03-15 15:54:35 by simonmar]
simonmar [Thu, 15 Mar 2001 15:54:35 +0000 (15:54 +0000)]
[project @ 2001-03-15 15:54:35 by simonmar]
- Don't duplicate the definition of PackageConfig, instead hackily #include
  it from ../utils/ghc-pkg/Package.hs.

- Add missing source_dir fields to PackageSrc.hs.

23 years ago[project @ 2001-03-15 15:53:28 by simonmar]
simonmar [Thu, 15 Mar 2001 15:53:28 +0000 (15:53 +0000)]
[project @ 2001-03-15 15:53:28 by simonmar]
Remove package management support into a separate tool (ghc-pkg), and
don't duplicate the definition of PackageConfig.

23 years ago[project @ 2001-03-15 15:51:38 by simonmar]
simonmar [Thu, 15 Mar 2001 15:51:38 +0000 (15:51 +0000)]
[project @ 2001-03-15 15:51:38 by simonmar]
New package management tool, basically a broken-out version of ghc
--list-packages, --add-package and --remove-package.

These flags will be removed from GHC; use ghc-pkg instead.

23 years ago[project @ 2001-03-15 12:07:54 by simonmar]
simonmar [Thu, 15 Mar 2001 12:07:54 +0000 (12:07 +0000)]
[project @ 2001-03-15 12:07:54 by simonmar]
fix up markup

23 years ago[project @ 2001-03-15 11:26:27 by simonmar]
simonmar [Thu, 15 Mar 2001 11:26:27 +0000 (11:26 +0000)]
[project @ 2001-03-15 11:26:27 by simonmar]
Do a better job of telling the user whether we're interpreting a
module or using an existing object file.

eg.

   Main> :load A
   Skipping  D                ( D.hs, D.o )
   Compiling C                ( C.hs, interpreted )
   Skipping  B                ( B.hs, B.o )
   Compiling Main             ( A.hs, interpreted )
   Main>

23 years ago[project @ 2001-03-15 11:23:19 by simonmar]
simonmar [Thu, 15 Mar 2001 11:23:19 +0000 (11:23 +0000)]
[project @ 2001-03-15 11:23:19 by simonmar]
clean up, implement ~-expansion for :cd.

23 years ago[project @ 2001-03-15 10:00:32 by simonmar]
simonmar [Thu, 15 Mar 2001 10:00:32 +0000 (10:00 +0000)]
[project @ 2001-03-15 10:00:32 by simonmar]
newlines in strings aren't allowed.

23 years ago[project @ 2001-03-15 07:40:06 by qrczak]
qrczak [Thu, 15 Mar 2001 07:40:06 +0000 (07:40 +0000)]
[project @ 2001-03-15 07:40:06 by qrczak]
Add missing quote mark.

23 years ago[project @ 2001-03-14 23:19:42 by simonpj]
simonpj [Wed, 14 Mar 2001 23:19:42 +0000 (23:19 +0000)]
[project @ 2001-03-14 23:19:42 by simonpj]
-------------------------------
Fix the dreaded export list bug
-------------------------------

With unfailing regularity I manage to get the following wrong:

module A(f) where
  f = ...

module B(f) where
  import A(f)

We must ensure that if A.f changes its type (etc) then B.hi
gets changed, so that people who import B will get recompiled.

There's a large comment with RnIfaces.mkImportInfo, and some
reorganisation in Rename, with a few mainly cosmetic consequences
in RnEnv.

[Simon: I think this will fix the 'OccurAnal not recompiled' problem.]

23 years ago[project @ 2001-03-14 21:22:48 by sebc]
sebc [Wed, 14 Mar 2001 21:22:48 +0000 (21:22 +0000)]
[project @ 2001-03-14 21:22:48 by sebc]
When compiling C bits, prefix CC_OPTS with -optc.

23 years ago[project @ 2001-03-14 17:53:04 by sewardj]
sewardj [Wed, 14 Mar 2001 17:53:04 +0000 (17:53 +0000)]
[project @ 2001-03-14 17:53:04 by sewardj]
Don't try and do `take' of a negative number in compMsg.  The Golden
Lemon award for 2001 goes to <name_deleted_to_protect_the_guilty_party>.

23 years ago[project @ 2001-03-14 17:48:45 by simonmar]
simonmar [Wed, 14 Mar 2001 17:48:45 +0000 (17:48 +0000)]
[project @ 2001-03-14 17:48:45 by simonmar]
Fix a bug which has been causing all SPECIALISE pragmas to be thrown
away.

23 years ago[project @ 2001-03-14 15:26:00 by simonpj]
simonpj [Wed, 14 Mar 2001 15:26:01 +0000 (15:26 +0000)]
[project @ 2001-03-14 15:26:00 by simonpj]
-------------------------------------
Import more rules, and fix usage info
-------------------------------------

1. A rule wasn't being slurped in that should have been.
Reason: wordToWord32# was in the 'TypeEnv', because it's a primop,
so the renamer thought it was already slurped in, which is true.
But it forgot to use the TypeEnv as a source of gates when deciding
which rules to pull in.  Result: a useful rule for the primop wasn't
making it in.  Thanks to Marcin for isolating this one.

2. RnIfaces.recordTypeEnvSlurp (was recordVSlurp) was blindly adding
the name to the iVSlurp set, but the iVSlurp set is supposed to contain
only "big" names (tycons, classes, and Ids that aren't data cons,
class ops etc).  We need to get the big name from the thing.
Mildly tiresomely, this means we have to keep the Class inside
the TyCon derived from that class.   Hence updates to TyCon and Class.

23 years ago[project @ 2001-03-14 15:25:53 by simonpj]
simonpj [Wed, 14 Mar 2001 15:25:53 +0000 (15:25 +0000)]
[project @ 2001-03-14 15:25:53 by simonpj]
Import wibble

23 years ago[project @ 2001-03-14 15:21:25 by simonpj]
simonpj [Wed, 14 Mar 2001 15:21:25 +0000 (15:21 +0000)]
[project @ 2001-03-14 15:21:25 by simonpj]
Remove dead code, and fix fvs1 -> fvs2 in coreTopBindsToStg

23 years ago[project @ 2001-03-14 15:01:04 by sewardj]
sewardj [Wed, 14 Mar 2001 15:01:04 +0000 (15:01 +0000)]
[project @ 2001-03-14 15:01:04 by sewardj]
mut_user_time_during_GC() and mut_user_time(): don't forget to do
TICK_TO_DBL of the result -- if not done, heap profiling times are
off by a factor of 100.

23 years ago[project @ 2001-03-14 14:44:34 by simonmar]
simonmar [Wed, 14 Mar 2001 14:44:34 +0000 (14:44 +0000)]
[project @ 2001-03-14 14:44:34 by simonmar]
don't consider SCC annotations in an argument to be trivial.

23 years ago[project @ 2001-03-14 12:13:02 by rrt]
rrt [Wed, 14 Mar 2001 12:13:02 +0000 (12:13 +0000)]
[project @ 2001-03-14 12:13:02 by rrt]
Add Config.hs generation to Makefile to make TMPDIR work in KludgedSystem.

23 years ago[project @ 2001-03-14 12:05:06 by simonmar]
simonmar [Wed, 14 Mar 2001 12:05:06 +0000 (12:05 +0000)]
[project @ 2001-03-14 12:05:06 by simonmar]
Fix CAF reference tracking for let-no-escapes.

23 years ago[project @ 2001-03-14 11:18:18 by sewardj]
sewardj [Wed, 14 Mar 2001 11:18:18 +0000 (11:18 +0000)]
[project @ 2001-03-14 11:18:18 by sewardj]
Add closure selection for heap profiling.  You can use
-hc{cc_names}, -hd{descrs}, -hy{types}, -hm{mods} to restrict profiled
closures to the specified sets.  Multiple restrictions are allowed.

23 years ago[project @ 2001-03-14 10:16:19 by rrt]
rrt [Wed, 14 Mar 2001 10:16:19 +0000 (10:16 +0000)]
[project @ 2001-03-14 10:16:19 by rrt]
Get 'dis /tmp offa ma back, it stops me doin' Windows hack!

23 years ago[project @ 2001-03-14 10:14:13 by rrt]
rrt [Wed, 14 Mar 2001 10:14:13 +0000 (10:14 +0000)]
[project @ 2001-03-14 10:14:13 by rrt]
Don't use /tmp.

23 years ago[project @ 2001-03-14 10:13:30 by rrt]
rrt [Wed, 14 Mar 2001 10:13:30 +0000 (10:13 +0000)]
[project @ 2001-03-14 10:13:30 by rrt]
Ban /tmp. TMPDIR r00lz!

23 years ago[project @ 2001-03-14 10:12:36 by rrt]
rrt [Wed, 14 Mar 2001 10:12:36 +0000 (10:12 +0000)]
[project @ 2001-03-14 10:12:36 by rrt]
Don't use /tmp. /tmp has bad karma!

23 years ago[project @ 2001-03-14 10:11:16 by rrt]
rrt [Wed, 14 Mar 2001 10:11:16 +0000 (10:11 +0000)]
[project @ 2001-03-14 10:11:16 by rrt]
/tmp -> TMPDIR (don't worry dudes, it's just a comment!)

23 years ago[project @ 2001-03-13 21:21:27 by qrczak]
qrczak [Tue, 13 Mar 2001 21:21:27 +0000 (21:21 +0000)]
[project @ 2001-03-13 21:21:27 by qrczak]
Add 'destruct :: Ptr a -> IO ()' method to class Storable. Thanks
Wojciech Moczydlowski <khaliff@astercity.net> for the suggestion.

It should free memory associated with the object (except the object
pointer itself). A default definition does nothing, but will be
non-trivial for some C structs.

The canonical ForeignPtr finalizer for a malloced data object would be
'destruct p >> free p'.

23 years ago[project @ 2001-03-13 17:46:56 by rrt]
rrt [Tue, 13 Mar 2001 17:46:56 +0000 (17:46 +0000)]
[project @ 2001-03-13 17:46:56 by rrt]
Use TMPDIR, not /tmp.

23 years ago[project @ 2001-03-13 17:30:57 by simonmar]
simonmar [Tue, 13 Mar 2001 17:30:57 +0000 (17:30 +0000)]
[project @ 2001-03-13 17:30:57 by simonmar]
update expected output

23 years ago[project @ 2001-03-13 17:16:52 by simonmar]
simonmar [Tue, 13 Mar 2001 17:19:07 +0000 (17:19 +0000)]
[project @ 2001-03-13 17:16:52 by simonmar]
update expected output

23 years ago[project @ 2001-03-13 17:12:43 by simonmar]
simonmar [Tue, 13 Mar 2001 17:12:43 +0000 (17:12 +0000)]
[project @ 2001-03-13 17:12:43 by simonmar]
update expected output

23 years ago[project @ 2001-03-13 17:08:36 by simonmar]
simonmar [Tue, 13 Mar 2001 17:08:36 +0000 (17:08 +0000)]
[project @ 2001-03-13 17:08:36 by simonmar]
fix up for GHCi

23 years ago[project @ 2001-03-13 16:57:34 by simonpj]
simonpj [Tue, 13 Mar 2001 16:57:34 +0000 (16:57 +0000)]
[project @ 2001-03-13 16:57:34 by simonpj]
Add error location for deriving failure errors

23 years ago[project @ 2001-03-13 16:04:07 by simonpj]
simonpj [Tue, 13 Mar 2001 16:04:07 +0000 (16:04 +0000)]
[project @ 2001-03-13 16:04:07 by simonpj]
Remove debug print

23 years ago[project @ 2001-03-13 15:53:52 by simonmar]
simonmar [Tue, 13 Mar 2001 15:53:52 +0000 (15:53 +0000)]
[project @ 2001-03-13 15:53:52 by simonmar]
unused imports

23 years ago[project @ 2001-03-13 15:45:26 by simonpj]
simonpj [Tue, 13 Mar 2001 15:45:26 +0000 (15:45 +0000)]
[project @ 2001-03-13 15:45:26 by simonpj]
Add beginning of docs for implicit params, and functional deps; I hope formatting is ok

23 years ago[project @ 2001-03-13 15:44:58 by simonpj]
simonpj [Tue, 13 Mar 2001 15:44:58 +0000 (15:44 +0000)]
[project @ 2001-03-13 15:44:58 by simonpj]
Remove docs for -funfolding-interface-threshold

23 years ago[project @ 2001-03-13 15:37:50 by simonmar]
simonmar [Tue, 13 Mar 2001 15:37:50 +0000 (15:37 +0000)]
[project @ 2001-03-13 15:37:50 by simonmar]
remove -funfolding-interface-threshold flag.

23 years ago[project @ 2001-03-13 15:22:54 by simonpj]
simonpj [Tue, 13 Mar 2001 15:22:54 +0000 (15:22 +0000)]
[project @ 2001-03-13 15:22:54 by simonpj]
Add 091

23 years ago[project @ 2001-03-13 14:59:56 by simonmar]
simonmar [Tue, 13 Mar 2001 14:59:56 +0000 (14:59 +0000)]
[project @ 2001-03-13 14:59:56 by simonmar]
fix Happy test.

23 years ago[project @ 2001-03-13 14:58:25 by simonpj]
simonpj [Tue, 13 Mar 2001 14:58:28 +0000 (14:58 +0000)]
[project @ 2001-03-13 14:58:25 by simonpj]
----------------
Nuke ClassContext
----------------

This commit tidies up a long-standing inconsistency in GHC.
The context of a class or instance decl used to be restricted
to predicates of the form
C t1 .. tn
with
type ClassContext = [(Class,[Type])]

but everywhere else in the compiler we used

type ThetaType = [PredType]
where PredType can be any sort of constraint (= predicate).

The inconsistency actually led to a crash, when compiling
class (?x::Int) => C a where {}

I've tidied all this up by nuking ClassContext altogether, and using
PredType throughout.  Lots of modified files, but all in
more-or-less trivial ways.

I've also added a check that the context of a class or instance
decl doesn't include a non-inheritable predicate like (?x::Int).

Other things

 * rename constructor 'Class' from type TypeRep.Pred to 'ClassP'
   (makes it easier to grep for)

 * rename constructor HsPClass  => HsClassP
      HsPIParam => HsIParam

23 years ago[project @ 2001-03-13 14:18:47 by simonmar]
simonmar [Tue, 13 Mar 2001 14:18:47 +0000 (14:18 +0000)]
[project @ 2001-03-13 14:18:47 by simonmar]
re-instate an ASSERT that was temporarily commented out.

23 years ago[project @ 2001-03-13 14:17:16 by simonmar]
simonmar [Tue, 13 Mar 2001 14:17:16 +0000 (14:17 +0000)]
[project @ 2001-03-13 14:17:16 by simonmar]
Fix let-no-escapes again.

23 years ago[project @ 2001-03-13 12:50:29 by simonmar]
simonmar [Tue, 13 Mar 2001 12:50:33 +0000 (12:50 +0000)]
[project @ 2001-03-13 12:50:29 by simonmar]
Some rearrangements that Simon & I have been working on recently:

    - CoreSat is now CorePrep, and is a general "prepare-for-code-
      generation" pass.  It does cloning, saturation of constructors &
      primops, A-normal form, and a couple of other minor fiddlings.

    - CoreTidy no longer does cloning, and minor fiddlings.  It doesn't
      need the unique supply any more, so that's removed.

    - CoreToStg now collects CafInfo and the list of CafRefs for each
      binding.  The SRT pass is much simpler now.

    - IdInfo now has a CgInfo field for "code generator info".  It currently
      contains arity (the actual code gen arity which affects the calling
      convention as opposed to the ArityInfo which is a measure of how
      many arguments the Id can be applied to before it does any work), and
      CafInfo.

      Previously we overloaded the ArityInfo field to contain both
      codegen arity and simplifier arity.  Things are cleaner now.

    - CgInfo is collected by CoreToStg, and passed back into CoreTidy in
      a loop.  The compiler will complain rather than going into a black
      hole if the CgInfo is pulled on too early.

    - Worker info in an interface file now comes with arity info attached.
      Previously the main arity info was overloaded for this purpose, but
      it lead to a few hacks in the compiler, this tidies things up somewhat.

Bottom line: we removed several fragilities, and tidied up a number of
things.  Code size should be smaller, but we'll see...

23 years ago[project @ 2001-03-12 16:33:56 by simonpj]
simonpj [Mon, 12 Mar 2001 16:33:56 +0000 (16:33 +0000)]
[project @ 2001-03-12 16:33:56 by simonpj]
Make a better CPR wrapper when profiling is in use

23 years ago[project @ 2001-03-12 14:59:32 by sewardj]
sewardj [Mon, 12 Mar 2001 14:59:32 +0000 (14:59 +0000)]
[project @ 2001-03-12 14:59:32 by sewardj]
Fix overenthusiatic import GCing, I presume.

23 years ago[project @ 2001-03-12 14:06:46 by simonpj]
simonpj [Mon, 12 Mar 2001 14:06:47 +0000 (14:06 +0000)]
[project @ 2001-03-12 14:06:46 by simonpj]
----------------
First cut at ILX
----------------

This commit puts the ILX .NET code generator into the head.
It's entirely untested, mind you.

Some changes to the Module/Package strutures, mainly of a
naming variety.  In particular:

Package ===> PackageConfig

23 years ago[project @ 2001-03-12 14:06:38 by simonpj]
simonpj [Mon, 12 Mar 2001 14:06:38 +0000 (14:06 +0000)]
[project @ 2001-03-12 14:06:38 by simonpj]
Remove -funfolding-interface-threshold

23 years ago[project @ 2001-03-09 14:44:15 by simonmar]
simonmar [Fri, 9 Mar 2001 14:44:15 +0000 (14:44 +0000)]
[project @ 2001-03-09 14:44:15 by simonmar]
infix declarations for unknown identifiers aren't allowed (contrary to
what GHC thinks).

23 years ago[project @ 2001-03-08 18:05:31 by qrczak]
qrczak [Thu, 8 Mar 2001 18:05:31 +0000 (18:05 +0000)]
[project @ 2001-03-08 18:05:31 by qrczak]
s/setIdGlobalDetails/sedGlobalIdDetails/, and import it.

23 years ago[project @ 2001-03-08 18:03:34 by qrczak]
qrczak [Thu, 8 Mar 2001 18:03:34 +0000 (18:03 +0000)]
[project @ 2001-03-08 18:03:34 by qrczak]
Fix names imported from Id.

23 years ago[project @ 2001-03-08 13:42:17 by simonmar]
simonmar [Thu, 8 Mar 2001 13:42:17 +0000 (13:42 +0000)]
[project @ 2001-03-08 13:42:17 by simonmar]
add expected output

23 years ago[project @ 2001-03-08 13:41:31 by simonmar]
simonmar [Thu, 8 Mar 2001 13:41:31 +0000 (13:41 +0000)]
[project @ 2001-03-08 13:41:31 by simonmar]
update for blocking putMVar

23 years ago[project @ 2001-03-08 13:33:23 by simonpj]
simonpj [Thu, 8 Mar 2001 13:33:23 +0000 (13:33 +0000)]
[project @ 2001-03-08 13:33:23 by simonpj]
Add NameEnv!

23 years ago[project @ 2001-03-08 12:07:38 by simonpj]
simonpj [Thu, 8 Mar 2001 12:07:43 +0000 (12:07 +0000)]
[project @ 2001-03-08 12:07:38 by simonpj]
--------------------
A major hygiene pass
--------------------

1. The main change here is to

Move what was the "IdFlavour" out of IdInfo,
and into the varDetails field of a Var

   It was a mess before, because the flavour was a permanent attribute
   of an Id, whereas the rest of the IdInfo was ephemeral.  It's
   all much tidier now.

   Main places to look:

   Var.lhs Defn of VarDetails
   IdInfo.lhs Defn of GlobalIdDetails

   The main remaining infelicity is that SpecPragmaIds are right down
   in Var.lhs, which seems unduly built-in for such an ephemeral thing.
   But that is no worse than before.

2. Tidy up the HscMain story a little.  Move mkModDetails from MkIface
   into CoreTidy (where it belongs more nicely)

   This was partly forced by (1) above, because I didn't want to make
   DictFun Ids into a separate kind of Id (which is how it was before).
   Not having them separate means we have to keep a list of them right
   through, rather than pull them out of the bindings at the end.

3. Add NameEnv as a separate module (to join NameSet).

4. Remove unnecessary {-# SOURCE #-} imports from FieldLabel.

23 years ago[project @ 2001-03-08 11:59:02 by simonpj]
simonpj [Thu, 8 Mar 2001 11:59:02 +0000 (11:59 +0000)]
[project @ 2001-03-08 11:59:02 by simonpj]
-------------------------
Remove function coercions
-------------------------

    (coerce (T1->T2) (S1->S2) F) E
  ===>
    coerce T2 S2 (F (coerce S1 T1 E))

This is a generally good transformation, but it
still doesn't solve the problem I was after.  Consider

  newtype T = MkT (Int -> Int)

  p :: T->T;   p = ...
  q :: T;      q = ...

  foo :: T
  {-# INLINE foo #-}
  foo = p $ q

  f = \y -> ...((coerce (Int->Int) foo) 3)...

Trouble is, foo doesn't see the argument because of the coerce, so it
thinks it's a lone variable and doesn't inline.

Another problem is that since $ ins't inlined into foo's RHS, foo
looks like a redex, which we are reluctant to inline inside a lambda,
even with an INLINE pragma.  Maybe we should be bolder?

Anyway, this commit is an improvement to Simplify, but the story is not
over!

23 years ago[project @ 2001-03-08 11:44:16 by simonmar]
simonmar [Thu, 8 Mar 2001 11:44:16 +0000 (11:44 +0000)]
[project @ 2001-03-08 11:44:16 by simonmar]
remove cyclic dependency

23 years ago[project @ 2001-03-08 09:50:18 by simonmar]
simonmar [Thu, 8 Mar 2001 09:50:18 +0000 (09:50 +0000)]
[project @ 2001-03-08 09:50:18 by simonmar]
rearrange slightly to make this compile again.

23 years ago[project @ 2001-03-07 15:49:23 by sewardj]
sewardj [Wed, 7 Mar 2001 15:49:24 +0000 (15:49 +0000)]
[project @ 2001-03-07 15:49:23 by sewardj]
Driver and infrastructure files (.T's) for the new test framework.

23 years ago[project @ 2001-03-07 12:35:50 by simonpj]
simonpj [Wed, 7 Mar 2001 12:35:50 +0000 (12:35 +0000)]
[project @ 2001-03-07 12:35:50 by simonpj]
Remove DOS Ctrl-Ms

23 years ago[project @ 2001-03-07 10:28:40 by rrt]
rrt [Wed, 7 Mar 2001 10:28:40 +0000 (10:28 +0000)]
[project @ 2001-03-07 10:28:40 by rrt]
Import v_TmpDir.

23 years ago[project @ 2001-03-07 10:27:43 by rrt]
rrt [Wed, 7 Mar 2001 10:27:43 +0000 (10:27 +0000)]
[project @ 2001-03-07 10:27:43 by rrt]
On mingwin, remove CRs from input file, to prevent problems when
reading from unmounted partitions. (This shouldn't be a problem, but
it is; this fix makes the mangler a bit more robust anyway.)

23 years ago[project @ 2001-03-07 10:23:03 by rrt]
rrt [Wed, 7 Mar 2001 10:23:03 +0000 (10:23 +0000)]
[project @ 2001-03-07 10:23:03 by rrt]
Make Windows path mangling of FPTOOLS_TOP_ABS work.

23 years ago[project @ 2001-03-06 15:59:11 by simonmar]
simonmar [Tue, 6 Mar 2001 15:59:11 +0000 (15:59 +0000)]
[project @ 2001-03-06 15:59:11 by simonmar]
undo accidental change

23 years ago[project @ 2001-03-06 15:58:47 by simonmar]
simonmar [Tue, 6 Mar 2001 15:58:47 +0000 (15:58 +0000)]
[project @ 2001-03-06 15:58:47 by simonmar]
changes to build new ParsePkgConf module

23 years ago[project @ 2001-03-06 15:00:25 by rrt]
rrt [Tue, 6 Mar 2001 15:00:25 +0000 (15:00 +0000)]
[project @ 2001-03-06 15:00:25 by rrt]
Use TMPDIR, not /tmp.

23 years ago[project @ 2001-03-06 11:23:46 by simonmar]
simonmar [Tue, 6 Mar 2001 11:23:46 +0000 (11:23 +0000)]
[project @ 2001-03-06 11:23:46 by simonmar]
- Add a Happy parser for the package config file.  This is faster and
  compiles to less code than the derived Read instance we had before.

- Add a source_dirs field to the package spec.  This isn't used by
  GHC, because we currently assume all packages are compiled.  It could
  be used by Hugs, though.

- Make unspecified fields of type [String] default to the empty list
  in a package spec.

23 years ago[project @ 2001-03-06 10:13:35 by simonmar]
simonmar [Tue, 6 Mar 2001 10:13:35 +0000 (10:13 +0000)]
[project @ 2001-03-06 10:13:35 by simonmar]
import wibbles

23 years ago[project @ 2001-03-06 07:58:43 by simonpj]
simonpj [Tue, 6 Mar 2001 07:58:43 +0000 (07:58 +0000)]
[project @ 2001-03-06 07:58:43 by simonpj]
Fix minor bug in SpecConstr; failed to deal with DEFAULT case

23 years ago[project @ 2001-03-05 15:37:25 by simonpj]
simonpj [Mon, 5 Mar 2001 15:37:25 +0000 (15:37 +0000)]
[project @ 2001-03-05 15:37:25 by simonpj]
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

let
   h = f 3
in
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

Id.isOneShotLambda

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.

23 years ago[project @ 2001-03-05 12:46:16 by simonpj]
simonpj [Mon, 5 Mar 2001 12:46:16 +0000 (12:46 +0000)]
[project @ 2001-03-05 12:46:16 by simonpj]
Print debug uniques consistently in base64

23 years ago[project @ 2001-03-05 12:45:45 by simonpj]
simonpj [Mon, 5 Mar 2001 12:45:45 +0000 (12:45 +0000)]
[project @ 2001-03-05 12:45:45 by simonpj]
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:

  $s$wdemandAll
    = \ 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 ;

23 years ago[project @ 2001-03-05 12:19:37 by simonpj]
simonpj [Mon, 5 Mar 2001 12:19:37 +0000 (12:19 +0000)]
[project @ 2001-03-05 12:19:37 by simonpj]
Better dump of transformation rules

23 years ago[project @ 2001-03-05 12:18:43 by simonpj]
simonpj [Mon, 5 Mar 2001 12:18:43 +0000 (12:18 +0000)]
[project @ 2001-03-05 12:18:43 by simonpj]
Remove debug trace

23 years ago[project @ 2001-03-05 12:18:21 by simonpj]
simonpj [Mon, 5 Mar 2001 12:18:21 +0000 (12:18 +0000)]
[project @ 2001-03-05 12:18:21 by simonpj]
Make error message more helpful