<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 08/15/2018 09:28 AM, Jonas Paulsson
      via llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:388b9f97-9038-e0e5-e464-c129907b9602@linux.vnet.ibm.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p><br>
      </p>
      Hi Eli,<br>
      <br>
      <div class="moz-cite-prefix">On 2018-08-14 20:03, Friedman, Eli
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:81bc4b4e-3a90-01b4-c736-3abe51dd4dc4@codeaurora.org">On
        8/14/2018 6:57 AM, Jonas Paulsson via llvm-dev wrote: <br>
        <blockquote type="cite">Hi, <br>
          <br>
          I am trying to compare the loop vectorizers effectiveness for
          different targets relative to each other. That way, I am
          hoping to find loops that are not vectorized - but could be -
          on my target by finding other targets doing this successfully.
          With some luck, there might be something in the Target files
          that could be fixed with improved vectorization as a result...
          <br>
          <br>
          I would like to do this with the optimization remarks enabled:
          -Rpass=loop-vectorize, etc. Since cross-compiling benchmarks
          seems tricky to me at the moment, my idea was to first run the
          front end, and then run the optimizers for different targets.
          However, when I pass -save-temps to clang there are no remarks
          emitted at all any more... So in effect I can only get the
          remarks for the target I am on :-/ <br>
          <br>
          I wonder if there is a reason for this, or if it's something
          that could be fixed? <br>
          <br>
        </blockquote>
        <br>
        I think it's just a bug; if you pass -### to clang, you can see
        how -save-temps actually invokes clang four times, and -Rpass
        only gets passed to the first invocation. <br>
        <br>
      </blockquote>
      <br>
      Strange - I see -Rpass in all the invocations... It just doesn't
      seem to have any effect with -save-temps... Am I doing something
      wrong?<br>
    </blockquote>
    <br>
    I don't think so. I ran into this a couple of weeks ago myself, and
    then forgot to file a bug report.<br>
    <br>
     -Hal<br>
    <br>
    <blockquote type="cite"
      cite="mid:388b9f97-9038-e0e5-e464-c129907b9602@linux.vnet.ibm.com">
      <br>
      <br>
      <tt>"/home/ijonpan/llvm/build/llvm-dev-2/bin/clang" -c -o toke.o
        -DSPEC_CPU -DNDEBUG -DPERL_CORE   -O3 -march=z14      -DSPEC_CPU
        -DNDEBUG -DPERL_CORE -DSPEC_CPU_LINUX -DSPEC_CPU_BIGENDIAN
        -D_GNU_SOURCE -DSPEC_CPU_LP64 -fno-strict-aliasing
        -std=gnu90        toke.c -Rpass=loop-vectorize -save-temps  -###
      </tt><tt><br>
      </tt><tt>clang version 8.0.0 (<a class="moz-txt-link-freetext"
          href="https://git.llvm.org/git/clang.git/"
          moz-do-not-send="true">https://git.llvm.org/git/clang.git/</a>
        731b1c80ca380ee4d0e68704f8185bb523ce7b23) (<a
          class="moz-txt-link-freetext"
          href="https://git.llvm.org/git/llvm.git/"
          moz-do-not-send="true">https://git.llvm.org/git/llvm.git/</a>
        a3a6a7d1b9744ce5ad40394792adc25e63bc9904)</tt><tt><br>
      </tt><tt>Target: s390x-ibm-linux</tt><tt><br>
      </tt><tt>Thread model: posix</tt><tt><br>
      </tt><tt>InstalledDir: /home/ijonpan/llvm/build/llvm-dev-2/bin</tt><tt><br>
      </tt><tt> "/home/ijonpan/llvm/build/llvm-dev-2/bin/clang-8" "-cc1"
        "-triple" "s390x-ibm-linux" "-E" "-save-temps=cwd"
        "-disable-free" "-main-file-name" "toke.c" "-mrelocation-model"
        "static" "-mthread-model" "posix" "-relaxed-aliasing"
        "-fmath-errno" "-masm-verbose" "-mconstructor-aliases"
        "-fuse-init-array" "-target-cpu" "z14" "-dwarf-column-info"
        "-debugger-tuning=gdb" "-momit-leaf-frame-pointer"
        "-coverage-notes-file"
        "/home/ijonpan/minispec-2006/spec-llvm/400.perlbench/build/toke.gcno"
        "-resource-dir"
        "/home/ijonpan/llvm/build/llvm-dev-2/lib/clang/8.0.0" "-D"
        "SPEC_CPU" "-D" "NDEBUG" "-D" "PERL_CORE" "-D" "SPEC_CPU" "-D"
        "NDEBUG" "-D" "PERL_CORE" "-D" "SPEC_CPU_LINUX" "-D"
        "SPEC_CPU_BIGENDIAN" "-D" "_GNU_SOURCE" "-D" "SPEC_CPU_LP64"
        "-internal-isystem" "/usr/local/include" "-internal-isystem"
        "/home/ijonpan/llvm/build/llvm-dev-2/lib/clang/8.0.0/include"
        "-internal-externc-isystem" "/include"
        "-internal-externc-isystem" "/usr/include" "-O3" <b>"-Rpass=loop-vectorize"</b>
        "-std=gnu90" "-fdebug-compilation-dir"
        "/home/ijonpan/minispec-2006/spec-llvm/400.perlbench/build"
        "-ferror-limit" "19" "-fmessage-length" "225" "-fno-signed-char"
        "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
        "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-o"
        "toke.i" "-x" "c" "toke.c" "-faddrsig"</tt><tt><br>
      </tt><tt> "/home/ijonpan/llvm/build/llvm-dev-2/bin/clang-8" "-cc1"
        "-triple" "s390x-ibm-linux" "-emit-llvm-bc"
        "-emit-llvm-uselists" "-save-temps=cwd" "-disable-free"
        "-main-file-name" "toke.c" "-mrelocation-model" "static"
        "-mthread-model" "posix" "-relaxed-aliasing" "-fmath-errno"
        "-masm-verbose" "-mconstructor-aliases" "-fuse-init-array"
        "-target-cpu" "z14" "-dwarf-column-info" "-debugger-tuning=gdb"
        "-momit-leaf-frame-pointer" "-coverage-notes-file"
        "/home/ijonpan/minispec-2006/spec-llvm/400.perlbench/build/toke.gcno"
        "-resource-dir"
        "/home/ijonpan/llvm/build/llvm-dev-2/lib/clang/8.0.0" "-O3" <b>"-Rpass=loop-vectorize"</b>
        "-std=gnu90" "-fdebug-compilation-dir"
        "/home/ijonpan/minispec-2006/spec-llvm/400.perlbench/build"
        "-ferror-limit" "19" "-fmessage-length" "225" "-fno-signed-char"
        "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
        "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp"
        "-disable-llvm-passes" "-o" "toke.bc" "-x" "cpp-output" "toke.i"
        "-faddrsig"</tt><tt><br>
      </tt><tt> "/home/ijonpan/llvm/build/llvm-dev-2/bin/clang-8" "-cc1"
        "-triple" "s390x-ibm-linux" "-S" "-save-temps=cwd"
        "-disable-free" "-main-file-name" "toke.c" "-mrelocation-model"
        "static" "-mthread-model" "posix" "-relaxed-aliasing"
        "-fmath-errno" "-masm-verbose" "-mconstructor-aliases"
        "-fuse-init-array" "-target-cpu" "z14" "-dwarf-column-info"
        "-debugger-tuning=gdb" "-momit-leaf-frame-pointer"
        "-coverage-notes-file"
        "/home/ijonpan/minispec-2006/spec-llvm/400.perlbench/build/toke.gcno"
        "-resource-dir"
        "/home/ijonpan/llvm/build/llvm-dev-2/lib/clang/8.0.0" "-O3" <b>"-Rpass=loop-vectorize"</b>
        "-std=gnu90" "-fdebug-compilation-dir"
        "/home/ijonpan/minispec-2006/spec-llvm/400.perlbench/build"
        "-ferror-limit" "19" "-fmessage-length" "225" "-fno-signed-char"
        "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
        "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-o"
        "toke.s" "-x" "ir" "toke.bc" "-faddrsig"</tt><tt><br>
      </tt><tt> "/home/ijonpan/llvm/build/llvm-dev-2/bin/clang-8"
        "-cc1as" "-triple" "s390x-ibm-linux" "-filetype" "obj"
        "-main-file-name" "toke.c" "-target-cpu" "z14"
        "-dwarf-version=4" "-mrelocation-model" "static" "-o" "toke.o"
        "toke.s"</tt><tt><br>
      </tt><br>
      <tt><br>
        <br>
      </tt><tt>"/home/ijonpan/llvm/build/llvm-dev-2/bin/clang" -c -o
        toke.o -DSPEC_CPU -DNDEBUG -DPERL_CORE   -O3 -march=z14     
        -DSPEC_CPU -DNDEBUG -DPERL_CORE -DSPEC_CPU_LINUX
        -DSPEC_CPU_BIGENDIAN -D_GNU_SOURCE -DSPEC_CPU_LP64
        -fno-strict-aliasing -std=gnu90        toke.c
        -Rpass=loop-vectorize </tt><tt><br>
      </tt><tt>toke.c:1483:4: remark: vectorized loop (vectorization
        width: 4, interleaved count: 1) [-Rpass=loop-vectorize]</tt><tt><br>
      </tt><tt>                        for (c = (U8 *) SvPVX(sv); c <
        (U8 *)d; c++) {</tt><tt><br>
      </tt><tt>                        ^</tt><tt><br>
      </tt><tt>toke.c:1291:7: remark: vectorized loop (vectorization
        width: 16, interleaved count: 1) [-Rpass=loop-vectorize]</tt><tt><br>
      </tt><tt>                    for (i = min; i <= max; i++)</tt><tt><br>
      </tt><tt>                    ^</tt><tt><br>
      </tt><tt>toke.c:1345:3: remark: vectorized loop (vectorization
        width: 16, interleaved count: 1) [-Rpass=loop-vectorize]</tt><tt><br>
      </tt><tt>                while (s < regparse)</tt><tt><br>
      </tt><tt><br>
        <br>
      </tt><tt><br>
      </tt><tt>"/home/ijonpan/llvm/build/llvm-dev-2/bin/clang" -c -o
        toke.o -DSPEC_CPU -DNDEBUG -DPERL_CORE   -O3 -march=z14     
        -DSPEC_CPU -DNDEBUG -DPERL_CORE -DSPEC_CPU_LINUX
        -DSPEC_CPU_BIGENDIAN -D_GNU_SOURCE -DSPEC_CPU_LP64
        -fno-strict-aliasing -std=gnu90        toke.c
        -Rpass=loop-vectorize  -save-temps</tt><tt><br>
      </tt><tt>(no output)</tt><br>
      <br>
      <br>
      <!--'"--><br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </body>
</html>