[LLVMdev] Passing arguments to opt via clang

2,624 views
Skip to first unread message

Harel Cain

unread,
Mar 4, 2012, 7:42:54 AM3/4/12
to llv...@cs.uiuc.edu
Hi all,

In the good old llvmc, the -Wo flag could be used to pass arguments to the optimizer. Is there a similar mechanism anywhere for clang? Is there also a similar mechanism to -Wllc?


Thanks!

Harel Cain

Anton Korobeynikov

unread,
Mar 4, 2012, 8:03:49 AM3/4/12
to Harel Cain, llv...@cs.uiuc.edu
> In the good old llvmc, the -Wo flag could be used to pass arguments to the
> optimizer. Is there a similar mechanism anywhere for clang? Is there also a
> similar mechanism to -Wllc?
-mlvm will handle all of them

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Harel Cain

unread,
Mar 4, 2012, 8:32:53 AM3/4/12
to Anton Korobeynikov, llv...@cs.uiuc.edu
Thanks, but I'm not sure I understand. I see no such flag in clang 2.9 nor couldn't I find any mention of it. What does it do?


Harel Cain

Duncan Sands

unread,
Mar 4, 2012, 8:42:46 AM3/4/12
to llv...@cs.uiuc.edu
On 04/03/12 14:32, Harel Cain wrote:
> Thanks, but I'm not sure I understand. I see no such flag in clang 2.9 nor
> couldn't I find any mention of it. What does it do?

I think he meant -mllvm not -mlvm. The next thing that follows is passed to
LLVM, for example -mllvm -disable-llvm-optzns

Ciao, Duncan.

>
>
> Harel Cain
>
>
> On Sun, Mar 4, 2012 at 15:03, Anton Korobeynikov <an...@korobeynikov.info
> <mailto:an...@korobeynikov.info>> wrote:
>
> > In the good old llvmc, the -Wo flag could be used to pass arguments to the
> > optimizer. Is there a similar mechanism anywhere for clang? Is there also a
> > similar mechanism to -Wllc?
> -mlvm will handle all of them
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
>
>
>
>

Tobias Grosser

unread,
Mar 4, 2012, 8:48:20 AM3/4/12
to Harel Cain, llv...@cs.uiuc.edu
On 03/04/2012 02:32 PM, Harel Cain wrote:
> Thanks, but I'm not sure I understand. I see no such flag in clang 2.9
> nor couldn't I find any mention of it. What does it do?

It's called -mllvm.

You can use it like this.

clang -mllvm -vectorize ...

Cheers
Tobi

pmon mail

unread,
Mar 4, 2012, 10:24:13 AM3/4/12
to Tobias Grosser, llv...@cs.uiuc.edu
I have tried to invoke a transformation/optimization pass using -mllvm, without success. I might be missing something.

For example I have a shared/dynamic library which contains LLVM passes. I used to invoke them with llvmc like this:
>>llvmc mycode.c -o mycode.o -c -opt -Wo,=-load,libFoo.dylib,-Foo

Can this style of optimization be executed using -mllvm argument?

Thx,
PMon

Anton Korobeynikov

unread,
Mar 4, 2012, 10:57:06 AM3/4/12
to pmon mail, Tobias Grosser, llv...@cs.uiuc.edu
Hello

> For example I have a shared/dynamic library which contains LLVM passes. I
> used to invoke them with llvmc like this:
>>>llvmc mycode.c -o mycode.o -c -opt -Wo,=-load,libFoo.dylib,-Foo
> Can this style of optimization be executed using -mllvm argument?

No. You cannot add additional passes this way, only pass 'ordinary' arguments.

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University

khalil_sb

unread,
Jun 27, 2013, 7:38:09 AM6/27/13
to llv...@cs.uiuc.edu
what is the solution to pass opt arguments , non ordinary passes like :
*-std-link-opts* by clang ?
Dose clang invoke opt in normal compilation procedure even?



--
View this message in context: http://llvm.1065342.n5.nabble.com/Passing-arguments-to-opt-via-clang-tp3161p58920.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

Duncan Sands

unread,
Jun 27, 2013, 4:23:01 PM6/27/13
to llv...@cs.uiuc.edu
On 27/06/13 13:38, khalil_sb wrote:
> what is the solution to pass opt arguments , non ordinary passes like :
> *-std-link-opts* by clang ?
> Dose clang invoke opt in normal compilation procedure even?

No, clang doesn't invoke opt. Instead both clang and opt use the same LLVM
infrastructure to schedule passes (opt is basically a thin wrapper around
this core functionality).

Ciao, Duncan.
Reply all
Reply to author
Forward
0 new messages