Simon,
But I think the way to handle
it is this. Suppose we have
f x y = (f ex (C a b))...
where C is a constructor, and where y is scrutinised by a
case expression somewhere in f's body. Then, in this recursive
call to f, we know what y will be, and we could save the case
Simon Peyton-Jones [EMAIL PROTECTED] wrote,
Meanwhile, in the head, if you specify -O2 you'll get better
code for some of your loops, namely the ones that repeatedly
evaluate a free variable every time round the loop. The
loop is duplicated and everything is nice.
[..]
You mentioned
PArrays.$w$snewPArray
= \ ww :: PrelGHC.Int# w :: PrelBase.Int -
case PrelGHC.newIntArray# @ PrelGHC.RealWorld ww PrelGHC.realWorld#
of wild { (# s2#, mba# #) -
let {
eta :: PrelBase.Int
__A 0 __C
eta
= PrelBase.$wI# ww
]]
| Sent: 02 November 2000 13:54
| To: Simon Peyton-Jones
| Cc: [EMAIL PROTECTED]
| Subject: RE: Fun with GHC's optimiser
|
|
| Simon Peyton-Jones [EMAIL PROTECTED] wrote,
|
| I can never resist messages like these, even when I'm meant
| to be doing other things.
|
| That's good to know
Thu, 7 Dec 2000 09:17:44 -0800, Simon Peyton-Jones [EMAIL PROTECTED] pisze:
Try now. On the HEAD. Which should compile OK now, incidentally.
But does not work...
../../ghc/compiler/ghc-inplace -recomp -cpp -fglasgow-exts -fvia-C -icheck -O
-package lang -package concurrent -package
Questions over questions arise in my quest to understand
GHC's code generator. In this nice little piece of STG
$w$snewPArray =
NO_CCS[] \r[ww w]
case newIntArray# [ww realWorld#] of wild {
(#,#) s2# mba# -
case -# [ww 1] of y {
DEFAULT -
I can never resist messages like these, even when I'm meant
to be doing other things. It's very helpful when people offer
fairly precise performance-bug reports. Thanks!
| I am wondering whether there is a particular reason why the
| optimiser doesn't pull the
|
| (1) a = NO_CCS PArray!
Simon Peyton-Jones [EMAIL PROTECTED] wrote,
I can never resist messages like these, even when I'm meant
to be doing other things.
That's good to know ;-)
It's very helpful when people offer
fairly precise performance-bug reports. Thanks!
Thanks for the prompt reply! To SimonM, too.