Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple LLVM passes with single call

Tags:

llvm

In general, if I put two LLVM passes into a single command-line call, like this...

$(LLVM_HOME)opt -my-pass -another-pass < foo1.bc > foo2.bc

...is this defined to be exactly the same as running the two passes consecutively, with an additional intermediate file, like this...

$(LLVM_HOME)opt -my-pass < foo1.bc > foo11.bc
$(LLVM_HOME)opt -another-pass < foo11.bc > foo2.bc

...or are those two passes performed simultaneously in some way?

like image 1000
John Wickerson Avatar asked Mar 17 '26 04:03

John Wickerson


1 Answers

If the two passes are transformation passes, like -simplifycfg and -licm, then yes, you can think of there being an intermediary file between the two and run the commands as you suggest.

However, there also exist analysis passes, like -aa for alias analysis. These ones will not work as you describe, because they don't massage the IR, they just provide information to passes that do (like -licm for example).

So, opt -aa -licm is not equivalent to opt -aa followed by opt -licm.

like image 112
dune.rocks Avatar answered Mar 18 '26 16:03

dune.rocks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!