[LLVMdev] "-march" trashing ARM triple

Jim Grosbach grosbach at apple.com
Fri Mar 2 09:11:06 PST 2012


On Mar 2, 2012, at 12:04 AM, David Meyer <pdox at google.com> wrote:

> ARM subtarget features are determined by parsing the target tuple string TT. (ParseARMTriple(StringRef TT) in ARMMCTargetDesc.cpp)
> 
> In llc, the -march setting overrides the architecture specified in -mtriple. So when you invoke:
> 
> $ llc -march arm -mtriple armv7-none-linux ...
> 
> 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.)
> 
> 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?
> 

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).

It seems to me that using both on the llc command line should issue a diagnostic.

-Jim

> Thanks,
> - pdox
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list