[LLVMdev] -march and -mtune options on x86

Chandler Carruth chandlerc at google.com
Sun Jan 15 00:01:18 PST 2012


On Sat, Jan 14, 2012 at 11:55 PM, Ghassan Shobaki <ghassan_shobaki at yahoo.com
> wrote:

> I have been doing some benchmarking on x86 using llvm 2.9 with the
> llvm-gcc 4.2 front end.
>

FYI, llvm 2.9 and llvm-gcc 4.2 are both quite old. It's very limited how
much help you can get for those platforms. I would suggest trying LLVM 3.0
and the Clang or DragonEgg frontends.


> I noticed that the -march and -mtune options make a significant positive
> difference in x86-32 mode but hardly make any difference in x86-64 mode.
> The small difference that I am measuring when the target is x86-64 could
> easily be random variation, while for the x86-32 target I am measuring a
> huge difference on some benchmarks. Does anyone have an explanation for
> this? Does the llvm back end somehow ignore these options when the target
> is x86-64?
>

I'm not sure about the llvm-gcc implementation of the options, but
understand that i386 is an extremely limiting platform to target. I would
expect significant improvements when moving the code generator from i386 ->
i686 and other modern processors.

However x86-64 (as one side benefit) provides a much more modern baseline
for the instructions available, etc. The biggest differences past x86-64
you're likely to see are in the SIMD vector instructions available, which
will only help if you have heavily vectorized code. There are a few other
differences that can be significant, but far fewer than the jumps between
i386 and modern x86 chips.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120115/6b99483c/attachment.html>


More information about the llvm-dev mailing list