updOptLevel :: Int -> DynFlags -> DynFlags
-- Set dynflags appropriate to the optimisation level
updOptLevel n dfs
- = if (n >= 1)
- then dfs2{ hscTarget = HscC, optLevel = n } -- turn on -fvia-C with -O
- else dfs2{ optLevel = n }
+ = dfs2{ optLevel = n }
where
dfs1 = foldr (flip dopt_unset) dfs remove_dopts
dfs2 = foldr (flip dopt_set) dfs1 extra_dopts
<para>Use GHC's native code generator rather than
compiling via C. This will compile faster (up to twice as
fast), but may produce code that is slightly slower than
- compiling via C. <option>-fasm</option> is the default
- when optimisation is off (see <xref
- linkend="options-optimise"/>).</para>
+ compiling via C. <option>-fasm</option> is the default.</para>
</listitem>
</varlistentry>
</term>
<listitem>
<para>Compile via C instead of using the native code
- generator. This is default for optimised compilations,
- and on architectures for which GHC doesn't have a native
- code generator.</para>
+ generator. This is the default on architectures for which GHC
+ doesn't have a native code generator.</para>
</listitem>
</varlistentry>
mind-bogglingly clever. Better to let GCC have a go, as it
tries much harder on register allocation, etc.</para>
- <para>At the moment, if you turn on <option>-O</option> you
- get GCC instead. This may change in the future.</para>
-
<para>So, when we want very fast code, we use: <option>-O
-fvia-C</option>.</para>
</listitem>
<para>Means: “Generate good-quality code without
taking too long about it.” Thus, for example:
<command>ghc -c -O Main.lhs</command></para>
-
- <para><option>-O</option> currently also implies
- <option>-fvia-C</option>. This may change in the
- future.</para>
</listitem>
</varlistentry>