ghc-hetmet.git
22 years ago[project @ 2001-12-29 09:24:42 by sof]
sof [Sat, 29 Dec 2001 09:24:42 +0000 (09:24 +0000)]
[project @ 2001-12-29 09:24:42 by sof]
add raft of missing symbols to RTS_SYMBOLS

22 years ago[project @ 2001-12-28 22:58:17 by sof]
sof [Fri, 28 Dec 2001 22:58:17 +0000 (22:58 +0000)]
[project @ 2001-12-28 22:58:17 by sof]
struct sigset_t -> sigset_t

22 years ago[project @ 2001-12-28 17:25:31 by simonpj]
simonpj [Fri, 28 Dec 2001 17:25:32 +0000 (17:25 +0000)]
[project @ 2001-12-28 17:25:31 by simonpj]
---------------------
Dealing with deriving
---------------------

I spent a ridiculously long time peering at a bug report whereby
a 'deriving' clause sent GHC 5.02.1 into a loop.  It was all to
do with allowing instances like

instance Foo a b => Baz (T a)

(Notice the 'b' on the left which does not appear on the right.)

I realised that it's hard for the deriving machinery to find a
fixpoint when these sort of instance decls are around.  So I
now constrain *derived* instance decls not to have this form;
all the tyvars on the left must appear on the right.

On the way I commoned up the previously-separate tcSimplify
machinery for 'deriving' and 'default' decls with that for
everything else.   As a result, quite a few files are touched.

I hope I havn't broken anything.

22 years ago[project @ 2001-12-28 17:20:36 by simonpj]
simonpj [Fri, 28 Dec 2001 17:20:36 +0000 (17:20 +0000)]
[project @ 2001-12-28 17:20:36 by simonpj]
-----------------------------
Buglet in rank-N polymorphism
-----------------------------

Fix a bug in the way result type signatures are handled; they
hadn't been brought into the rank-N polymorphism world.

22 years ago[project @ 2001-12-28 16:36:54 by sof]
sof [Fri, 28 Dec 2001 16:36:54 +0000 (16:36 +0000)]
[project @ 2001-12-28 16:36:54 by sof]
heal

22 years ago[project @ 2001-12-28 00:14:33 by sof]
sof [Fri, 28 Dec 2001 00:14:33 +0000 (00:14 +0000)]
[project @ 2001-12-28 00:14:33 by sof]
debugging-by-nightly-build-reports; give poke_c_flag a correct FI decl

22 years ago[project @ 2001-12-27 11:29:58 by sof]
sof [Thu, 27 Dec 2001 11:30:10 +0000 (11:30 +0000)]
[project @ 2001-12-27 11:29:58 by sof]
Get rid of uses of #const, #peek, #poke and #ptr from PrelPosix.hsc
(this leaves just uses of #type in PrelPosix) - provide constant and
accessor wrappers via PrelIOUtils.c instead.

Who knows, we might just be able to bootstrap via .hc files again..?

Only compiled & tested under Win32.

22 years ago[project @ 2001-12-27 11:26:03 by sof]
sof [Thu, 27 Dec 2001 11:26:03 +0000 (11:26 +0000)]
[project @ 2001-12-27 11:26:03 by sof]
Added & exported low-level memcpy() wrappers - possible to offset both
src and dest.

22 years ago[project @ 2001-12-27 09:28:10 by sof]
sof [Thu, 27 Dec 2001 09:28:11 +0000 (09:28 +0000)]
[project @ 2001-12-27 09:28:10 by sof]
- removed PrelPosix.c_read, PrelPosix.c_write
- added Ptr and RawBuffer versions of PrelHandle.write_off,
  and PrelHandle.read_off and exported them, i.e., PrelHandle
  now exports:

    read_off_ba :: FD -> Bool -> RawBuffer -> Int -> CInt -> IO CInt
    read_off :: FD -> Bool -> Ptr CChar -> Int -> CInt -> IO CInt
    write_off_ba :: CInt -> Bool -> RawBuffer -> Int -> CInt -> IO CInt
    write_off :: CInt -> Bool -> Ptr CChar -> Int -> CInt -> IO CInt

- make hPutChar (win)socket friendly.

22 years ago[project @ 2001-12-26 23:08:07 by sof]
sof [Wed, 26 Dec 2001 23:08:07 +0000 (23:08 +0000)]
[project @ 2001-12-26 23:08:07 by sof]
add exeext to HS_PROG to avoid redundant re-linking

22 years ago[project @ 2001-12-21 17:03:18 by sewardj]
sewardj [Fri, 21 Dec 2001 17:03:18 +0000 (17:03 +0000)]
[project @ 2001-12-21 17:03:18 by sewardj]
derive Eq Cond so that an assertion in MachCode works.

22 years ago[project @ 2001-12-21 16:39:09 by simonpj]
simonpj [Fri, 21 Dec 2001 16:39:09 +0000 (16:39 +0000)]
[project @ 2001-12-21 16:39:09 by simonpj]
wibble

22 years ago[project @ 2001-12-21 10:30:32 by simonpj]
simonpj [Fri, 21 Dec 2001 10:30:32 +0000 (10:30 +0000)]
[project @ 2001-12-21 10:30:32 by simonpj]
Wibble

22 years ago[project @ 2001-12-21 10:24:24 by simonmar]
simonmar [Fri, 21 Dec 2001 10:24:24 +0000 (10:24 +0000)]
[project @ 2001-12-21 10:24:24 by simonmar]
Allow record declaratoins with zero fields.

22 years ago[project @ 2001-12-21 10:05:55 by simonpj]
simonpj [Fri, 21 Dec 2001 10:05:55 +0000 (10:05 +0000)]
[project @ 2001-12-21 10:05:55 by simonpj]
Docment newtype deriving stuff

22 years ago[project @ 2001-12-21 10:05:11 by simonpj]
simonpj [Fri, 21 Dec 2001 10:05:11 +0000 (10:05 +0000)]
[project @ 2001-12-21 10:05:11 by simonpj]
More wibbles to newtype deriving

22 years ago[project @ 2001-12-20 17:38:40 by sewardj]
sewardj [Thu, 20 Dec 2001 17:38:41 +0000 (17:38 +0000)]
[project @ 2001-12-20 17:38:40 by sewardj]
Move some small inline-in-C functions out of PrelPosix.hsc and into
the supporting cbits sources, where they belong.

Following this change, can you now compile the entire Prelude on
x86-linux with the native code generator, and get something which
actually works properly.

22 years ago[project @ 2001-12-20 17:10:00 by simonpj]
simonpj [Thu, 20 Dec 2001 17:10:01 +0000 (17:10 +0000)]
[project @ 2001-12-20 17:10:00 by simonpj]
Wibbles

22 years ago[project @ 2001-12-20 17:09:46 by simonpj]
simonpj [Thu, 20 Dec 2001 17:09:46 +0000 (17:09 +0000)]
[project @ 2001-12-20 17:09:46 by simonpj]
Comments

22 years ago[project @ 2001-12-20 16:39:29 by simonmar]
simonmar [Thu, 20 Dec 2001 16:39:29 +0000 (16:39 +0000)]
[project @ 2001-12-20 16:39:29 by simonmar]
Now that we can derive arbitrary classes for newtypes, use this to
derive all the classes we need for the types in PrelCTypes and
PrelCTypesISO, instead of the previous hack of explicitly coercing the
methods.

This should improve the quality of code using these types too; the
coercions were surely getting in the way of optimisations before.

22 years ago[project @ 2001-12-20 16:12:09 by sewardj]
sewardj [Thu, 20 Dec 2001 16:12:09 +0000 (16:12 +0000)]
[project @ 2001-12-20 16:12:09 by sewardj]
Outline freeStablePtr, so NCG-generated code actually has something to call :)

Also remove the presumably-defunct splitStablePtr.

22 years ago[project @ 2001-12-20 15:20:37 by sewardj]
sewardj [Thu, 20 Dec 2001 15:20:38 +0000 (15:20 +0000)]
[project @ 2001-12-20 15:20:37 by sewardj]
Generate floating-point comparisons on x86 which deal with NaNs in what
I assume is an IEEE854 compliant fashion.  For
   == >= > <= <
if either arg is a NaN, produce False, and for
   /=
if either arg is a NaN, produce True.

This is the behaviour that gcc has, by default.

Requires some ultramagical x86 code frags to be emitted.  A big comment
in PprMach explains how it works.

22 years ago[project @ 2001-12-20 15:16:13 by sewardj]
sewardj [Thu, 20 Dec 2001 15:16:13 +0000 (15:16 +0000)]
[project @ 2001-12-20 15:16:13 by sewardj]
nano-comment-wibble

22 years ago[project @ 2001-12-20 11:19:05 by simonpj]
simonpj [Thu, 20 Dec 2001 11:19:12 +0000 (11:19 +0000)]
[project @ 2001-12-20 11:19:05 by simonpj]
---------------------------------------------
More type system extensions (for John Hughes)
---------------------------------------------

1.  Added a brand-new extension that lets you derive ARBITRARY CLASSES
for newtypes.  Thus

newtype Age = Age Int deriving( Eq, Ord, Shape, Ix )

The idea is that the dictionary for the user-defined class Shape Age
is *identical* to that for Shape Int, so there is really no deriving
work to do.   This saves you writing the very tiresome instance decl:

instance Shape Age where
   shape_op1 (Age x) = shape_op1 x
   shape_op2 (Age x1) (Age x2) = shape_op2 x1 x2
   ...etc...

It's more efficient, too, becuase the Shape Age dictionary really
will be identical to the Shape Int dictionary.

There's an exception for Read and Show, because the derived instance
*isn't* the same.

There is a complication where higher order stuff is involved.  Here is
the example John gave:

   class StateMonad s m | m -> s where ...

   newtype Parser tok m a = Parser (State [tok] (Failure m) a)
  deriving( Monad, StateMonad )

Then we want the derived instance decls to be

   instance Monad (State [tok] (Failure m)) => Monad (Parser tok m)
   instance StateMonad [tok] (State [tok] (Failure m))
 => StateMonad [tok] (Parser tok m)

John is writing up manual entry for all of this, but this commit
implements it.   I think.

2.  Added -fallow-incoherent-instances, and documented it.  The idea
is that sometimes GHC is over-protective about not committing to a
particular instance, and the programmer may want to say "commit anyway".
Here's the example:

    class Sat a where
      dict :: a

    data EqD a = EqD {eq :: a->a->Bool}

    instance Sat (EqD a) => Eq a where
      (==) = eq dict

    instance Sat (EqD Integer) where
      dict = EqD{eq=(==)}

    instance Eq a => Sat (EqD a) where
      dict = EqD{eq=(==)}

    class Collection c cxt | c -> cxt where
      empty :: Sat (cxt a) => c a
      single :: Sat (cxt a) => a -> c a
      union :: Sat (cxt a) => c a -> c a -> c a
      member :: Sat (cxt a) => a -> c a -> Bool

    instance Collection [] EqD where
      empty = []
      single x = [x]
      union = (++)
      member = elem

It's an updated attempt to model "Restricted Data Types", if you
remember my Haskell workshop paper. In the end, though, GHC rejects
the program (even with fallow-overlapping-instances and
fallow-undecideable-instances), because there's more than one way to
construct the Eq instance needed by elem.

Yet all the ways are equivalent! So GHC is being a bit over-protective
of me, really: I know what I'm doing and I would LIKE it to pick an
arbitrary one. Maybe a flag fallow-incoherent-instances would be a
useful thing to add?

22 years ago[project @ 2001-12-19 17:07:49 by sewardj]
sewardj [Wed, 19 Dec 2001 17:07:49 +0000 (17:07 +0000)]
[project @ 2001-12-19 17:07:49 by sewardj]
Correctly handle signed vs unsigned integer division on x86.

22 years ago[project @ 2001-12-19 15:51:49 by simonmar]
simonmar [Wed, 19 Dec 2001 15:51:49 +0000 (15:51 +0000)]
[project @ 2001-12-19 15:51:49 by simonmar]
Documentation update to describe the new retainer profiling and
biographical profiling features.

22 years ago[project @ 2001-12-19 15:20:27 by simonmar]
simonmar [Wed, 19 Dec 2001 15:20:27 +0000 (15:20 +0000)]
[project @ 2001-12-19 15:20:27 by simonmar]
Remove some temporary debugging code.

22 years ago[project @ 2001-12-18 19:42:41 by sebc]
sebc [Tue, 18 Dec 2001 19:42:41 +0000 (19:42 +0000)]
[project @ 2001-12-18 19:42:41 by sebc]
THIS CHANGE AFFECTS ALL OBJECT FILES.
Please say "make clean"

Move the entry code pointer to the start of info tables, according
to Plan C in ghc/rts/Storage.h

22 years ago[project @ 2001-12-18 15:23:15 by sewardj]
sewardj [Tue, 18 Dec 2001 15:23:16 +0000 (15:23 +0000)]
[project @ 2001-12-18 15:23:15 by sewardj]
Fix various bugs in the implementation of subIntC and mulMayOflo.

22 years ago[project @ 2001-12-18 13:03:12 by simonmar]
simonmar [Tue, 18 Dec 2001 13:03:12 +0000 (13:03 +0000)]
[project @ 2001-12-18 13:03:12 by simonmar]
Nuke -O2-for-C, since it can cause gcc to generate incorrect code, and
doesn't seem to help much.  Add a comment about this in the 5.02
release notes, saying you can still use -optc-O2 if you really want
to.

(merged from rev. 1.47.2.3)

22 years ago[project @ 2001-12-18 13:01:52 by simonmar]
simonmar [Tue, 18 Dec 2001 13:01:52 +0000 (13:01 +0000)]
[project @ 2001-12-18 13:01:52 by simonmar]
merge rev. 1.11.4.1 from branch ghc-5-02-branch (remove -O2-for-C)

22 years ago[project @ 2001-12-18 12:55:34 by simonmar]
simonmar [Tue, 18 Dec 2001 12:55:34 +0000 (12:55 +0000)]
[project @ 2001-12-18 12:55:34 by simonmar]
merge rev. 1.11.2.2 from ghc-5-02-branch (remove -O2-for-C).

22 years ago[project @ 2001-12-18 12:33:45 by simonmar]
simonmar [Tue, 18 Dec 2001 12:33:45 +0000 (12:33 +0000)]
[project @ 2001-12-18 12:33:45 by simonmar]
remove unnecessary #include

22 years ago[project @ 2001-12-18 12:13:05 by simonmar]
simonmar [Tue, 18 Dec 2001 12:13:05 +0000 (12:13 +0000)]
[project @ 2001-12-18 12:13:05 by simonmar]
Add the missing options list to the section "Replacing the program for
one or more phases".

22 years ago[project @ 2001-12-18 10:37:52 by simonmar]
simonmar [Tue, 18 Dec 2001 10:37:52 +0000 (10:37 +0000)]
[project @ 2001-12-18 10:37:52 by simonmar]
Allow opening char & block devices with openFile.  Opening a char
device gets you a stream, and a block device a file (these are
heuristics since we can't really tell without trying to lseek() on the
device whether it supports seeking or not, but the defaults are at
least safe).

22 years ago[project @ 2001-12-17 18:03:08 by sewardj]
sewardj [Mon, 17 Dec 2001 18:03:09 +0000 (18:03 +0000)]
[project @ 2001-12-17 18:03:08 by sewardj]
Redo translation of array indexing primops in order to insert 8 <-> 32
bit casts when dealing with Char arrays.  Also facilitate future removal
of CMem and MO_{Read,Write}OSBI.

In the process, notice and fix a large bogon in x86/sparc implementation
of signed and unsigned integer widening.

22 years ago[project @ 2001-12-17 16:01:44 by simonmar]
simonmar [Mon, 17 Dec 2001 16:01:44 +0000 (16:01 +0000)]
[project @ 2001-12-17 16:01:44 by simonmar]
comment wibbles

22 years ago[project @ 2001-12-17 12:33:45 by simonmar]
simonmar [Mon, 17 Dec 2001 12:33:45 +0000 (12:33 +0000)]
[project @ 2001-12-17 12:33:45 by simonmar]
Generate better code for case-of-literal (i.e. just do the
assignment).  These crop up now that the simplifier is a bit more
careful about duplicating literal strings.

22 years ago[project @ 2001-12-17 12:32:05 by simonmar]
simonmar [Mon, 17 Dec 2001 12:32:05 +0000 (12:32 +0000)]
[project @ 2001-12-17 12:32:05 by simonmar]
mkLocalNonRec bug fix: we always want to generate a case when the rhs
of a binding is an unlifted type.  Previously the two cases for an
unlifted rhs and a strict binding were handled together which caused
some confusion, so now the cases are separate.

22 years ago[project @ 2001-12-17 10:12:34 by simonmar]
simonmar [Mon, 17 Dec 2001 10:12:34 +0000 (10:12 +0000)]
[project @ 2001-12-17 10:12:34 by simonmar]
slightly clearer fix for previous bogon, and re-indent the function

22 years ago[project @ 2001-12-17 09:30:07 by simonpj]
simonpj [Mon, 17 Dec 2001 09:30:07 +0000 (09:30 +0000)]
[project @ 2001-12-17 09:30:07 by simonpj]
Fix ifdefery bracketing bug on Win32

22 years ago[project @ 2001-12-15 12:03:08 by panne]
panne [Sat, 15 Dec 2001 12:03:08 +0000 (12:03 +0000)]
[project @ 2001-12-15 12:03:08 by panne]
Re-added #ifdef which was lost in last commit

22 years ago[project @ 2001-12-14 17:24:19 by simonpj]
simonpj [Fri, 14 Dec 2001 17:24:19 +0000 (17:24 +0000)]
[project @ 2001-12-14 17:24:19 by simonpj]
Add a rule for foldr k z [x]

22 years ago[project @ 2001-12-14 17:24:03 by simonpj]
simonpj [Fri, 14 Dec 2001 17:24:05 +0000 (17:24 +0000)]
[project @ 2001-12-14 17:24:03 by simonpj]
-------------------------
Performance tuning things
-------------------------

I did some nofib tests, and fixed a number of performance problems.

1.  Things were getting floated to top level, and that prevented
some useful fusion happening.
y = build g
x = foldr k z y

Fixed by arranging that we only get really keen on floating to top
level in the second run of the let-float-out pass.

2.  Some fettling up on the let-floater itself.  It had some parameters
that weren't even being used!  And it was stupidly floating things out
of a one-shot lambda, and the float-in pass didn't float them back in.
I think I fixed both of these problems.

3.  The eta-reducer was not eta-reducing (/\a -> g a) to g.  In general
it has to be a bit careful because "seq" means that (\x -> g x) is
not in general the same as g ---- but it *is* the same for a type lambda.

This turned out to be important in rule matching, where the foldr/build
rule was not firing because the LHS of the rule looked like
foldr k z (/\ a -> g a) = ...
which never matched!  Result, no fusion to speak of!

4.  The simplifier was a bit too gung ho about inlining used-once
things bound to constructor args.  The comment is with Simplify.simplNonRecX.

22 years ago[project @ 2001-12-14 16:57:36 by sewardj]
sewardj [Fri, 14 Dec 2001 16:57:36 +0000 (16:57 +0000)]
[project @ 2001-12-14 16:57:36 by sewardj]
Sparc NCG changes to track recent mulIntC# changes.  The Prelude
can now finally be compiled with the sparc NCG.

Also (incidentally) emit sparc integer multiply insns directly
rather than calling a helper routine.  Most sparcs should implement
them by now :)

22 years ago[project @ 2001-12-14 15:26:14 by sewardj]
sewardj [Fri, 14 Dec 2001 15:26:16 +0000 (15:26 +0000)]
[project @ 2001-12-14 15:26:14 by sewardj]
Get rid of multiple-result MachOps (MO_NatS_AddC, MO_NatS_SubC,
MO_NatS_MulC) which implement {add,sub,mul}IntC#.  Supporting gunk
in the NCG disappears as a result.

Instead:

* {add,sub}IntC# are translated out during abstract C simplification,
  turning into the xor-xor-invert-and-shift sequence previously defined
  in PrimOps.h.

* mulIntC# is more difficult to get rid of portably.  Instead we have
  a new single-result PrimOp, mulIntMayOflo, with corresponding MachOp
  MO_NatS_MulMayOflo.  This tells you whether a W x W -> W signed
  multiply might overflow, where W is the word size.  When W=32, is
  implemented by computing a 2W-long result.  When W=64, we use the
  previous approximation.

PrelNum.lhs' implementation of timesInteger changes slightly, to use
the new PrimOp.

22 years ago[project @ 2001-12-14 12:05:15 by simonmar]
simonmar [Fri, 14 Dec 2001 12:05:30 +0000 (12:05 +0000)]
[project @ 2001-12-14 12:05:15 by simonmar]
shiftR# --> shiftRL#

22 years ago[project @ 2001-12-13 23:32:21 by sof]
sof [Thu, 13 Dec 2001 23:32:21 +0000 (23:32 +0000)]
[project @ 2001-12-13 23:32:21 by sof]
shift wibble

22 years ago[project @ 2001-12-13 12:33:49 by sewardj]
sewardj [Thu, 13 Dec 2001 12:33:50 +0000 (12:33 +0000)]
[project @ 2001-12-13 12:33:49 by sewardj]
Sparc NCG fixes for 16 bit loads/stores.

22 years ago[project @ 2001-12-13 11:42:47 by simonmar]
simonmar [Thu, 13 Dec 2001 11:42:47 +0000 (11:42 +0000)]
[project @ 2001-12-13 11:42:47 by simonmar]
SUBDIR builds now happen *after* the current directory, to alleviate
problems caused by the including of _hsc.o files in cbits libs - if
the .hsc file was touched and we recurse into the cbits lib first,
then hsc2hs got run in the cbits lib generating a bogus Foo.hs file in
the current directory which refers to ../Foo_hsc.h.

There was a comment saying that the SUBDIR builds were first because
of something to do with building DLLs in hslibs, but didn't give any
more detail.  If/when DLLs are re-enabled we can revisit this.

22 years ago[project @ 2001-12-13 11:12:27 by simonmar]
simonmar [Thu, 13 Dec 2001 11:12:27 +0000 (11:12 +0000)]
[project @ 2001-12-13 11:12:27 by simonmar]
Add shifty wrappers:

   shiftL#, shiftR# :: Word# -> Int# -> Word#
   iShiftL#, iShiftRA#, iShiftRL# :: Int# -> Int# -> Int#

22 years ago[project @ 2001-12-13 10:48:29 by simonpj]
simonpj [Thu, 13 Dec 2001 10:48:29 +0000 (10:48 +0000)]
[project @ 2001-12-13 10:48:29 by simonpj]
Swap order of test; see comments in code

22 years ago[project @ 2001-12-13 10:47:28 by sewardj]
sewardj [Thu, 13 Dec 2001 10:47:28 +0000 (10:47 +0000)]
[project @ 2001-12-13 10:47:28 by sewardj]
Documentation-only change: say that shift ops have undefined results
for shift amounts outside the range 0 to word size - 1 inclusive.

22 years ago[project @ 2001-12-13 09:23:22 by sof]
sof [Thu, 13 Dec 2001 09:23:23 +0000 (09:23 +0000)]
[project @ 2001-12-13 09:23:22 by sof]
new option, --enable-src-tree-happy, which forces the use of happy/src/happy-inplace as HAPPY

22 years ago[project @ 2001-12-13 01:00:28 by sof]
sof [Thu, 13 Dec 2001 01:00:28 +0000 (01:00 +0000)]
[project @ 2001-12-13 01:00:28 by sof]
Document -i option

22 years ago[project @ 2001-12-13 00:59:57 by sof]
sof [Thu, 13 Dec 2001 00:59:57 +0000 (00:59 +0000)]
[project @ 2001-12-13 00:59:57 by sof]
New option, -i <file> / --input-file=<file>, which controls
where to read new package specs from. If <file> is equal to
"-", stdin is used as input source. The default value for
<file> is "-".

22 years ago[project @ 2001-12-12 18:12:45 by sewardj]
sewardj [Wed, 12 Dec 2001 18:12:46 +0000 (18:12 +0000)]
[project @ 2001-12-12 18:12:45 by sewardj]
Make the sparc native code generator work again after recent
primop hackery.

* Track the change from PrimOp to MachOp at the Stix level.

* Teach the sparc insn selector how to generate 64-bit code.

* Fix various bogons in sparc {Int,Double,Float} <-> {Int,Double,Float}
  conversions which only happened to generate correct code by
  accident, so far.

* Synthesise BaseReg from &MainCapability.r on archs which do not
  have BaseReg in a regiser (eg sparc :)

At the moment {add,sub,mul}Int# are not implemented.  To be fixed.

22 years ago[project @ 2001-12-12 15:59:33 by simonmar]
simonmar [Wed, 12 Dec 2001 15:59:33 +0000 (15:59 +0000)]
[project @ 2001-12-12 15:59:33 by simonmar]
Include the CCS ID in the heap profile, so you can find the full CCS
description in <foo>.prof or the XML profile output.

22 years ago[project @ 2001-12-12 15:13:20 by simonmar]
simonmar [Wed, 12 Dec 2001 15:13:20 +0000 (15:13 +0000)]
[project @ 2001-12-12 15:13:20 by simonmar]
Include the cost-centre-stack ID in the time profiling output.

22 years ago[project @ 2001-12-12 15:01:25 by simonmar]
simonmar [Wed, 12 Dec 2001 15:01:25 +0000 (15:01 +0000)]
[project @ 2001-12-12 15:01:25 by simonmar]
Fix a couple of assertions.

22 years ago[project @ 2001-12-12 14:59:41 by simonmar]
simonmar [Wed, 12 Dec 2001 14:59:41 +0000 (14:59 +0000)]
[project @ 2001-12-12 14:59:41 by simonmar]
Cache whether a particular CCS is "selected" during this heap
profiling run in the CCS structure to save time during heap
censuses. (other changes in previous commit to rts/Profiling.c,
rts/ProfHeap.c).

22 years ago[project @ 2001-12-12 14:58:26 by simonmar]
simonmar [Wed, 12 Dec 2001 14:58:26 +0000 (14:58 +0000)]
[project @ 2001-12-12 14:58:26 by simonmar]
Add -hC flag.

22 years ago[project @ 2001-12-12 14:31:42 by simonmar]
simonmar [Wed, 12 Dec 2001 14:31:43 +0000 (14:31 +0000)]
[project @ 2001-12-12 14:31:42 by simonmar]
- Add a new type of restriction: -hC, which restricts to closures
  whose CCS contains the specified CCs *anywhere* (not just at the
  top).

- Complain if the user tries to request both retainer and biographical
  profiling.  We don't support both simultaneously, because they use
  the same header word in the closure.

- Allow for the fact that the heap might contain some closures which
  don't have a valid retainer set during the heap census.  The only
  known closures of this kind so far are DEAD_WEAK closures.

- Some cruft-removal and renaming of functions to follow conventions.

22 years ago[project @ 2001-12-12 14:25:03 by simonmar]
simonmar [Wed, 12 Dec 2001 14:25:03 +0000 (14:25 +0000)]
[project @ 2001-12-12 14:25:03 by simonmar]
- Relax the restriction that roots must also be retainers, by changing
  the type of the 'r' argument to retainClosure from (StgClosure *) to
  retainer.  Now retainRoot can pass CCS_SYSTEM as the retainer for a
  root if the closure is itself not a retainer.

- Traverse roots from the stable ptr table, which might not also be
  retainers (hence the generalisation above).

22 years ago[project @ 2001-12-12 14:03:30 by simonmar]
simonmar [Wed, 12 Dec 2001 14:03:30 +0000 (14:03 +0000)]
[project @ 2001-12-12 14:03:30 by simonmar]
Add multi-slurp protection

22 years ago[project @ 2001-12-12 13:35:38 by simonpj]
simonpj [Wed, 12 Dec 2001 13:35:38 +0000 (13:35 +0000)]
[project @ 2001-12-12 13:35:38 by simonpj]
Keep wibbling; this fixes the float-out crash

22 years ago[project @ 2001-12-12 12:19:11 by simonmar]
simonmar [Wed, 12 Dec 2001 12:20:10 +0000 (12:20 +0000)]
[project @ 2001-12-12 12:19:11 by simonmar]
shiftery #ifdefs

22 years ago[project @ 2001-12-12 10:46:59 by simonpj]
simonpj [Wed, 12 Dec 2001 10:46:59 +0000 (10:46 +0000)]
[project @ 2001-12-12 10:46:59 by simonpj]
Wibble

22 years ago[project @ 2001-12-12 06:48:20 by chak]
chak [Wed, 12 Dec 2001 06:48:20 +0000 (06:48 +0000)]
[project @ 2001-12-12 06:48:20 by chak]
Added some more details about parsing.

22 years ago[project @ 2001-12-12 05:23:34 by chak]
chak [Wed, 12 Dec 2001 05:23:34 +0000 (05:23 +0000)]
[project @ 2001-12-12 05:23:34 by chak]
wibble

22 years ago[project @ 2001-12-11 21:19:35 by panne]
panne [Tue, 11 Dec 2001 21:19:35 +0000 (21:19 +0000)]
[project @ 2001-12-11 21:19:35 by panne]
Strange: Removing getName (which should be accessible via NamedThing(..),
anyway) from the import list is necessary to make this module compile.
Otherwise we get:

   hsSyn/HsCore.lhs:197: Variable not in scope: `getOccName'

Perhaps somebody could enlighten me what's going on here... %-]

22 years ago[project @ 2001-12-11 20:14:57 by panne]
panne [Tue, 11 Dec 2001 20:14:57 +0000 (20:14 +0000)]
[project @ 2001-12-11 20:14:57 by panne]
Never-ending story, part #2: The shifting continues...

22 years ago[project @ 2001-12-11 19:01:17 by panne]
panne [Tue, 11 Dec 2001 19:01:17 +0000 (19:01 +0000)]
[project @ 2001-12-11 19:01:17 by panne]
More shifting #ifdef-ery... :-P

22 years ago[project @ 2001-12-11 18:25:15 by sof]
sof [Tue, 11 Dec 2001 18:25:15 +0000 (18:25 +0000)]
[project @ 2001-12-11 18:25:15 by sof]
restore ForeignObj_CLOSURE_DATA - still used by PprAbsC.ppr_casm_arg

22 years ago[project @ 2001-12-11 17:51:33 by simonpj]
simonpj [Tue, 11 Dec 2001 17:51:33 +0000 (17:51 +0000)]
[project @ 2001-12-11 17:51:33 by simonpj]
More inline/floating fixes; sigh

22 years ago[project @ 2001-12-11 12:39:04 by sewardj]
sewardj [Tue, 11 Dec 2001 12:39:04 +0000 (12:39 +0000)]
[project @ 2001-12-11 12:39:04 by sewardj]
Really Actually fix syntax errors wrt -DDEBUG.

22 years ago[project @ 2001-12-11 12:21:06 by simonmar]
simonmar [Tue, 11 Dec 2001 12:21:06 +0000 (12:21 +0000)]
[project @ 2001-12-11 12:21:06 by simonmar]
Make this module compile with the recent changes to the names of the
shift primops.

22 years ago[project @ 2001-12-11 12:20:22 by simonpj]
simonpj [Tue, 11 Dec 2001 12:20:22 +0000 (12:20 +0000)]
[project @ 2001-12-11 12:20:22 by simonpj]
------------------------------
Don't float out of INLINE blocks
------------------------------

We never want to float stuff out of an INLINE right hand
side.  This has been a long-standing thorn, and I managed
to dislodge it yesterday (hence Lint errors).  Fixed again,
more robustly this time (I hope).

22 years ago[project @ 2001-12-11 12:19:04 by simonpj]
simonpj [Tue, 11 Dec 2001 12:19:04 +0000 (12:19 +0000)]
[project @ 2001-12-11 12:19:04 by simonpj]
Dead code removal

22 years ago[project @ 2001-12-11 12:18:49 by simonpj]
simonpj [Tue, 11 Dec 2001 12:18:49 +0000 (12:18 +0000)]
[project @ 2001-12-11 12:18:49 by simonpj]
More DEBUG syntax errors

22 years ago[project @ 2001-12-11 12:03:23 by simonmar]
simonmar [Tue, 11 Dec 2001 12:03:23 +0000 (12:03 +0000)]
[project @ 2001-12-11 12:03:23 by simonmar]
eliminate warnings

22 years ago[project @ 2001-12-11 11:47:00 by simonmar]
simonmar [Tue, 11 Dec 2001 11:47:00 +0000 (11:47 +0000)]
[project @ 2001-12-11 11:47:00 by simonmar]
Fix typo inside #ifdef DEBUG

22 years ago[project @ 2001-12-11 02:59:17 by chak]
chak [Tue, 11 Dec 2001 02:59:17 +0000 (02:59 +0000)]
[project @ 2001-12-11 02:59:17 by chak]
I guess, this got lost in Julian's commit yesterday.

22 years ago[project @ 2001-12-10 18:06:50 by sof]
sof [Mon, 10 Dec 2001 18:07:35 +0000 (18:07 +0000)]
[project @ 2001-12-10 18:06:50 by sof]
bdescr's back field is now inside a union

22 years ago[project @ 2001-12-10 18:04:51 by sewardj]
sewardj [Mon, 10 Dec 2001 18:04:52 +0000 (18:04 +0000)]
[project @ 2001-12-10 18:04:51 by sewardj]
Add just enough infrastructure to the NCG that it can deal with simple 64-bit
code on 32-bit platforms.  Main changes are:

* Addition of a simple 64-bit instruction selection fn iselExpr64 to MachCode.
  This generates code for a 64-bit value and places the results into two
  virtual registers, related thusly:

* Add a new type VRegUnique, which is used to label Stix virtual registers.
  This type used to be a plain Unique, but that forces the assumption that
  each Abstract-C level C temporary corresponds to exactly one Stix virtual
  register, which is untrue when the C temporary is 64-bit sized on a
  32-bit machine.  In the new scheme, the Unique for the C temporary can
  turn into two related VRegUniques, related by having the same embedded
  unique.

* Made a start on 'target metrics' by adding ncg_target_is_32bits to the
  end of Stix.lhs.

* Cleaned up numerous other gruesomenesses in the NCG which never came
  to light before now.   Got rid of MachMisc.sizeOf, which doesn't make
  sense in a 64-bit setting, and replaced it by calls to
  PrimRep.getPrimRepArrayElemSize, which, as far as I'm concerned, is the
  definitive answer to the questio `How Big Is This PrimRep Really?'

Result: on x86-linux, at least, you can now compile the Entire Prelude
with -fasm!  At this stage I cannot claim that the resulting code is
correct, but it's a start.

22 years ago[project @ 2001-12-10 17:59:54 by sof]
sof [Mon, 10 Dec 2001 17:59:54 +0000 (17:59 +0000)]
[project @ 2001-12-10 17:59:54 by sof]
RTS_SYMBOLS: MainCapability is not defined in SMP-mode

22 years ago[project @ 2001-12-10 17:55:40 by sewardj]
sewardj [Mon, 10 Dec 2001 17:55:40 +0000 (17:55 +0000)]
[project @ 2001-12-10 17:55:40 by sewardj]
Fix a presumably long-standing cut-n-paste-o, wherein HP_CHK_L1 had
exactly the same definition as HP_CHK_D1.

22 years ago[project @ 2001-12-10 14:08:58 by simonmar]
simonmar [Mon, 10 Dec 2001 14:08:58 +0000 (14:08 +0000)]
[project @ 2001-12-10 14:08:58 by simonmar]
Some lifting of the lazy parts of the parse tree so we don't parse too
much when using happy --strict.

22 years ago[project @ 2001-12-10 14:08:14 by simonmar]
simonmar [Mon, 10 Dec 2001 14:08:14 +0000 (14:08 +0000)]
[project @ 2001-12-10 14:08:14 by simonmar]
The flag -fno-cpr is now only present in a DEBUG compiler.

22 years ago[project @ 2001-12-10 14:07:30 by simonmar]
simonmar [Mon, 10 Dec 2001 14:07:31 +0000 (14:07 +0000)]
[project @ 2001-12-10 14:07:30 by simonmar]
Make the inclusion of the old strictness analyser, CPR analyser, and
the relevant IdInfo components, conditional on DEBUG.  This makes
IdInfo smaller by three fields in a non-DEBUG compiler, and reduces
the risk that the unused fields could harbour space leaks.

Eventually these passes will go away altogether.

22 years ago[project @ 2001-12-10 14:05:06 by simonmar]
simonmar [Mon, 10 Dec 2001 14:05:06 +0000 (14:05 +0000)]
[project @ 2001-12-10 14:05:06 by simonmar]
Note that the final call to coreBindsSize is still necessary to
eliminate space leakage from the simplifier.

22 years ago[project @ 2001-12-10 14:02:45 by simonmar]
simonmar [Mon, 10 Dec 2001 14:02:45 +0000 (14:02 +0000)]
[project @ 2001-12-10 14:02:45 by simonmar]
Print the "type description" of a closure for profiling as the user
string, not the Z-encoded string.  Fixes problems with things like
'ZMZN' appearing in profiling output.

22 years ago[project @ 2001-12-10 14:00:35 by simonmar]
simonmar [Mon, 10 Dec 2001 14:00:35 +0000 (14:00 +0000)]
[project @ 2001-12-10 14:00:35 by simonmar]
Make the OccName and SrcLoc fields of a Name strict, to eliminate
space leaks.  This doesn't hurt performance.

22 years ago[project @ 2001-12-10 13:54:35 by simonmar]
simonmar [Mon, 10 Dec 2001 13:54:35 +0000 (13:54 +0000)]
[project @ 2001-12-10 13:54:35 by simonmar]
Don't force the IdInfo of a variable *occurrence* in exprSize, just
the binding sites should be enough.

22 years ago[project @ 2001-12-10 12:26:10 by simonpj]
simonpj [Mon, 10 Dec 2001 12:26:10 +0000 (12:26 +0000)]
[project @ 2001-12-10 12:26:10 by simonpj]
------------------------------
Don't do CPR w/w for constants
------------------------------

We don't want to do a CPR split for a constant
function.  So if the worker will get no (value) args,
we disable the CPR transformation.

This infelicity exposed a buglet in the full laziness
transformation; we were floating an expression outside
an InlineMe context.   I've take the blunderbuss approach
now, of effectively disabling full laziness inside an
InlineMe.  Seems reasonable.

22 years ago[project @ 2001-12-10 01:27:59 by sebc]
sebc [Mon, 10 Dec 2001 01:28:00 +0000 (01:28 +0000)]
[project @ 2001-12-10 01:27:59 by sebc]
MacOS X 10.1 identifies as "darwin"

22 years ago[project @ 2001-12-10 01:21:17 by sebc]
sebc [Mon, 10 Dec 2001 01:21:17 +0000 (01:21 +0000)]
[project @ 2001-12-10 01:21:17 by sebc]
MacOS X 10.1 now has a libm

22 years ago[project @ 2001-12-07 20:57:53 by sof]
sof [Fri, 7 Dec 2001 20:57:53 +0000 (20:57 +0000)]
[project @ 2001-12-07 20:57:53 by sof]
- tidy up TICK_ALLOC_TSO() uses.
- scheduleThread: remove special-case for END_TSO_QUEUE. If you want
  to call schedule(), do so directly. (Only one of the scheduleThread()
  call sites depended on this feature).

22 years ago[project @ 2001-12-07 17:33:26 by simonpj]
simonpj [Fri, 7 Dec 2001 17:33:26 +0000 (17:33 +0000)]
[project @ 2001-12-07 17:33:26 by simonpj]
----------------------------
More jiggling in the renamer
----------------------------

I was a little hasty before.  (Thanks Sigbjorn for finding
this.)  This commit tidies up the handling of AvailEnvs.
Principally:

  * filterImports now deals completely with hiding
    (before it handed off part of the job to mkGlobalRdrEnv)

  * The AvailEnv in an ExportAvails does not have class ops and
    data constructors in its domain.  This makes plusExportAvails
    more efficient, but the main thing is that it collects things
    up right.  (Previously, if we had
import M( C )
import M( op )
    then we got an AvailEnv which had C |-> AvailTC C [C]
    (no 'op').

  * In Rename, we do need a "filled-out" version of the overall
    AvailEnv, full_avail_env, which we construct on the spot in 'rename'.

22 years ago[project @ 2001-12-07 15:49:41 by sof]
sof [Fri, 7 Dec 2001 15:49:41 +0000 (15:49 +0000)]
[project @ 2001-12-07 15:49:41 by sof]
Track the removal of ReallyUnsafePtrEqualityOp + InterTo{Int,Word}64Op primops.