Abdul Wahid Memon
2012-Jun-12 10:48 UTC
[LLVMdev] How to use LLVM optimizations with clang
Hi 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? Regards Shahzad On Tue, Jun 12, 2012 at 12:42 PM, Duncan Sands <baldrick at free.fr> wrote:> Hi, the reason is that lli does optimized code generation by default, while > clang does unoptimized codegen by default. Use this > clang -O2 comb.ll > instead. > > Ciao, Duncan.
> 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.
Abdul Wahid Memon
2012-Jun-12 11:09 UTC
[LLVMdev] How to use LLVM optimizations with clang
Thanks alot. How can we view those optimization which are enabled when we do llc -O3 comb.ll Are these the same as the ones produced by the following command line 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.