3

I use LLVM opt to run a pass using, e.g, opt -load libMyPass.so my-pass foo.ll > foo1.ll.

foo.ll is an IR file, and I want foo1.ll to contain the result, of running the pass, in IR format. But foo1.ll becomes a bitcode file, so I need to issue llvm-dis foo1.ll to transform it into IR format.

How do I avoid having to run llvm-dis, and make opt transform from IR format to IR format?

1 Answer 1

9

opt has a nice option for doing that:

-S           - Write output as LLVM assembly

I guess what confuses you is that LLVM assembly is a synonym for LLVM IR.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.