Ticket #7868: 0001-Enable-funbox-small-strict-fields-by-default.patch

File 0001-Enable-funbox-small-strict-fields-by-default.patch, 2.2 KB (added by tibbe, 12 months ago)
  • compiler/main/DynFlags.hs

    From 23e3a74d747c6b8ba993e206aad4924990bb6148 Mon Sep 17 00:00:00 2001
    From: Johan Tibell <johan.tibell@gmail.com>
    Date: Fri, 26 Apr 2013 11:14:01 -0700
    Subject: [PATCH 1/1] Enable -funbox-small-strict-fields by default
    
    The flag shows no real impact on nofib benchmarks and GHC itself,
    which is expected given the small number of strict but not already
    unpacked fields in the source of these programs. However, the flag
    allows us to omit most of the UNPACK pragmas that are so common in
    source code today.
    ---
     compiler/main/DynFlags.hs  |    1 +
     docs/users_guide/using.xml |   11 ++++++-----
     2 files changed, 7 insertions(+), 5 deletions(-)
    
    diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
    index 52eed21..029aa04 100644
    a b optLevelFlags 
    27412741    , ([1,2],   Opt_FullLaziness) 
    27422742    , ([1,2],   Opt_Specialise) 
    27432743    , ([1,2],   Opt_FloatIn) 
     2744    , ([1,2],   Opt_UnboxSmallStrictFields) 
    27442745 
    27452746    , ([2],     Opt_LiberateCase) 
    27462747    , ([2],     Opt_SpecConstr) 
  • docs/users_guide/using.xml

    diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
    index 6574e9e..c3b925d 100644
    a b f "2" = 2 
    18871887            <indexterm><primary>constructor fields, strict</primary></indexterm> 
    18881888          </term> 
    18891889          <listitem> 
    1890             <para>This option causes all constructor fields which are 
    1891             marked strict (i.e. &ldquo;!&rdquo;) and which 
    1892             representation is smaller or equal to the size of a 
    1893             pointer to be unpacked, if possible. It is equivalent to 
    1894             adding an <literal>UNPACK</literal> pragma (see <xref 
     1890            <para><emphasis>On by default.</emphasis>. This option 
     1891            causes all constructor fields which are marked strict 
     1892            (i.e. &ldquo;!&rdquo;) and which representation is smaller 
     1893            or equal to the size of a pointer to be unpacked, if 
     1894            possible. It is equivalent to adding an 
     1895            <literal>UNPACK</literal> pragma (see <xref 
    18951896            linkend="unpack-pragma"/>) to every strict constructor 
    18961897            field that fulfils the size restriction. 
    18971898            </para>