[cfe-dev] How would I determine -march=<type> on the fly

Craig Topper via cfe-dev cfe-dev at lists.llvm.org
Sun May 6 10:01:29 PDT 2018


Hi David,

-march=native will auto detect the CPU.

On Sun, May 6, 2018 at 9:26 AM David Barto via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> The system I work with generates code and then compiles it into a shared
> library
> to execute. Currently we choose to set -march=core2 which is easy enough
> but
> quite silly because we don’t get any machine specific optimizations that
> could get
> better execution times.
>
> I can’t google how to find the appropriate arch type for the compiler. If
> I could do
> that then I could check the hardware (somehow) and match it to the proper
> -march
> tag, and have the resulting compile line include the target hardware thus
> generating
> better performant code.
>
> Anyone know how that could be done?
>
>         David
>
> David Barto
> barto at cambridgesemantics.com
>
> Sometimes, my best code does nothing. Most of the rest of it has bugs.
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180506/f936cbf1/attachment.html>


More information about the cfe-dev mailing list