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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/7982544a/attachment.html>
maybe try to use -mllvm for each arg ./clang -mllvm -march=X86-64 -mllvm -mcpu=core2 -o hello hello.c -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141014/e5b123ab/attachment.html>
Thanks, Daniil I've tried that, still not working. 2014-10-13 16:11 GMT-04:00 Daniil Troshkov <troshkovdanil at gmail.com>:> maybe try to use -mllvm for each arg > > ./clang -mllvm -march=X86-64 -mllvm -mcpu=core2 -o hello hello.c >-- *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/6d49caf4/attachment.html>
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 > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/6663574d/attachment.html>
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>