Hello all,
Currently, all IRPrinting passes are not considered as analysis, so when -print-after/before-all option enabled, we'll print the IR twice in a row. Note that we do not have this issue with BitcodeWriter pass, since it is already an analysis pass. For example, with:
$ opt -O1 -print-after-all -debug-pass=Arguments -o /dev/null
we got
Pass Arguments: -targetlibinfo -print-module ... -write-bitcode
whereas with
$ opt -O1 -print-after-all -debug-pass=Arguments -S -o /dev/null
we got
Pass Arguments: -targetlibinfo -print-module ... -print-module -print-module
This patch will remove the second -print-module pass from the pipeline.
Can you add a positive check that Print Module IR is actually being called?