[LLVMdev] Passing llc options to Clang

Ziqiang Patrick Huang ziqiang.huang1001 at gmail.com
Mon Oct 13 14:08:44 PDT 2014

Thanks, Reid

The reason I want to pass -mcpu is that I want to specify the subtarget so
that when llc does the instruction scheduling, it would takes the subtarget
scheduling information into consideration. I'm not sure --target flag will
get what I want ...

2014-10-13 16:55 GMT-04:00 Reid Kleckner <rnk at google.com>:

> You'll be a lot better off if you use the gcc-style flags that clang
> accepts. If you bypass clang, it will generate LLVM IR for the default
> target, and then attempt to compile that IR using the triple you provided
> to llc.
> Try 'clang --target=x86_64-linux-gnu' or whatever your target is.
> On Mon, Oct 13, 2014 at 12:48 PM, Ziqiang Patrick Huang <
> ziqiang.huang1001 at gmail.com> wrote:
>> Hi,
>> Is there a way to passing llc options to clang, for example -march -mcpu,
>> etc. ?
>> Some threads suggested using -mllvm flag,
>> I tried ./clang -mllvm -march=X86-64 -mcpu=core2 -o hello hello.c, but
>> got "Unknown command line argument"
>> Thanks,
>> Ziqiang
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

*Ziqiang Huang*
*Electrical and Computer Engineering*
*Hudson 213c, Duke University*
*Tel: 919-491-3677*
*Email: ziqiang.huang at duke.edu <ziqiang.huang at duke.edu>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/b8fc50c6/attachment.html>

More information about the llvm-dev mailing list