<?xml version="1.0"?>
<!DOCTYPE flagsdescription
   SYSTEM "http://www.spec.org/dtd/cpuflags2.dtd"
>

<flagsdescription>

<filename>aocc130-flags-revA2</filename>
<title>AMD Optimizing C/C++ Compiler Suite Version 1.3.0 SPEC CPU2017 Flag Description</title>

<style>
    <![CDATA[
    body { background: white; }
    ]]>
</style>

<!-- Lines will be up to this wide ============================================================================================ -->

<!-- Submit command documentation ============================================================================================= -->

<submit_command>
    <![CDATA[
    <p><b>Using <code>numactl</code> to bind processes and memory to cores</b></p>

    <p>For multi-copy runs or single copy runs on systems with multiple sockets, it is advantageous to bind a process to a
        particular core.  Otherwise, the OS may arbitrarily move your process from one core to another.  This can affect
        performance.  To help, SPEC allows the use of a "submit" command where users can specify a utility to use to bind
        processes.  We have found the utility '<code>numactl</code>' to be the best choice.</p>

    <p><code>numactl</code> runs processes with a specific NUMA scheduling or memory placement policy.  The policy is set for a
        command and inherited by all of its children.  The <code>numactl</code> flag "<code>--physcpubind</code>" specifies
        which core(s) to bind the process.  "<code>-l</code>" instructs <code>numactl</code> to keep a process's memory on the
        local node while "<code>-m</code>" specifies which node(s) to place a process's memory.  For full details on using
        <code>numactl</code>, please refer to your Linux documentation, '<code>man numactl</code>'</p>

    <p>Note that some older versions of <code>numactl</code> incorrectly interpret application arguments as its own.  For
        example, with the command "<code>numactl --physcpubind=0 -l a.out -m a</code>", <code>numactl</code> will interpret
        <code>a.out</code>'s "<code>-m</code>" option as its own "<code>-m</code>" option.  To work around this problem, we put
        the command to be run in a shell script and then run the shell script using <code>numactl</code>.  For example:
        "<code>echo 'a.out -m a' > run.sh ; numactl --physcpubind=0 bash run.sh</code>"</p>

    ]]>
</submit_command>


<!-- Software environment description ========================================================================================= -->

<sw_environment>
    <![CDATA[
    <p><b>Transparent Huge Pages (THP)</b></p>
    <p>THP is an abstraction layer that automates most aspects of creating, managing, and using huge pages.  THP is designed
        to hide much of the complexity in using huge pages from system administrators and developers, as normal huge pages
        must be assigned at boot time, can be difficult to manage manually, and often require significant changes to code in
        order to be used effectively. Most recent Linux OS releases have THP enabled by default.</p>

    <p><b>Linux Huge Page settings</b></p>
    <p>If you need finer control you can manually set huge pages using the following steps:</p>

    <ul>
        <li>Create a mount point for the huge pages: <code>mkdir /mnt/hugepages</code></li>

        <li>The huge page file system needs to be mounted when the systems reboots.  Add the following to a system boot
            configuration file before any services are started: <code>mount -t hugetlbfs nodev /mnt/hugepages</code></li>

        <li>Set <code>vm/nr_hugepages=N</code> in <code>/etc/sysctl.conf</code> where N is the maximum number of pages the
            system may allocate.</li>

        <li>Reboot to have the changes take effect.</li>
    </ul>
    <p>Note that further information about huge pages may be found in the <a
            href="https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt">Linux kernel documentation file
            <code>hugetlbpage.txt</code></a>.</p>

    <p><b> <code>ulimit -s &lt;n&gt;</code></b></p>
    <p>
        Sets the stack size to <b>n</b> kbytes, or <b>unlimited</b> to allow the stack size to grow without limit.
    </p>

    <p><b> <code>ulimit -l &lt;n&gt;</code></b></p>
    <p>
        Sets the maximum size of memory that may be locked into physical memory.
    </p>

    <p><b><code>cpupower frequency-set -r -g performance</code> (on Ubuntu, SLES, RHEL)</b></p>
    <p>
        Sets the CPU governor to "performance" to enable the highest supported performance state for all cores.
    </p>

    <p><b><code>powersave -f</code> (on SuSE)</b></p>
    <p>
        Makes the powersave daemon set the CPUs to the highest supported frequency.
    </p>

    <p><b><code>/etc/init.d/cpuspeed stop</code> (on Red Hat)</b></p>
    <p>
        Disables the cpu frequency scaling program in order to set the CPUs to the highest supported frequency.
    </p>

    <p><b><code>OMP_NUM_THREADS</code></b></p>
    <p>
        Sets the maximum number of OpenMP parallel threads applications based on OpenMP may use.
    </p>

    <p><b><code>LD_LIBRARY_PATH</code></b></p>
    <p>
        An environment variable that indicates the location in the filesystem of bundled libraries to use when running the benchmark
        binaries.
    </p>

    <p><b><code>kernel/randomize_va_space</code></b></p>
    <p>
        This option can be used to select the type of process address space randomization that is used in the system, for
        architectures that support this feature.
    </p>

    <ul>

        <li>0 - Turn the process address space randomization off.  This is the default for architectures that do not support
            this feature anyway, and kernels that are booted with the "<code>norandmaps</code>" parameter.</li>

        <li>1 - Make the addresses of mmap base, stack and VDSO page randomized.  This, among other things, implies that
            shared libraries will be loaded to random addresses.  Also for PIE-linked binaries, the location of code start is
            randomized.  This is the default if the <code>CONFIG_COMPAT_BRK</code> option is enabled.</li>

        <li>2 - Additionally enable heap randomization.  This is the default if <code>CONFIG_COMPAT_BRK</code> is
            disabled.</li>
    </ul>

    <p><b><code>MALLOC_CONF</code></b></p>
    <p>
        An environment variable set to tune the jemalloc allocation strategy during the execution of the binaries. This
        environment variable setting is not needed when building the binaries on the system under test.
    </p>
    ]]>
</sw_environment>


<!-- Page headers ============================================================================================================= -->

<header>
    <![CDATA[
    <h2>Compilers: AMD Optimizing C/C++ Compiler Suite 1.3.0</h2>
    ]]>
</header>

<!-- Option splitters ========================================================================================================= -->

<!--
  AOCC allows multiple space-delimited flags to be sent to subsystems, as in
      -fplugin-arg-dragonegg-llvm-option="-enable-iv-split -merge-constant -inline-threshold:1000"
  which causes 3 space-delimited flags to be sent to the DragonEgg LLVM plugin.

  In order to make processing of these compound flags easier, the splitter below will break them up
  into individual flags.  For the example above, this flag will produce

      -fplugin-arg-dragonegg-llvm-option=-enable-iv-split
      -fplugin-arg-dragonegg-llvm-option="-merge-constant -inline-threshold:1000"

  This process is repeated until the compound flag is decomposed into its component parts:

      -fplugin-arg-dragonegg-llvm-option=-enable-iv-split
      -fplugin-arg-dragonegg-llvm-option=-merge-constant
      -fplugin-arg-dragonegg-llvm-option=-inline-threshold:1000
      -fplugin-arg-dragonegg-llvm-option=""

  The final switch is the degenerate case, and this section also contains a flag to consume it and not display it.

  In the regexp that follows,
   $1   (-\S+)         matches "-flag", which is assumed to contain one or more non-whitespace characters
   $2   ([^&quot;"]*)  matches the rest of the quoted string, which may be empty. "&quot;" is for the benefit of the
                       XML parser and expands to a double quote like you'd expect it to.
-->

<flag name="plugin_arg_splitter"
    regexp="-fplugin-arg-dragonegg-llvm-option=&quot;(-\S+)\s*([^&quot;]*)&quot;(?=\s|$)"
    class="optimization"
    >
    <example>Splitter rule for plugin arguments: -fplugin-arg-dragonegg-llvm-option="-flag[ -flag...]"</example>
    <include text="-fplugin-arg-dragonegg-llvm-option=$1" />
    <include text="-fplugin-arg-dragonegg-llvm-option=&quot;$2&quot;" />
    <display enable="0" />
</flag>

<flag name="empty_plugin_arg_eater"
    regexp="-fplugin-arg-dragonegg-llvm-option=&quot;&quot;(?=\s|$)"
    class="optimization"
    >
    <example>Consumer rule for the tail of split up plugin arguments: -fplugin-arg-dragonegg-llvm-option=""</example>
    <display enable="0" />
</flag>


<!-- Optimization flags ======================================================================================================= -->

<flag name="F-O"
    class="optimization"
    >
    <example>-O</example>
    <![CDATA[
    <p>Set the optimization level to <kbd>-O2</kbd>.</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
    <include flag="F-O2" />
</flag>

<flag name="F-O0"
    class="optimization"
    >
    <example>-O0</example>
    <![CDATA[
    <p>Means "no optimization". This level compiles the fastest and generates the most debuggable code.</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
    <include flag="F-O0" />
</flag>

<flag name="F-O1"
    class="optimization"
    >
    <example>-O1</example>
    <![CDATA[
    <p>Somewhere between <kbd>-O0</kbd> and <kbd>-O2</kbd>.</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
</flag>

<flag name="F-O2"
    class="optimization"
    >
    <example>-O2</example>
    <![CDATA[
    <p>Moderate level of optimization which enables most optimizations.  This is the default when no "<kbd>-O</kbd>" option is specified,
        or if no value is specified (i.e. "<kbd>-O</kbd>").</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
    <include flag="F-O1" />
</flag>

<flag name="F-O3"
    class="optimization"
    >
    <example>-O3</example>
    <![CDATA[
    <p> Like <kbd>-O2</kbd>, except that it enables optimizations that take longer to perform or that may generate larger code (in
        an attempt to make the program run faster).</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
    <include flag="F-O2" />
</flag>

<flag name="F-Os"
    class="optimization"
    >
    <example>-Os</example>
    <![CDATA[
    <p>Like <kbd>-O2</kbd> with extra optimizations to reduce code size.</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
    <include flag="F-O2" />
</flag>

<flag name="F-Oz"
    class="optimization"
    >
    <example>-Oz</example>
    <![CDATA[
    <p>Like <kbd>-Os</kbd> (and thus <kbd>-O2</kbd>), but reduces code size further.</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
    <include flag="F-Os" />
</flag>

<flag name="F-O4"
    class="optimization"
    >
    <example>-O4</example>
    <![CDATA[
    <p>Equivalent to <kbd>-O3</kbd>.</p>

    <p>If multiple "O" options are used, with or without level numbers, the last such option is the one that is effective.</p>
    ]]>
    <include flag="F-O3" />
</flag>

<flag name="aocc-Ofast"
    class="optimization"
    regexp="-Ofast(?=\s|$)"
    >
    <example>-Ofast</example>
    <![CDATA[
    <p>Enables all the optimizations from <kbd>-O3</kbd> along with other aggressive optimizations that may violate strict compliance with
        language standards. Refer to the AOCC options document for the language you're using for more detailed documentation of
        optimizations enabled under <kbd>-Ofast</kbd>.</p>
    ]]>
    <include flag="F-O3" />
</flag>

<flag name="aocc-march"
    class="optimization"
    regexp="-march=(i486|x86-64|native|znver1|auto)(?=\s|$)"
    >
    <example>-march=znver1</example>
    <![CDATA[
    <p>Specify that Clang should generate code for a specific processor family member and later. For example, if you specify
        <kbd>-march=znver1</kbd>, the compiler is allowed to generate instructions that are valid on AMD Zen processors, but
        which may not exist on earlier products.</p>
    ]]>
</flag>

<flag name="F-fexceptions"
    class="optimization"
    regexp="(-Wf,)?-f(no-)?exceptions(?=\s|$)"
    >
    <example>-fno-exceptions</example>
    <![CDATA[
    <p>(For C++ only) Enable generation of unwind information. This allows exceptions to be thrown through Clang compiled stack
        frames. This is on by default in x86-64. <kbd>-fno-exceptions</kbd> disables C++ exception handling.</p>
    ]]>
</flag>

<flag name="aocc-flto"
    class="optimization"
    regexp="-flto(?=\s|$)"
    >
    <example>-flto</example>
    <![CDATA[
    <p>Generate output files in LLVM formats suitable for link time optimization. When used with <kbd>-S</kbd> this generates
        LLVM intermediate language assembly files, otherwise this generates LLVM bitcode format object files (which may be
        passed to the linker depending on the stage selection options).</p>
    ]]>
</flag>

<flag name="F-m32"
    class="optimization"
    >
    <example>-m32</example>
    <![CDATA[
    <p>Generate code for a 32-bit environment. The 32-bit environment sets <kbd>int</kbd>, <kbd>long</kbd> and
        <kbd>pointer</kbd> to 32 bits and generates code that runs on any i386 system.  The compiler generates x86 or IA32
        32-bit ABI. The default on a 32-bit host is 32-bit ABI.  The default on a 64-bit host is 64-bit ABI if the target
        platform specified is 64-bit, otherwise the default is 32-bit.</p>
    ]]>
</flag>

<flag name="F-m64"
    class="optimization"
    >
    <example>-m64</example>
    <![CDATA[
    <p>Generate code for a 64-bit environment. The 64-bit environment sets <kbd>int</kbd> to 32 bits and <kbd>long</kbd> and
        <kbd>pointer</kbd> to 64 bits and generates code for AMD's x86-64 architecture. The compiler generates AMD64, INTEL64,
        x86-64 64-bit ABI. The default on a 32-bit host is 32-bit ABI. The default on a 64-bit host is 64-bit ABI if the target
        platform specified is 64-bit, otherwise the default is 32-bit.</p>
    ]]>
</flag>

<flag name="F-frepack-arrays"
    class="optimization"
    >
    <example>-frepack-arrays</example>
    <![CDATA[
    <p>In some circumstances GNU Fortran may pass assumed shape array sections via a descriptor describing a noncontiguous area of
        memory. This option adds code to the function prologue to repack the data into a contiguous block at runtime.</p>

    <p>This should result in faster accesses to the array. However it can introduce significant overhead to the function call,
        especially when the passed data is noncontiguous.</p>
    ]]>
</flag>

<flag name="F-fuse-ld:lld"
    class="optimization"
    >
    <example>-fuse-ld=lld</example>
    <![CDATA[
    <p>Instructs the compiler to use the LLVM linker and loader (<kbd>lld</kbd>) instead of the system linker when linking
        object files.</p>
    ]]>
</flag>

<flag name="F-fuse-ld:gold"
    class="optimization"
    >
    <example>-fuse-ld=gold</example>
    <![CDATA[
    <p>Instructs the compiler to use the GNU gold linker (<kbd>gold</kbd>) instead of the system linker when linking object
        files.</p>
    ]]>
</flag>

<flag name="F-fno-stack-arrays"
    class="optimization"
    >
    <example>-fno-stack-arrays</example>
    <![CDATA[
    <p>Instructs the compiler not to allocate arrays from the stack and instead use heap memory.</p>
    ]]>
</flag>

<flag name="F-freciprocal-math"
    class="optimization"
    >
    <example>-freciprocal-math</example>
    <![CDATA[
    <p>Given the expression "a = b / c", instructs the compiler to calculate "a = b * (1/c)".</p>
    ]]>
</flag>

<flag name="aocc-ffast-math"
    class="optimization"
    regexp="-ffast-math(?=\s|$)"
    >
    <example>-ffast-math</example>
    <![CDATA[
    <p>Enables a range of optimizations that provide faster, though sometimes less precise, mathematical operations that may
        not conform to the IEEE-754 specifications. When this option is specified, the <kbd>__STDC_IEC_559__</kbd> macro is
        ignored even if set by the system headers.</p>
    ]]>
</flag>

<flag name="F-ffp-contract:fast"
    class="optimization"
    >
    <![CDATA[
    <p>This option enables floating-point expression contraction such as forming of fused multiply-add operations if the target
        has native support for them.</p>
    ]]>
</flag>

<flag name="plugin-DragonEgg"
    class="optimization"
    regexp="-fplugin=(\S*/)?dragonegg.so(?=\s|$)"
    >
    <example>-fplugin=dragonegg.so</example>
    <![CDATA[
    <p>Load compiler plugin code from the <kbd>dragonegg.so</kbd> file.</p>
    ]]>
</flag>

<flag name="aocc-specs"
    class="optimization"
    regexp="-specs=(\S*/)?integrated-as.specs(?=\s|$)"
    >
    <example>-specs=integrated-as.specs</example>
    <![CDATA[
    <p>The DragonEgg plugin generates LLVM intermediate representation for link-time optimization which must be 
       passed to the LLVM assembler. <kbd>integrated-as.specs</kbd> tells the compiler to use the LLVM integrated
       assembler rather than the system assembler.</p>
    ]]>
</flag>

<flag name="F-lm"
    class="optimization"
    >
    <example>-lm</example>
    <![CDATA[
    <p>Instructs the compiler to link with system math libraries.</p>
    ]]>
</flag>

<flag name="F-lamdlibm"
    class="optimization"
    >
    <example>-lamdlibm</example>
    <![CDATA[
    <p>Instructs the compiler to link with AMD-supported optimized math library.</p>
    ]]>
</flag>

<flag name="F-lpthread"
    class="optimization"
    >
    <![CDATA[
    <p>This option instructs the linker to link the executable with the pthread library.</p>
    ]]>
</flag>

<flag name="F-ldl"
    class="optimization"
    >
    <![CDATA[
    <p>This option instructs the linker to link the executable with libdl, the interface to the dynamic loader.</p>
    ]]>
</flag>

<flag name="aocc-muldefs"
    class="optimization"
    regexp="-z\s+muldefs(?=\s|$)"
    >
    <example>-z muldefs</example>
    <![CDATA[
    <p>Instructs the linker to use the first definition encountered for a symbol, and ignore all others.</p>
    ]]>
</flag>

<flag name="jemalloc-lib"
    class="optimization"
    regexp="-ljemalloc(?=\s|$)"
    >
    <example>-ljemalloc</example>
    <![CDATA[
    <p>Use the <a href="http://jemalloc.net/">jemalloc</a> library, which is a general purpose <kbd>malloc(3)</kbd>
        implementation that emphasizes fragmentation avoidance and scalable concurrency support.</p>
    ]]>
</flag>

<flag name="F-lsmartheap"
    class="optimization"
    >
    <![CDATA[
    <p>Use the <a href="http://www.microquill.com/smartheap/">SmartHeap</a> library, which is a fast, portable, reliable,
        ANSI-compliant malloc/operator new library. </p>
    ]]>
</flag>

<flag name="F-lomp"
    class="optimization"
    >
    <example>-lomp</example>
    <![CDATA[
    <p>Instructs the compiler to link with the OpenMP runtime libraries.</p>
    ]]>
</flag>

<flag name="F-lgfortran"
    class="optimization"
    >
    <example>-lgfortran</example>
    <![CDATA[
    <p>Instructs the compiler to link with the gfortran Fortran runtime libraries.</p>
    ]]>
</flag>

<flag name="F-lflang"
    class="optimization"
    >
    <example>-lflang</example>
    <![CDATA[
    <p>Instructs the compiler to link with flang Fortran runtime libraries.</p>
    ]]>
</flag>

<flag name="F-branch-combine"
    class="optimization"
    >
    <![CDATA[
    <p>The option combines compare/test instructions with branches wherever possible.</p>
    ]]>
</flag>

<flag name="F-disable-indvar-simplify"
    class="optimization"
    regexp="(?:-fplugin-arg-dragonegg-llvm-option=)?-disable-indvar-simplify(?=\s|$)">
    >
    <![CDATA[
    <p>The induction variable simplification optimization transforms induction variables to simpler forms. The option disables
        this optimization.</p>
    ]]>
</flag>

<flag name="F-fdefault-integer-8"
    class="optimization"
    >
    <![CDATA[
    <p>Sets the default integer and logical types to an 8 byte type. It does not promote variables with explicit
        <kbd>KIND</kbd> declarations.</p>
    ]]>
</flag>

<flag name="F-enable-gvn-hoist"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-enable-gvn-hoist(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-enable-gvn-hoist" or "-fplugin-arg-dragonegg-llvm-option=-enable-gvn-hoist"</example>
    <![CDATA[
    <p>This option enables the GVN hoist pass, which is used to hoist computations from branches.</p>
    ]]>
</flag>

<flag name="dragonegg-llvm-inline-threshold"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-inline-threshold[:=]\d+(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-inline-threshold:1000" or "-fplugin-arg-dragonegg-llvm-option=-inline-threshold:1000"</example>
    <![CDATA[
    <p>Sets the compiler's inlining threshold level to the value passed. The inline threshold is used in the inliner heuristics to
        decide which functions should be inlined.</p>
    ]]>
</flag>

<flag name="F-dragonegg-llvm-enable-vectorize-compares"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-enable-vectorize-compares(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-enable-vectorize-compares" or "-fplugin-arg-dragonegg-llvm-option=-enable-vectorize-compares"</example>
    <![CDATA[
    <p>This option enables vectorization of loops with conditional breaks.  In some extreme situations this may result in
        unsafe behavior. Use this option only if it is safe to execute such loops even if conditional breaks are skipped or
        otherwise not executed.</p>
    ]]>
</flag>

<flag name="disable-vectorize-compares"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-enable-vectorize-compares[:=]false(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-enable-vectorize-compares:false" or "-fplugin-arg-dragonegg-llvm-option=-enable-vectorize-compares:false"</example>
    <![CDATA[
    <p>Certain loops with breaks may be vectorized by default at <kbd>-O2</kbd> and above. In some extreme situations this may
        result in unsafe behavior. Use this option to disable vectorization of such loops.</p>
    ]]>
</flag>

<flag name="F-enable-iv-split"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-enable-iv-split(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-enable-iv-split" or "-fplugin-arg-dragonegg-llvm-option=-enable-iv-split"</example>
    <![CDATA[
    <p>Enables splitting of long live ranges of loop induction variables which span loop boundaries.  This helps reduce
        register pressure and can help avoid needless spills to memory and reloads from memory.</p>
    ]]>
</flag>

<flag name="enable-partial-unswitch"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-enable-partial-unswitch(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-enable-partial-unswitch" or "-fplugin-arg-dragonegg-llvm-option=-enable-partial-unswitch"</example>
    <![CDATA[
    <p>This optimization does partial unswitching of loops where some part of the unswitched control flow remains in the
        loop.</p>
    ]]>
</flag>

<flag name="F-flv-function-specialization"
    class="optimization"
    >
    <![CDATA[
    <p>This option enables an optimization that generates and calls specialized function versions when the loops inside
        function are vectorizable and the arguments are not aliased with each other. This optimization helps in function
        inlining and vectorization.</p>
    ]]>
</flag>

<flag name="function-specialize"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-function-specialize(?=\s|$)"
    >
    <![CDATA[
    <p>This option enables an optimization that generates and calls specialized function versions when they are called with
        constant arguments.  This optimization helps in function inlining.</p>
    ]]>
</flag>

<flag name="F-fremap-arrays"
    class="optimization"
    >
    <![CDATA[
    <p>This option enables an optimization that transforms the data layout of a single dimensional array to provide better
        cache locality by analyzing the access patterns.</p>
    ]]>
</flag>

<flag name="struct-layout"
    class="optimization"
    regexp="-fstruct-layout=\d+(?=\s|$)"
    >
    <example>-fstruct-layout=3</example>
    <![CDATA[
    <p>This option enables transformation of the layout of arrays of structure types and their fields to improve the cache
        locality.  Aggressive analysis and transformations are performed at higher levels.  This option is effective only with
        <kbd>-flto</kbd> as whole program analysis is required to perform this optimization.</p>

    <p>Possible values:</p>
    <ul>
        <li>1: Use when the allocated size of the array of structures is unknown at compile time.</li>
        <li>2: Use when the allocated size of the array of structures is known to fall within 64KB and 4GB.</li>
        <li>3: Use when the allocated size of the array of structures is known to be less than 64KB.</li>
    </ul>
    ]]>
</flag>

<flag name="F-fprofile-instr-generate"
    class="optimization"
    >
    <![CDATA[
    <p>Turns on LLVM's instrumentation based profiling.</p>
    ]]>
</flag>

<flag name="F-fprofile-instr-use"
    class="optimization"
    >
    <![CDATA[
    <p>Uses the profiling files generated from a program compiled with <kbd>-fprofile-instr-generate</kbd> to guide
        optimization decisions.</p>
    ]]>
</flag>

<flag name="F-gnu89-inline"
    class="optimization"
    >
    <example>-fgnu89-inline</example>
    <![CDATA[
    <p>In the <a href="https://www.spec.org/cpu2017/Docs/benchmarks/502.gcc_r.html">502/602.gcc</a> benchmark description,
        "multiple definitions of symbols" is listed under the "Known Portability Issues" section, and this option is one of the
        suggested workarounds.  This option causes Clang to revert to the same inlining behavior that GCC does when in pre-C99
        mode.</p>
    ]]>
</flag>

<flag name="F-finline-aggressive"
    class="optimization"
    >
    <![CDATA[
    <p>Sets the compiler's inlining heuristics to an aggressive level by increasing the inline thresholds.</p>
    ]]>
</flag>

<flag name="inline-threshold"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-inline-threshold[:=]\d+(?=\s|$)"
    >
   <example>-Wl,-mllvm -Wl,-inline-threshold=99</example>
    <![CDATA[
    <p>Sets the compiler's inlining threshold level to the value passed as the argument.  The inline threshold is used in the
        inliner heuristics to decide which functions should be inlined.</p>
    ]]>
</flag>

<flag name="inline-recursion"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-inline-recursion[:=]\d+(?=\s|$)"
    >
    <example>-Wl,-mllvm -Wl,-inline-recursion=4</example>
    <![CDATA[
    <p>Enables inlining for recursive functions based on heuristics, with level 4 being most aggressive. Higher levels may lead
        to code bloat due to expansion of recursive functions at call sites.</p>

    <p>Levels:</p>
    <ul>
        <li>0 [DEFAULT]: Disables inlining for recursive functions.</li>
        <li>1: Enables inlining for recursive functions using heuristics with inline depth 1.</li>
        <li>2: Same as level 1 but with more aggressive heuristics.</li>
        <li>3: Enables inlining for all recursive functions with inline depth 1.</li>
        <li>4: Enables inlining for all recursive function with inline depth 10.</li>
    </ul>
    ]]>
</flag>

<flag name="F-loop-unswitch-aggressive"
    class="optimization"
    >
    <![CDATA[
    <p>This option enables aggressive loop unswitching heuristic based on usage of branch conditions.</p>
    ]]>
</flag>

<flag name="lsr-in-nested-loop"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-lsr-in-nested-loop(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-lsr-in-nested-loop" or "-fplugin-arg-dragonegg-llvm-option=-lsr-in-nested-loop"</example>
    <![CDATA[
    <p>Enables loop strength reduction for nested loop structures.  By default, the compiler will do loop strength reduction
        only for the innermost loop.</p>
    ]]>
</flag>

<flag name="F-merge-constant"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-merge-constant(?=\s|$)"
    >
    <example>"-Wl,-mllvm -Wl,-merge-constant" or "-fplugin-arg-dragonegg-llvm-option=-merge-constant"</example>
    <![CDATA[
    <p>This optimization merges duplicate constant uses into a register to reduce instruction width.</p>
    ]]>
</flag>

<flag name="F-mavx2"
    class="optimization"
    >
    <![CDATA[
    <p>This option enables AVX2 (Advanced Vector Extensions, 2nd generation) support.</p>
    ]]>
</flag>

<flag name="F-mno-avx2"
    class="optimization"
    >
    <![CDATA[
    <p>This option restricts the optimization and code generation to first-generation AVX instructions.</p>
    ]]>
</flag>

<flag name="F-madx"
    class="optimization"
    >
    <![CDATA[
    <p>This option enables generation of the adx instruction.</p>
    ]]>
</flag>

<flag name="F-mno-adx"
    class="optimization"
    >
    <![CDATA[
    <p>This option disables generation of the adx instruction.</p>
    ]]>
</flag>

<flag name="F-msse4a"
    class="optimization"
    >
    <![CDATA[
    <p>This option enables the generation of SSE4a instructions.</p>
    ]]>
</flag>

<flag name="F-mno-sse4a"
    class="optimization"
    >
    <![CDATA[
    <p>This option disables the generation of SSE4a instructions.</p>
    ]]>
</flag>

<flag name="unroll-threshold"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-unroll-threshold[:=]\d+(?=\s|$)"
    >
    <example>"-mllvm -unroll-threshold=100" or "-fplugin-arg-dragonegg-llvm-option=-unroll-threshold:100"</example>
    <![CDATA[
    <p>Sets the limit at which loops will be unrolled.  For example, if unroll threshold is set to 100 then only loops with 100
        or fewer instructions will be unrolled.</p>
    ]]>
</flag>

<flag name="unroll-aggressive"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-unroll-aggressive(?=\s|$)"
    >
    <example>"-mllvm -unroll-aggressive" or "-fplugin-arg-dragonegg-llvm-option=-unroll-aggressive"</example>
    <![CDATA[
    <p>Enables aggressive heuristics to get loop unrolling.</p>
    ]]>
</flag>

<flag name="unroll-count"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-unroll-count=\d+(?=\s|$)"
    >
    <example>-mllvm -unroll-count=8</example>
    <![CDATA[
    <p>The unroll count can be specified explicitly with <kbd>-unroll_count=&lt;value&gt;</kbd> where &lt;value&gt; is a
        positive integer.  If this value is greater than the trip count, the loop will be fully unrolled.</p>
    ]]>
</flag>

<flag name="aocc-unroll-loops"
    class="optimization"
    regexp="-funroll-loops(?=\s|$)"
    >
    <example>-funroll-loops</example>
    <![CDATA[
    <p>This option instructs the compiler to unroll loops wherever possible.</p>
    ]]>
</flag>

<flag name="vectorize-memory-aggressively"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-vectorize-memory-aggressively(?=\s|$)"
    >
    <example>"-mllvm -vectorize-memory-aggressively" or "-fplugin-arg-dragonegg-llvm-option=-vectorize-memory-aggressively"</example>
    <![CDATA[
    <p>This option avoids runtime memory dependency checks to enable aggressive vectorization.</p>
    ]]>
</flag>

<flag name="no-vzeroupper"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-x86-use-vzeroupper[:=](?:0|false)(?=\s|$)"
    >
    <example>"-mllvm -x86-use-vzeroupper=false" or "-fplugin-arg-dragonegg-llvm-option=-x86-use-vzeroupper:false"</example>
    <![CDATA[
    <p>This option causes AOCC to not emit a vzeroupper instruction before a transfer of control flow, in order to minimize the
        AVX to SSE transition penalty.</p>
    ]]>
</flag>

<flag name="use-vzeroupper"
    class="optimization"
    regexp="(?:-mllvm\s+|-Wl,-mllvm\s+-Wl,|-Wl,-plugin-opt=|-fplugin-arg-dragonegg-llvm-option=)-x86-use-vzeroupper(?:[:=]\S+)?(?=\s|$)"
    >
    <example>"-mllvm -x86-use-vzeroupper" or "-fplugin-arg-dragonegg-llvm-option=-x86-use-vzeroupper:true"</example>
    <![CDATA[
    <p>This option causes AOCC to emit a vzeroupper instruction before a transfer of control flow.</p>
    ]]>
</flag>

<flag name="std-c"
    class="optimization"
    regexp="-std=(?:c|gnu)(?:89|99|11|17)(?=\s|$)"
    >
    <example>-std=gnu89</example>
    <![CDATA[
    <p>Selects the C language dialect.</p>
    ]]>
</flag>

<flag name="std-cpp"
   class="optimization"
   regexp="-std=c\+\+(?:98|03|11|14|17|2a)(?=\s|$)"
   >
   <example>-std=c++98</example>
   <![CDATA[
   <p>Selects the C++ language dialect.</p>
   ]]>
</flag>


<!-- Portability flags ======================================================================================================== -->

<flag name="F-fconvert"
    class="portability"
    regexp="-fconvert=big-endian(?=\s|$)"
    >
    <example>-fconvert=big-endian</example>
    <![CDATA[
    <p>The binary datasets for some of the Fortran benchmarks in the SPEC CPU suites are stored in big-endian format.  This
        option is necessary for those datasets to be read in correctly.</p>
    ]]>
</flag>

<flag name="F-D_FILE_OFFSET_BITS"
    class="portability"
    regexp="-D_FILE_OFFSET_BITS=\d+(?=\s|$)"
    >
    <![CDATA[
    <p>Specifies size of <kbd>off_t</kbd> data type.</p>
    ]]>
</flag>


<!-- Flags that identify the compiler being used ============================================================================== -->

<flag name="compiler_path_eater"
    class="compiler"
    regexp="/\S+/(CC|g(cc|\+\+)|c(c|\+\+)|FC|gfortran|clang(\+\+)?|flang|f90)(?=\s|$)"
    >
    <example>/path/to/{clang|clang++|flang|gfortran}</example>
    This flag is just to trim the path from the compiler line.
    <include text="$1"/>
    <display enable="0"/>
</flag>

<flag name="clang-c"
    class="compiler"
    regexp="\bclang(?=\s|$)"
    >
    <example>clang</example>
    <![CDATA[
    <p>clang is a C compiler which encompasses preprocessing, parsing, optimization, code generation, assembly, and linking.
        Depending on which high-level mode setting is passed, Clang will stop before doing a full link.</p>
    ]]>
</flag>

<flag name="clang-cpp"
    class="compiler"
    regexp="\bclang\+\+(?=\s|$)"
    >
    <example>clang++</example>
    <![CDATA[
    <p>clang++ C++ compiler which encompasses preprocessing, parsing, optimization, code generation, assembly, and linking.
        Depending on which high-level mode setting is passed, Clang will stop before doing a full link.</p>
    ]]>
</flag>

<flag name="flang"
    class="compiler"
    regexp="\bflang(?=\s|$)"
    >
    <example>flang</example>
    <![CDATA[
    <p>Flang is a Fortran compiler which encompasses parsing, optimization, code generation, assembly, and linking. Depending on
        which high-level mode setting is passed, Flang will stop before doing a full link.</p>
    ]]>
</flag>

<flag name="aocc-gfortran"
    class="compiler"
    regexp="\bgfortran(?=\s|$)"
    >
    <example>gfortran [optimization flags] -fplugin=path/dragonegg.so [plugin optimization flags]</example>
    <![CDATA[
    <p>Invoke the GNU Fortran compiler with the optimizers and code generators replaced by those from AOCC.  The "dragonegg.so"
        referenced here is the "AOCC Fortran Plugin".</p>
    ]]>
</flag>


<!-- "Other" flags ============================================================================================================ -->

<flag name="Link_path"
    class="other"
    regexp="-L\s*\S+(?=\s|$)"
    >
    <example>-L/path/to/libs</example>
    <![CDATA[
    <p>Specifies a directory to search for libraries. Use <kbd>-L</kbd> to add directories to the search path for library
        files.  Multiple <kbd>-L</kbd> options are valid. However, the position of multiple <kbd>-L</kbd> options is important
        relative to <kbd>-l</kbd> options supplied.</p>
    ]]>
</flag>

<flag name="Include_path"
    class="other"
    regexp="-I\s*\S+(?=\s|$)"
    >
    <example>-I /path/to/include</example>
    <![CDATA[
    <p>Specifies a directory to search for include files. Use <kbd>-I</kbd> to add directories to the search path for include
        files.  Multiple <kbd>-I</kbd> options are valid.</p>
    ]]>
</flag>

<flag name="F-DUSE_OPENMP"
    class="other"
    >
    <example>-DUSE_OPENMP</example>
    <![CDATA[
    <p>Switch to enable OpenMP.</p>
    ]]>
</flag>


<!-- vim: set ai filetype=xml syntax=xml expandtab nosmarttab ts=8 sw=4 colorcolumn=132: -->
</flagsdescription>
