From: simonpj Date: Thu, 25 Nov 1999 10:41:44 +0000 (+0000) Subject: [project @ 1999-11-25 10:41:44 by simonpj] X-Git-Tag: Approximately_9120_patches~5486 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=26a9fe5c457c0b67d6670371d2548eb48afaf257;p=ghc-hetmet.git [project @ 1999-11-25 10:41:44 by simonpj] Simon's driver changes (should have committed these a while back) * Add -no-rules to first simplifier pass * Move CSE pass --- diff --git a/ghc/driver/ghc.lprl b/ghc/driver/ghc.lprl index 432282d..2b66048 100644 --- a/ghc/driver/ghc.lprl +++ b/ghc/driver/ghc.lprl @@ -570,7 +570,6 @@ Now slurp through the arguments. if ( $Status == 0 && $Only_generate_deps ) { push (@MkDependHS_flags, "-o$Osuffix") if $Osuffix; - push (@MkDependHS_flags, "-s$BuildTag") if $BuildTag; # They're not (currently) needed, but we need to quote any -#include options foreach (@Cmd_opts) { s/-#include.*$/'$&'/g; @@ -720,6 +719,10 @@ sub setupOptimiseFlags { # ==> ...(case (case x of I# x# -> fw x#) of ...)... # ==> ...(case x of I# x# -> case fw x# of ...)... # and now the redex (f x) isn't floatable any more + + '-fno-rules', # Similarly, don't apply any rules until after full laziness + # Notably, list fusion can prevent floating. + '-fmax-simplifier-iterations2', ']', @@ -774,14 +777,23 @@ sub setupOptimiseFlags { # No -finline-phase: allow all Ids to be inlined now ']', - '-fcse', # CSE must immediately follow a simplification pass, because it relies - # on the no-shadowing invariant. See comments at the top of CSE.lhs - '-ffull-laziness', # nofib/spectral/hartel/wang doubles in speed if you # do full laziness late in the day. It only happens # after fusion and other stuff, so the early pass doesn't # catch it. For the record, the redex is # f_el22 (f_el21 r_midblock) + + # We want CSE to follow the final full-laziness pass, because it may + # succeed in commoning up things floated out by full laziness. + # + # CSE must immediately follow a simplification pass, because it relies + # on the no-shadowing invariant. See comments at the top of CSE.lhs + # So it must NOT follow float-inwards, which can give rise to shadowing, + # even if its input doesn't have shadows. Hence putting it between + # the two passes. + '-fcse', + + '-ffloat-inwards', # Case-liberation for -O2. This should be after @@ -791,6 +803,8 @@ sub setupOptimiseFlags { # ? '' # : "-fliberate-case -fsimplify [ $Oopt_FB_Support -ffloat-lets-exposing-whnf -ffloat-primops-ok -fcase-of-case -fdo-case-elim -fcase-merge -fdo-lambda-eta-expansion -freuse-con -flet-to-case $Oopt_PedanticBottoms $Oopt_MaxSimplifierIterations $Oopt_ShowSimplifierProgress ]" ), +# '-fliberate-case', + # Final clean-up simplification: '-fsimplify', @@ -3129,6 +3143,9 @@ arg: while($_ = $Args[0]) { /^-funfolding-.*$/ && do { push(@HsC_flags, $_); next arg }; + /^-fliberate-case-.*$/ + && do { push(@HsC_flags, $_); next arg }; + /^-funfold-casms-in-hi-file$/ && do { push(@HsC_flags, $_); next arg };