[llvm-dev] optimization remarks
Hal Finkel via llvm-dev
llvm-dev at lists.llvm.org
Wed Aug 15 09:14:17 PDT 2018
On 08/15/2018 09:28 AM, Jonas Paulsson via llvm-dev wrote:
>
>
> Hi Eli,
>
> On 2018-08-14 20:03, Friedman, Eli wrote:
>> On 8/14/2018 6:57 AM, Jonas Paulsson via llvm-dev wrote:
>>> Hi,
>>>
>>> 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...
>>>
>>> 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 :-/
>>>
>>> I wonder if there is a reason for this, or if it's something that
>>> could be fixed?
>>>
>>
>> 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.
>>
>
> 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?
I don't think so. I ran into this a couple of weeks ago myself, and then
forgot to file a bug report.
-Hal
>
>
> "/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 -###
> clang version 8.0.0 (https://git.llvm.org/git/clang.git/
> 731b1c80ca380ee4d0e68704f8185bb523ce7b23)
> (https://git.llvm.org/git/llvm.git/
> a3a6a7d1b9744ce5ad40394792adc25e63bc9904)
> Target: s390x-ibm-linux
> Thread model: posix
> InstalledDir: /home/ijonpan/llvm/build/llvm-dev-2/bin
> "/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" *"-Rpass=loop-vectorize"* "-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"
> "/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" *"-Rpass=loop-vectorize"* "-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"
> "/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" *"-Rpass=loop-vectorize"* "-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"
> "/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"
>
>
>
> "/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
> toke.c:1483:4: remark: vectorized loop (vectorization width: 4,
> interleaved count: 1) [-Rpass=loop-vectorize]
> for (c = (U8 *) SvPVX(sv); c < (U8 *)d; c++) {
> ^
> toke.c:1291:7: remark: vectorized loop (vectorization width: 16,
> interleaved count: 1) [-Rpass=loop-vectorize]
> for (i = min; i <= max; i++)
> ^
> toke.c:1345:3: remark: vectorized loop (vectorization width: 16,
> interleaved count: 1) [-Rpass=loop-vectorize]
> while (s < regparse)
>
>
>
> "/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
> (no output)
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180815/9d3a68f6/attachment-0001.html>
More information about the llvm-dev
mailing list