[LLVMdev] How to use LLVM optimizations with clang

Duncan Sands baldrick at free.fr
Tue Jun 12 04:23:57 PDT 2012


Hi,

On 12/06/12 13:09, Abdul Wahid Memon wrote:
> Thanks alot. How can we view those optimization which are enabled when we do
>
> llc -O3 comb.ll

llc -O3 comb.ll -debug-pass=Arguments

>
> Are these the same as the ones produced by the following command line

no, as I mentioned before they are of a completely different nature
to the optimizations that opt does.

Ciao, Duncan.

>
> llvm-as<  /dev/null | opt -O3 -disable-output -debug-pass=Arguments
>
> Regards
>
> Shahzad
>
> On Tue, Jun 12, 2012 at 1:01 PM, Duncan Sands<baldrick at free.fr>  wrote:
>>> Yes. But how exactly code generation (optimized one) be done without
>>> clang. Is it possible that we can specify those optimization
>>> (individual ones instead of standard ones like -O3) some how when
>>> generating code as is done by clang or llc?
>>
>>
>> llc comb.ll
>> gcc -o comb comb.s
>>
>> Variants:
>>   llc -O0 comb.ll
>>   llc -O3 comb.ll
>> etc
>>
>> Note that the codegen level optimizations done by llc have nothing to do
>> with
>> the IR level optimizations of the kind performed by opt.
>>
>> Ciao, Duncan.




More information about the llvm-dev mailing list