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

<flagsdescription>
   <filename>aocc100-flags-revC-I</filename>
   <title>AMD Optimizing C/C++ Compiler Suite SPEC CPU2017 Flag Description</title>

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


<!-- SUBMIT COMMAND -->

   <submit_command>
      <![CDATA[
<p><b>Using numactl 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 effect 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 'numactl' to be the best choice.</p>
<p>numactl 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 numactl flag "--physcpubind" specifies which core(s) to bind the process. "-l" instructs numactl to keep a process memory on the local node while "-m" specifies which node(s) to place a process memory.  For full details on using numactl, please refer to your Linux documentation, 'man numactl'</p>
<p>Note that some versions of numactl, particularly the version found on SLES 10, we have found that the utility incorrectly interprets application arguments as it's own.  For example, with the command "numactl --physcpubind=0 -l a.out -m a", numactl will interpret a.out's "-m" option as it's own "-m" option.  To work around this problem, a user can put the command to be run in a shell script and then run the shell script using numactl.  For example: "echo 'a.out -m a' > run.sh ; numactl --physcpubind=0 bash run.sh"</p>
      ]]>
   </submit_command>

<!-- /SUBMIT COMMAND -->

<!-- S/W ENVIRONMENT -->

   <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 and manually set the Huge Pages you can follow the below steps:
</p>
<ul>
      <li>Create a mount point for the huge pages: "mkdir /mnt/hugepages"</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: "mount -t hugetlbfs nodev /mnt/hugepages"</li>
      <li>Set vm/nr_hugepages=N in your /etc/sysctl.conf file 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 your Linux documentation file: /usr/src/linux/Documentation/vm/hugetlbpage.txt</p>

<p><b> ulimit -s &lt;n&gt;</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> ulimit -l &lt;n&gt;</b></p>
<p>
           Sets the maximum size of memory that may be locked into physical memory.
</p>
<p><b>OMP_NUM_THREADS</b></p>
<p>
           Sets the maximum number of OpenMP parallel threads applications based on OpenMP may use.
</p>
<p><b>powersave -f (on SuSE)</b></p>
<p>
           Makes the powersave daemon set the CPUs to the highest supported frequency.
</p>
<p><b>/etc/init.d/cpuspeed stop (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>LD_LIBRARY_PATH</b></p>
<p>
           An environment variable set to include the LLVM, JEMalloc and SmartHeap libraries used during compilation of the binaries.  This environment variable setting is not needed when building the binaries on the system under test.
</p>
<p><b>kernel/randomize_va_space</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.<br />

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

*** 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 CONFIG_COMPAT_BRK option is enabled.<br />

*** 2 - Additionally enable heap randomization.  This is the default if CONFIG_COMPAT_BRK is disabled.<br />
</p>
<p><b>MALLOC_CONF</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>

<!-- /S/W ENVIRONMENT -->

<!-- HEADERs -->

   <header>
      <![CDATA[
         <h2>Compilers: AOCC Suite </h2>
      ]]>
   </header>

<!-- /HEADERs -->

<!-- OPTIMIZATION -->

   <flag name="F-D_FILE_OFFSET_BITS" 
         class="optimization" 
         regexp="-D_FILE_OFFSET_BITS=\d+" >
         <![CDATA[
            <p>Specifies size of off_t data type.</p>
         ]]>
   </flag>

   <flag name="F-O0" class="optimization" regexp="-O0">
      <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. Level 2 is assumed if no value is specified
         (i.e. "-O". The default is "-O2".</p>
      ]]>
      <include flag="F-O0" />
   </flag>

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

          <p>If multiple "O" options are used, with or without level numbers, the last such
          option is the one that is effective. Level 2 is assumed if no value is specified
          (i.e. "-O". The default is "-O2".</p>
       ]]>
    </flag>

    <flag name="F-O2" class="optimization" regexp="-O2">
       <example>-O2</example>
       <![CDATA[
          <p>Moderate level of optimization which enables most optimizations.</p>

          <p>If multiple "O" options are used, with or without level numbers, the last such
          option is the one that is effective. Level 2 is assumed if no value is specified
          (i.e. "-O". The default is "-O2".</p>
       ]]>
    <include flag="F-O1" />
    </flag>

    <flag name="F-O3" class="optimization" regexp="-O3">
       <example>-O3</example>
       <![CDATA[
          <p> Like -O2, 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. Level 2 is assumed if no value is specified
          (i.e. "-O". The default is "-O2".</p>
       ]]>
    <include flag="F-O2" />
    </flag>

   <flag name="F-Os" class="optimization" regexp="-Os">
       <example>-Os</example>
       <![CDATA[
          <p>Like -O2 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. Level 2 is assumed if no value is specified
          (i.e. "-O". The default is "-O2").</p>
       ]]>
       <include flag="F-O2" />
   </flag>

   <flag name="F-Oz" class="optimization" regexp="-Oz">
      <example>-Oz</example>
      <![CDATA[
         <p>Like -Os (and thus -O2), 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. Level 2 is assumed if no value is specified
         (i.e. "-O". The default is "-O2").</p>
      ]]>
      <include flag="F-Os" />
   </flag>

   <flag name="F-O4" class="optimization" regexp="-O4">
         <example>-O4</example>
         <![CDATA[
            <p>Currently equivalent to -O3</p>

            <p>If multiple "O" options are used, with or without level numbers, the last such
            option is the one that is effective. Level 2 is assumed if no value is specified
            (i.e. "-O". The default is "-O2").</p>
         ]]>
         <include flag="F-O3" />
   </flag>
  <flag name="F-aocc-Ofast" class="optimization" regexp="-Ofast">
      <example>-Ofast</example>
      <![CDATA[
         <p>Enables all the optimizations from -O3 along with other aggressive optimizations that may violate strict compliance with language standards. AOCC user guide may be referred for detailed documentation of optimizations enabled under Ofast</p>
      ]]>
   </flag>
   <flag name="F-Odefault" class="optimization" regexp="-O[0-9]*">
      <example>-O</example>
      <![CDATA[
         <p>Set the optimization level to -O2.</p>

         <p>If multiple "O" options are used, with or without level numbers, the last such
         option is the one that is effective. Level 2 is assumed if no value is specified
         (i.e. The default is "-O2").</p>
      ]]>
      <include flag="F-O2" />
   </flag>

   <flag name="F-march" class="optimization"
         regexp="-march=(i486|x86-64|native|znver1|auto)">
         <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 -march=znver1, 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">
      <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.-fno-exceptions disables C++ exception handling. </p>
      ]]>
   </flag>

   <flag name="F-flto" class="optimization"
         regexp="-flto">
      <example>-flto</example>
      <![CDATA[
         <p>Generate output files in LLVM formats, suitable for link time optimization. When used with -S 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).<br />
          <br />
         <b>Note:</b> <br />
         -flto requires llvm to be build with gold-linker. The default binary releases of llvm from llvm.org do not have LLVMGold.so and so will not support -flto. To use -flto, you will have to<br />
                 Download, configure and build binutils for gold with plugin support.<br />
                 *** $ git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils<br />
                 *** $ mkdir build <br />
                 *** $ cd build <br />
                 *** $ ../binutils/configure --enable-gold --enable-plugins --disable-werror <br />
                 *** $ make all-gold <br />
                 <br />
                That should leave you with build/gold/ld-new which supports the -plugin option. Running make will additionally build build/binutils/ar and nm-new binaries supporting plugins.<br />
                <br />
                Build the LLVMgold plugin. Run CMake with -DLLVM_BINUTILS_INCDIR=/path/to/binutils/include. The correct include path will contain the file plugin-api.h.<br />
                Replace the existing binutils tools in /usr/bin with the newly built gold enabled binutils tools like ld, nm, ar. It is recommended that you use soft links to back up and replace existing ld, nm, ar with the gold enabled version.<br />
         </p>
      ]]>
   </flag>
   <flag name="F-m32" class="optimization"
            regexp="-m32">
         <example>-m32</example>
         <![CDATA[
            <p>Generate code for a 32-bit environment. The 32-bit environment sets
            int, long and pointer 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"
            regexp="-m64">
         <example>-m64</example>
         <![CDATA[
            <p>Generate code for a 64-bit environment. The 64-bit environment sets
            int to 32 bits and long and pointer 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-fno-stack-arrays" class="optimization" regexp="-fno-stack-arrays">
      <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" regexp="-freciprocal-math">
      <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="F-aocc-ffast-math"
        class="optimization"
        regexp="-ffast-math">
        <![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, __STDC_IEC_559__ macro is ignored even if set by the system headers  </p>
        ]]>
  </flag>
  <flag name="F-ffp-contract" class="optimization" regexp="-ffp-contract=fast">
      <example>-ffp-contract=fast</example>
      <![CDATA[
         <p> -ffp-contract=fast 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="F-fplugin" class="optimization" regexp="-fplugin=(\S*)*dragonegg.so">
      <example>-fplugin=dragonegg.so</example>
      <![CDATA[
         <p> Load the plugin code in file dragonegg.so, assumed to be a shared object to be dlopen'd by the compiler.  </p>
      ]]>
   </flag>
  <flag name="F-lm" class="optimization" regexp="-lm ">
      <example>-lm</example>
      <![CDATA[
         <p> Instructs the compiler to link with system math libraries </p>
      ]]>
   </flag>
  <flag name="F-lamdlibm" class="optimization" regexp="-lamdlibm ">
      <example>-lamdlibm</example>
      <![CDATA[
         <p> Instructs the compiler to link with AMD-supported math library </p>
      ]]>
   </flag>
  <flag name="F-z" class="optimization" regexp="-z muldefs">
      <example>-z muldefs</example>
      <![CDATA[
         <p> Instructs the linker to use the first definition encounterd.</p>
      ]]>
   </flag>
   <flag name="F-ljemalloc"
      class="optimization"
      >
      <![CDATA[
         <p>Use the jemalloc library, which is a general purpose malloc implementation that emphasizes fragmentation avoidance and scalable concurrency support. </p>
      ]]>
    </flag>
   <flag name="F-lsmartheap"
      class="optimization"
      >
      <![CDATA[
         <p>Use the smartheap library, which is a SmartHeap is a fast, portable, reliable, ANSI-compliant malloc/operator new library. </p>
      ]]>
    </flag>
  <flag name="F-lomp" class="optimization" regexp="-lomp">
      <example>-lomp</example>
      <![CDATA[
         <p> Instructs the compiler to link with  openmp libraries </p>
      ]]>
   </flag>
  <flag name="F-lgfortran" class="optimization" regexp="-lgfortran ">
      <example>-lgfortran</example>
      <![CDATA[
         <p> Instructs the compiler to link with gfortran libraries </p>
      ]]>
   </flag>

   <!-- End of description of flag groups -->

   <!-- End of description of optimization flags -->

   <flag name="F-fplugin-arg-dragonegg-llvm-option" 
         class="optimization" 
         regexp="-fplugin-arg-dragonegg-llvm-option=(\S+)">
         <example>-fplugin-arg-dragonegg-llvm-option="-merge-constant"</example>
         <![CDATA[
            <p>Passes the argument list following the flag to the DragonEgg gfortran plugin. Each argument must be enclosed in quotes.</p>
         ]]>
   </flag>

   <flag name="F-branch-combine" 
         class="optimization">
         <![CDATA[
            <p>The option combines compare/test instruction with branches wherever possible.</p>
         ]]>
   </flag>
   <flag name="F-phi-elim-preserve-cmpjmp-glue" 
         class="optimization"
         regexp="-phi-elim-preserve-cmpjmp-glue(\S+)">
         <![CDATA[
            <p>This option enables advanced branch combine optimizations across basic blocks.</p>
         ]]>
   </flag>
   <flag name="F-enable-iv-split" 
         class="optimization">
         <![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="F-lsr-in-nested-loop" 
         class="optimization">
         <![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-fdefault-integer-8"
         class="optimization">
         <![CDATA[
            <p>Set the default integer and logical types to an 8 byte type. It does not promote variables with explicit KIND declaration.</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="F-inline-threshold" 
         regexp="-inline-threshold=\d+"
         class="optimization">
         <![CDATA[
            <p>Sets the compiler's inlining threshold level to the value passed as argument. The inline threshold is used in the inliner heuristics to decide which function should be inlined</p>
         ]]>
   </flag>
   <flag name="F-dragonegg-llvm-inline-threshold" 
         regexp="-inline-threshold:\S+"
         class="optimization">
         <![CDATA[
            <p>Sets the compiler's inlining threshold level to the value passed as argument. The inline threshold is used in the inliner heuristics to decide which function should be inlined. Use the option -fplugin-arg-dragonegg-llvm-option="-inline-threshold:1000" to pass this option to LLVM backend through dragonegg </p>
         ]]>
   </flag>
   <flag name="F-dragonegg-llvm-disable-vect-cmp" 
         regexp="-disable-vect-cmp\S+"
         class="optimization">
         <![CDATA[
   <p> Certain loops with breaks maybe vectorized by default at O2 and above. In some extreme situations this may result in unsafe behavior. Use this option to disable vectorization of such loops.  Use the option -fplugin-arg-dragonegg-llvm-option="-disable-vect-cmp" to pass this option to LLVM backend through dragonegg. </p>
         ]]>
   </flag>
   <flag name="F-mavx2" 
         class="optimization">
         <![CDATA[
            <p>Enables AVX2 (Advanced Vector Extensions, 2nd generation) support.</p>
         ]]>
   </flag>
   <flag name="F-mno-avx2" 
         class="optimization">
         <![CDATA[
            <p>Restricts the optimization and code generation to first-generation AVX instructions.</p>
         ]]>
   </flag>
   <flag name="F-fremap-arrays"
         class="optimization">
         <![CDATA[
            <p>The optimization transforms the data layout of a single dimensional array to provide better cache locality by analysing the access patterns. </p>
         ]]>
   </flag>
   <flag name="F-disable-vect-cmp" class="optimization" regexp="-disable-vect-cmp">
   <![CDATA[
   <p> Certain loops with breaks maybe vectorized by default at O2 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-fstruct-layout" 
         class="optimization" 
         regexp="-fstruct-layout=\d+">
         <example>-fstruct-layout=3</example>
         <![CDATA[
         <p>This option transforms the layout of arrays of structure types and its fields to improve the cache locality. Possible values that can be specified are 1,2 and 3 Aggressive analysis and transformations are performed at higher level of transformations, with -fstruct-layout=3 being the most aggressive. Use -fstruct-layout=3 when you know the allocated size of array of structures fits within 64KB. Use the value of 2 when a similar size exceeds 64KB but does not exceed 4GB. The option is effective only under flto as the whole program analysis is required to perform this optimization. </p>
         ]]>
   </flag>
  <flag name="F-gnu89-inline" 
        class="optimization" 
        regexp="-fgnu89-inline">
      <example>-fgnu89-inline</example>
      <![CDATA[
         <p><b>CPU2017 suite GCC benchmark:</b></p>
         <p> LLVM Clang uses C99 standard by default. Need this portability flag since GCC benchmark in CPU2017 suite uses C89 standard.
         </p>
      ]]>
   </flag>
   <flag name="F-madx" 
         class="optimization">
         <![CDATA[
            <p>Enables the adcx instruction generation support.</p>
         ]]>
   </flag>
   <flag name="F-merge-constant" 
         class="optimization" 
         regexp="-merge-constant">
         <example>"-merge-constant"</example>
         <![CDATA[
            <p>The optimization merges duplicate constant uses into a register to reduce instruction width.</p>
         ]]>
   </flag>
   <flag name="F-mllvm" 
         class="optimization" 
         regexp="-mllvm">
         <example>-mllvm option-name</example>
         <![CDATA[
            <p>Passes the option-name through the compiler frontend to the optimizer.</p>
         ]]>
   </flag>

   <flag name="F-unroll-loops" 
         class="optimization" 
         regexp="-funroll-loops">
         <example>-unroll-count=8</example>
         <![CDATA[
            <p> Instructs the compiler to unroll the loops wherever possible. </p>
         ]]>
   </flag>
   <flag name="F-unroll-count" 
         class="optimization" 
         regexp="-unroll-count=\d+">
         <example>-unroll-count=8</example>
         <![CDATA[
            <p>The unroll count can be specified explicitly with -unroll_count=_value_ where _value_ is a positive integer. If this value is greater than the trip count, the loop will be fully unrolled.</p>
         ]]>
   </flag>
   <flag name="F-unroll-threshold" 
         class="optimization" 
         regexp="-unroll-threshold=\d+">
         <example>-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 less instructions will be unrolled.</p>
         ]]>
   </flag>
   <flag name="F-fprofile-instr-generate" 
         class="optimization"> 
         <![CDATA[
            <p>Turns on LLVM's (and Clang's) instrumenation based profiling.</p>
         ]]>
   </flag>
   <flag name="F-fprofile-instr-use" 
         class="optimization"> 
         <![CDATA[
            <p>Uses the profiling files generated from a program compiled with -fprofile-instr-generate.</p>
         ]]>
   </flag>
   <flag name="F-vectorize-memory-aggressively" 
         class="optimization"> 
         <![CDATA[
            <p>This option avoids runtime memory dependency checks to enable aggressive vectorization.</p>
         ]]>
   </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="F-Wl" 
      class="optimization"
      regexp="-Wl,(\S+)">
      <example>-Wl, -z,muldefs</example>
      <![CDATA[
         <p>-Wl tells the linker to accept the following argument. In the example, it tells the linker to allow multiple definitions.</p>
      ]]>
   </flag>
   <flag name="L-lib"
      regexp="-l(\S+)"
      class="optimization"
      >
      <example>-ljemalloc</example>
      <![CDATA[
         <p>Tells the linker to link in the specified library.</p>
      ]]>   </flag>
<!-- /OPTIMIZATION -->


<!-- /PORTABILITY -->
   <flag name="F-fconvert" class="portability" regexp="-fconvert=big-endian">
         <example>-fconvert=big-endian</example>
         <![CDATA[
            <p><b>CPU2017 suite WRF, POP2 benchmarks:</b></p>
            <p> x86 architecture is little-endian. Since these benchmarks are written keeping big-endian architecture in mind, this portability flag is required for the compiler to generate correct code.
            </p>
         ]]>
   </flag>
  <flag name="F-std" class="portability" regexp="-std=gnu89">
      <example>-std=gnu89</example>
      <![CDATA[
         <p><b>CPU2017 suite GCC benchmark:</b></p>
         <p> LLVM Clang uses C99 standard by default. Need this portability flag since GCC benchmark in CPU2017 suite uses C89 standard.
         </p>
      ]]>
   </flag>

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

   <flag name="Fclang3" class="compiler" regexp="(\S*)*clang[++]*">
      <example>clang</example>
      <![CDATA[
         <p>clang is a C, C++, and Objective-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>
         <br /><b>Usage:</b> clang [options] filename <br /><br />
     While Clang is highly integrated, it is important to understand the stages of compilation, to understand how to invoke it. <br />
     <br />
     These stages are:<br />
     <br />
    <b>Driver </b><br />
        <p>The clang executable is actually a small driver which controls the overall execution of other tools such as the compiler, assembler and linker. Typically you do not need to interact with the driver, but you transparently use it to run the other tools.</p>
    <b>Preprocessing </b><br />
        <p>This stage handles tokenization of the input source file, macro expansion, #include expansion and handling of other preprocessor directives. The output of this stage is typically called a .i (for C), .ii (for C++), .mi (for Objective-C), or .mii (for Objective-C++) file.</p>
    <br />
    <b>Parsing and Semantic Analysis</b><br />
        <p>This stage parses the input file, translating preprocessor tokens into a parse tree. Once in the form of a parse tree, it applies semantic analysis to compute types for expressions as well and determine whether the code is well formed. This stage is responsible for generating most of the compiler warnings as well as parse errors. The output of this stage is an Abstract Syntax Tree (AST).</p>
    <b>Code Generation and Optimization</b><br />
        <p>This stage translates an AST into low-level intermediate code (known as LLVM IR) and ultimately to machine code. This phase is responsible for optimizing the generated code and handling target-specific code generation. The output of this stage is typically called a .s file or assembly file.</p>

        <p>Clang also supports the use of an integrated assembler, in which the code generator produces object files directly. This avoids the overhead of generating the .s file and of calling the target assembler.</p>
    <b>Assembler</b><br />
        <p>This stage runs the target assembler to translate the output of the compiler into a target object file. The output of this stage is typically called a .o file or object file.</p>
    <b>Linker</b><br />
    <p>This stage runs the target linker to merge multiple object files into an executable or dynamic library. The output of this stage is typically called an a.out, .dylib or .so file.</p>
      ]]>
   </flag>

<flag name="Fgfortran" class="compiler" regexp="^gfortran">
      <example>gfortran [optimization flags] -fplugin=path/dragonegg.so [plugin optimization flags]</example>
      <![CDATA[
         <p>Invoke the LLVM Fortran compiler<br />
         DragonEgg is a gcc plugin that replaces GCC's optimizers and code generators with those from the LLVM project

         <br />To build and run Fortran programs:<br />
         <br />
        *** $ gfortran [optimization flags] -fplugin=path/dragonegg.so [plugin optimization flags] -c xyz.f90<br />
        *** $ clang -O3 -flto -lgfortran -o xyz xyz.o<br />
        *** $ ./xyz <br />
        <br />
        <b>optimization flags:</b><br />
            flags that GFortran frontend will use to generate the IR for DragonEgg plugin. It is recommend to use basic out-of-the-box flags (eg: -m64 -O2, preferably least GFortran optimization(-O0) <br />
        <br />  
        <b>plugin optimization flags:</b><br />
            Optimization flags DragonEgg plugin will use to generate the optimized LLVM IR and code generation. Here you can use higher optimization flags like -O3, -mavx etc if required.<br />
            <br />
          <b> Note:</b><br />
          * LLVM releases on llvm.org provides only sources releases.<br />
          * Latest release of DragonEgg sources is at http://llvm.org/releases/download.html#3.5.2 <br />
          * DragonEgg is a self contained plugin with llvm embedded within, so its recommended to use LLVM 3.5.2 sources when building DragonEgg.<br />
         </p>
      ]]>
   </flag>


<!-- /COMPILER -->

<!-- OTHER -->

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

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

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


<!-- /OTHER -->



</flagsdescription>
