regis portalez via llvm-dev
2015-Aug-28 13:50 UTC
[llvm-dev] get llvm IR after a clang optimization pass.
Hi, Id like to run clang with some optimization passes (-reassociate, -simplifycfg, -dce ) But in the end I need to dump the llvm IR (no link to assembly generation). I didnt find any way to do that. I found out that passes are run via opt, but opt generates bc code, and I want IR. Any help will be welcome Thanks, Régis -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150828/ff8ceb81/attachment.html>
Björn Steinbrink via llvm-dev
2015-Aug-28 13:53 UTC
[llvm-dev] get llvm IR after a clang optimization pass.
Hi Régis, with clang, you can use add `-emit-llvm -S` to get it to output IR directly. With opt just add -S to get IR instead of bitcode. Björn 2015-08-28 15:50 GMT+02:00 regis portalez via llvm-dev <llvm-dev at lists.llvm.org>:> Hi, > > > > I’d like to run clang with some optimization passes (-reassociate, > -simplifycfg, -dce…) > > > > But in the end I need to dump the llvm IR (no link to assembly generation). > > > > I didn’t find any way to do that. > > > > I found out that passes are run via opt, but opt generates bc code, and I > want IR. > > > > Any help will be welcome > > > > Thanks, > > > > Régis > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >
regis portalez via llvm-dev
2015-Aug-28 14:08 UTC
[llvm-dev] get llvm IR after a clang optimization pass.
HI Björn Thanks, Works perfectly well! -----Original Message----- From: Björn Steinbrink [mailto:bsteinbr at gmail.com] Sent: vendredi 28 août 2015 15:54 To: regis portalez <regis.portalez at altimesh.com> Cc: llvm-dev at lists.llvm.org Subject: Re: [llvm-dev] get llvm IR after a clang optimization pass. Hi Régis, with clang, you can use add `-emit-llvm -S` to get it to output IR directly. With opt just add -S to get IR instead of bitcode. Björn 2015-08-28 15:50 GMT+02:00 regis portalez via llvm-dev <llvm-dev at lists.llvm.org>:> Hi, > > > > I’d like to run clang with some optimization passes (-reassociate, > -simplifycfg, -dce…) > > > > But in the end I need to dump the llvm IR (no link to assembly generation). > > > > I didn’t find any way to do that. > > > > I found out that passes are run via opt, but opt generates bc code, > and I want IR. > > > > Any help will be welcome > > > > Thanks, > > > > Régis > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >