The IR transformation log generated with -print-before/after-all is essential information to understand the LLVM behavior.
However, the size of the output often becomes quite large.
This patch reduces the size of the output by avoiding print the detail if the function is not modified by a previous pass. This functionality is controlled by -omit-duplicated-dump option and is not enabled by default.
Since, there is many passes that do not modify functions (including analysis passes), the size of output becomes about half in many cases.
If the function is not modified, output looks like as follow:
*** IR Dump After Global Value Numbering *** ; Function Attrs: norecurse nounwind uwtable define i32 @main() local_unnamed_addr #2 { listing omitted because it is not modified since last dump. }
# *** IR Dump After StackMap Liveness Analysis ***: # Machine code for function main: NoPHIs, TracksLiveness, NoVRegs listing omitted because it is not modified since last dump. # End machine code for function main.
Why aren't you using a smart pointer?