<div dir="auto">Hi David,</div><div dir="auto"><br></div><div dir="auto">-march=native will auto detect the CPU.</div><div><br><div class="gmail_quote"><div>On Sun, May 6, 2018 at 9:26 AM David Barto via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The system I work with generates code and then compiles it into a shared library<br>
to execute. Currently we choose to set -march=core2 which is easy enough but<br>
quite silly because we don’t get any machine specific optimizations that could get<br>
better execution times.<br>
<br>
I can’t google how to find the appropriate arch type for the compiler. If I could do<br>
that then I could check the hardware (somehow) and match it to the proper -march<br>
tag, and have the resulting compile line include the target hardware thus generating<br>
better performant code.<br>
<br>
Anyone know how that could be done?<br>
<br>
        David<br>
<br>
David Barto<br>
<a href="mailto:barto@cambridgesemantics.com" target="_blank">barto@cambridgesemantics.com</a><br>
<br>
Sometimes, my best code does nothing. Most of the rest of it has bugs.<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div>