Meaning of -fno-foldr-build-on?
Kirsten Chevalier
krc at uclink.berkeley.edu
Tue Jun 24 14:36:54 EDT 2003
Hi,
I'm using GHC 5.05 and after compiling a program with -O1, -ddump-simpl-stats,
-fno-foldr-build-on, got output like this:
<other stuff snipped>
3 RuleFired
1 fold/build
1 map
1 unpack
So, the fold/build rule is being applied even if you run GHC with
-fno-foldr-build-on. I RTFSed, and it appears that the only place in GHC
where the -ffoldr-build-on command-line option is looked at is in
DsListComp.lhs.
In the flag reference in the manual, the effect of -ffoldr-build-on is listed
as "Enable foldr-build optimisation" (presumably suggesting that
-fno-foldr-build-on disables the optimization). This seems misleading if the
only thing that -ffoldr-build-on/-fno-foldr-build-on actually does is to
control whether list comprehensions are desugared using foldr/build. It seems
that either the documentation or GHC should be corrected. (It would be nice
if there were a flag to disable *all* rewrite rules while still doing other
optimizations -- this doesn't seem to exist either.)
Sorry if this is something that's corrected in 6.0 - I haven't upgraded yet.
Thanks,
Kirsten
--
Kirsten Chevalier * krc at uclink.berkeley.edu * Often in error, never in doubt
More information about the Glasgow-haskell-bugs
mailing list