[PATCH] D33886: Reduce the size of output with -print-before/after-all by avoid duplicated dump

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 01:42:25 PDT 2017


inouehrs created this revision.
Herald added a subscriber: mehdi_amini.

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.


https://reviews.llvm.org/D33886

Files:
  include/llvm/IR/Module.h
  lib/CodeGen/MachineFunction.cpp
  lib/IR/AsmWriter.cpp
  lib/IR/LegacyPassManager.cpp
  lib/IR/Module.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33886.101376.patch
Type: text/x-patch
Size: 4683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170605/5f8e7703/attachment.bin>


More information about the llvm-commits mailing list