Jim,<div><br></div><div>There's a comment in llc.cpp:</div><div><br></div><div><div>  // Allocate target machine.  First, check whether the user has explicitly</div><div>  // specified an architecture to compile for. If so we have to look it up by</div>
<div>  // name, because it might be a backend that has no mapping to a target triple.</div></div><div><div>  const Target *TheTarget = 0;</div></div><div>  if (!MArch.empty()) {</div><div><br></div><div>It explicitly uses MArch over the triple for the Target lookup.</div>
<div><br></div><div>Daniel, it looks like you wrote this comment. Could you explain what you mean by a backend with no mapping to a target triple?</div><div><br></div><div>Thanks,</div><div>- pdox</div><div><div><div><br>
<div class="gmail_quote">On Fri, Mar 2, 2012 at 9:11 AM, Jim Grosbach <span dir="ltr"><<a href="mailto:grosbach@apple.com">grosbach@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
On Mar 2, 2012, at 12:04 AM, David Meyer <<a href="mailto:pdox@google.com">pdox@google.com</a>> wrote:<br>
<br>
> ARM subtarget features are determined by parsing the target tuple string TT. (ParseARMTriple(StringRef TT) in ARMMCTargetDesc.cpp)<br>
><br>
> In llc, the -march setting overrides the architecture specified in -mtriple. So when you invoke:<br>
><br>
> $ llc -march arm -mtriple armv7-none-linux ...<br>
><br>
> ParseARMTriple() will see TT == "arm-none-linux" instead of "armv7-none-linux". As a result, the target features will be set generically. (Note that using "-march armv7" is not valid.)<br>

><br>
> This is clearly wrong, but I'm not clear on where/how this should be fixed. Does the -march substitution need to happen at all? Could it be disabled only for ARM? Should TargetTriple or -march be made more precise?<br>

><br>
<br>
</div></div>When using a triple, -march doesn't add any additional information. The idea is that -march is a shorthand for a generic triple (e.g., -march=arm implies -mtriple=arm-unknown-unknown or something similar).<br>

<br>
It seems to me that using both on the llc command line should issue a diagnostic.<br>
<br>
-Jim<br>
<br>
> Thanks,<br>
> - pdox<br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote></div><br></div></div></div>