[llvm-dev] Can I dump LLVM IR after each pass in Clang BackendUtil.cpp

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 12 10:09:09 PDT 2016


On 6/12/16 8:11 AM, Zhengyang Liu via llvm-dev wrote:
>
> It solved my question, thank you.
>

Alternatively, you can add a BitcodeWriter (or whatever it's called) 
pass.  This pass writes the bitcode out to a file.  As it is an LLVM 
pass, you can schedule it like any other pass.

Regards,

John Criswell

>
> Best regards,
>
> Zhengyang.
>
>
>
> ------------------------------------------------------------------------
> *From:* Martin J. O'Riordan <martin.oriordan at movidius.com>
> *Sent:* Sunday, June 12, 2016 9:01 PM
> *To:* 'Zhengyang Liu'
> *Subject:* RE: [llvm-dev] Can I dump LLVM IR after each pass in Clang 
> BackendUtil.cpp
> I think that:
>
>    -mllvm -print-after-all
>
> does that you need.  It is "very" verbose though and you might prefer 
> to use:
>
>    -mllvm -print-after=<selected-passes>
>
> Use '-mllvm -help' or '-mllvm --help-hidden' to see all the options.
>
>         MartinO
>
> -----Original Message-----
> From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of 
> Zhengyang Liu via llvm-dev
> Sent: 12 June 2016 13:39
> To: llvm-dev at lists.llvm.org
> Subject: [llvm-dev] Can I dump LLVM IR after each pass in Clang 
> BackendUtil.cpp
>
> Dear llvm-dev,
>
> I am trying to debug some passes , these passes are added to
> legacy::PassManager(MPM) in Clang's lib/CodeGen/BackendUtil.cpp  :
>
>
> //******
> void EmitAssemblyHelper::CreatePasses() {
> //******
>    if (CodeGenOpts.MemSafety) {
>      //
>      // Add passes that record information about run-time checks.
>      //
>      MPM->add (createCommonMSCInfoPass());
>      MPM->add (createSAFECodeMSCInfoPass());
> //******
>
> Could I dump the output LLVM IR after each pass in PassManager MPM?
>
> Best regards,
> Zhengyang.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160612/9b92520a/attachment.html>


More information about the llvm-dev mailing list