<div dir="ltr">Alexey,<div>      This wouldn't be the first time that <font face="arial, sans-serif">Phoronix has gotten sloppy with using a common set of optimization flags in their gcc vs clang benchmarks. Although, it is getting harder to make direct comparisons. Clang now autovectorizes at -O2 while, as you can see from the my prior posting of the assembly from</font><span style="font-family:arial,sans-serif;font-size:13px">-fverbose-asm -O2, FSF gcc 4.9.0 doesn't.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">           Jack</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jun 4, 2014 at 10:32 PM, Alexey Bataev <span dir="ltr"><<a href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Jack,<br>
Actually everything is quite simple. Config files for Phoronix test suites are using gcc by default and -O2 is provided by default in this config files. I think they just compiled these tests by gcc with the default config (which already includes -O2) while for clang they had to specify some custom options (like "-fopenmp -lgomp", though the second one is not needed), but forget to add any optimization options.<br>

<br>
Best regards,<br>
Alexey Bataev<br>
=============<div class=""><br>
Software Engineer<br>
Intel Compiler Team<br>
<br></div>
04.06.2014 22:19, <a href="mailto:openmp-dev-request@cs.uiuc.edu" target="_blank">openmp-dev-request@cs.uiuc.edu</a> пишет:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Message: 4<br>
Date: Wed, 4 Jun 2014 14:19:49 -0400<br>
From: Jack Howarth<<a href="mailto:howarth.mailing.lists@gmail.com" target="_blank">howarth.mailing.lists@<u></u>gmail.com</a>><br>
To: Andrey Bokhanko<<a href="mailto:andreybokhanko@gmail.com" target="_blank">andreybokhanko@gmail.<u></u>com</a>><br>
Cc:"<a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.<u></u>engr.illinois.edu</a>"<br>
        <<a href="mailto:openmp-dev@dcs-maillist2.engr.illinois.edu" target="_blank">openmp-dev@dcs-maillist2.<u></u>engr.illinois.edu</a>><br>
Subject: Re: [Openmp-dev] Phoronix numbers for clang-omp compiler<br>
Message-ID:<br>
        <<a href="mailto:CADtEn-2YdnYNjg3bOcbGxJCJB87fdPyq1oAok4ZFoBTD33Y8Ag@mail.gmail.com" target="_blank">CADtEn-<u></u>2YdnYNjg3bOcbGxJCJB87fdPyq1oAo<u></u>k4ZFoBTD33Y8Ag@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<div class=""><br>
<br>
Andrey,<br>
      FSF gcc is not exactly defaulting to -O2 but certainly is higher than<br></div>
the default optimizations on clang?.<div><div class="h5"><br>
<br>
% touch t.cc<br>
% g++-fsf-4.9 -fverbose-asm t.cc -S<br>
% more t.s<br>
# GNU C++ (GCC) version 4.9.0 (x86_64-apple-darwin11.4.2)<br>
#       compiled by GNU C version 4.9.0, GMP version 6.0.0, MPFR version<br>
3.1.2, MPC version 1.0.2<br>
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072<br>
# options passed:  -D__DYNAMIC__ t.cc -fPIC -mmacosx-version-min=10.7.4<br>
# -mtune=core2 -fverbose-asm<br>
# options enabled:  -Wnonportable-cfstrings -fPIC<br>
# -faggressive-loop-<u></u>optimizations -fasynchronous-unwind-tables<br>
# -fauto-inc-dec -fcommon -fdelete-null-pointer-checks -fearly-inlining<br>
# -feliminate-unused-debug-types -fexceptions -ffunction-cse -fgcse-lm<br>
# -fgnu-unique -fident -finline-atomics -fira-hoist-pressure<br>
# -fira-share-save-slots -fira-share-spill-slots -fivopts<br>
# -fkeep-static-consts -fleading-underscore -fmath-errno<br>
# -fmerge-debug-strings -fnext-runtime -fobjc-abi-version= -fpeephole<br>
# -fprefetch-loop-arrays -freg-struct-return<br>
# -fsched-critical-path-<u></u>heuristic -fsched-dep-count-heuristic<br>
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic<br>
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic<br>
# -fsched-stalled-insns-dep -fshow-column -fsigned-zeros<br>
# -fsplit-ivs-in-unroller -fstrict-volatile-bitfields -fsync-libcalls<br>
# -ftrapping-math -ftree-coalesce-vars -ftree-cselim -ftree-forwprop<br>
# -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon<br>
# -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop<br>
# -ftree-reassoc -ftree-scev-cprop -funit-at-a-time -funwind-tables<br>
# -fverbose-asm -fzero-initialized-in-bss -gstrict-dwarf<br>
# -m128bit-long-double -m64 -m80387 -malign-stringops -matt-stubs<br>
# -mconstant-cfstrings -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mieee-fp<br>
# -mlong-double-80 -mmmx -mno-sse4 -mpush-args -mred-zone -msse -msse2<br>
# -msse3<br>
<br>
         .constructor<br>
         .destructor<br>
         .align 1<br>
         .subsections_via_symbols<br>
<br>
% g++-fsf-4.9 -fverbose-asm -O2 t.cc -S<br>
% more t.s<br>
# GNU C++ (GCC) version 4.9.0 (x86_64-apple-darwin11.4.2)<br>
#       compiled by GNU C version 4.9.0, GMP version 6.0.0, MPFR version<br>
3.1.2, MPC version 1.0.2<br>
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072<br>
# options passed:  -D__DYNAMIC__ t.cc -fPIC -mmacosx-version-min=10.7.4<br>
# -mtune=core2 -O2 -fverbose-asm<br>
# options enabled:  -Wnonportable-cfstrings -fPIC<br>
# -faggressive-loop-<u></u>optimizations -fasynchronous-unwind-tables<br>
# -fauto-inc-dec -fbranch-count-reg -fcaller-saves<br>
# -fcombine-stack-adjustments -fcommon -fcompare-elim -fcprop-registers<br>
# -fcrossjumping -fcse-follow-jumps -fdefer-pop<br>
# -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively<br>
# -fearly-inlining -feliminate-unused-debug-types -fexceptions<br>
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse<br>
# -fgcse-lm -fgnu-unique -fguess-branch-probability -fhoist-adjacent-loads<br>
# -fident -fif-conversion -fif-conversion2 -findirect-inlining -finline<br>
# -finline-atomics -finline-functions-called-once -finline-small-functions<br>
# -fipa-cp -fipa-profile -fipa-pure-const -fipa-reference -fipa-sra<br>
# -fira-hoist-pressure -fira-share-save-slots -fira-share-spill-slots<br>
# -fisolate-erroneous-paths-<u></u>dereference -fivopts -fkeep-static-consts<br>
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings<br>
# -fmove-loop-invariants -fnext-runtime -fobjc-abi-version=<br>
# -fomit-frame-pointer -foptimize-sibling-calls -foptimize-strlen<br>
# -fpartial-inlining -fpeephole -fpeephole2 -fprefetch-loop-arrays -free<br>
# -freg-struct-return -freorder-blocks -freorder-blocks-and-partition<br>
# -freorder-functions -frerun-cse-after-loop<br>
# -fsched-critical-path-<u></u>heuristic -fsched-dep-count-heuristic<br>
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic<br>
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic<br>
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fshrink-wrap<br>
# -fsigned-zeros -fsplit-ivs-in-unroller -fsplit-wide-types<br>
# -fstrict-aliasing -fstrict-overflow -fstrict-volatile-bitfields<br>
# -fsync-libcalls -fthread-jumps -ftoplevel-reorder -ftrapping-math<br>
# -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch<br>
# -ftree-coalesce-vars -ftree-copy-prop -ftree-copyrename -ftree-cselim<br>
# -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre<br>
# -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon<br>
# -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pre<br>
# -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slsr<br>
# -ftree-sra -ftree-switch-conversion -ftree-tail-merge -ftree-ter<br>
# -ftree-vrp -funit-at-a-time -funwind-tables -fverbose-asm<br>
# -fzero-initialized-in-bss -gstrict-dwarf -m128bit-long-double -m64<br>
# -m80387 -malign-stringops -matt-stubs -mconstant-cfstrings<br>
# -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mieee-fp -mlong-double-80 -mmmx<br>
# -mno-sse4 -mpush-args -mred-zone -msse -msse2 -msse3 -mvzeroupper<br>
<br>
         .constructor<br>
         .destructor<br>
         .align 1<br>
         .subsections_via_symbols<br>
<br>
You might consider filing an enhancement request for clang 3.5 to have the<br>
default behavior without optimization flags bumped up to -O1.<br>
          Jack<br>
</div></div></blockquote>
<br>
</blockquote></div><br></div>