MIParser/MIRPrinter: Compute block successors if not explicitely specified
authorMatthias Braun <matze@braunis.de>
Fri, 5 May 2017 21:09:30 +0000 (21:09 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 5 May 2017 21:09:30 +0000 (21:09 +0000)
commit8940114f61e345ae65e7be9c43a8ed1cfb7f60b8
tree41648110b3685e3936320b1f361a07015553a990
parentf7ca8fcd6a177c1143591d6b459ff0933f4fb8b6
MIParser/MIRPrinter: Compute block successors if not explicitely specified

- MIParser: If the successor list is not specified successors will be
  added based on basic block operands in the block and possible
  fallthrough.

- MIRPrinter: Adds a new `simplify-mir` option, with that option set:
  Skip printing of block successor lists in cases where the
  parser is guaranteed to reconstruct it. This means we still print the
  list if some successor cannot be determined (happens for example for
  jump tables), if the successor order changes or branch probabilities
  being unequal.

Differential Revision: https://reviews.llvm.org/D31262

llvm-svn: 302289
33 files changed:
llvm/docs/MIRLangRef.rst
llvm/include/llvm/CodeGen/MIRPrinter.h [moved from llvm/lib/CodeGen/MIRPrinter.h with 58% similarity]
llvm/lib/CodeGen/MIRParser/MIParser.cpp
llvm/lib/CodeGen/MIRPrinter.cpp
llvm/lib/CodeGen/MIRPrintingPass.cpp
llvm/test/CodeGen/AArch64/loh.mir
llvm/test/CodeGen/AArch64/machine-copy-remove.mir
llvm/test/CodeGen/AArch64/machine-sink-zr.mir
llvm/test/CodeGen/AArch64/regcoal-physreg.mir
llvm/test/CodeGen/AMDGPU/detect-dead-lanes.mir
llvm/test/CodeGen/AMDGPU/inserted-wait-states.mir
llvm/test/CodeGen/AMDGPU/invert-br-undef-vcc.mir
llvm/test/CodeGen/AMDGPU/liveness.mir
llvm/test/CodeGen/AMDGPU/optimize-if-exec-masking.mir
llvm/test/CodeGen/AMDGPU/rename-independent-subregs.mir
llvm/test/CodeGen/AMDGPU/si-fix-sgpr-copies.mir
llvm/test/CodeGen/AMDGPU/subreg-intervals.mir
llvm/test/CodeGen/AMDGPU/vccz-corrupt-bug-workaround.mir
llvm/test/CodeGen/ARM/ARMLoadStoreDBG.mir
llvm/test/CodeGen/ARM/cmp1-peephole-thumb.mir
llvm/test/CodeGen/ARM/cmp2-peephole-thumb.mir
llvm/test/CodeGen/ARM/dbg-range-extension.mir
llvm/test/CodeGen/MIR/Generic/branch-probabilities.ll [deleted file]
llvm/test/CodeGen/MIR/X86/auto-successor.mir [new file with mode: 0644]
llvm/test/CodeGen/MIR/X86/branch-probabilities.mir [new file with mode: 0644]
llvm/test/CodeGen/MIR/X86/successor-basic-blocks.mir
llvm/test/CodeGen/X86/branchfolding-undef.mir
llvm/test/CodeGen/X86/eflags-copy-expansion.mir
llvm/test/CodeGen/X86/implicit-null-checks.mir
llvm/test/CodeGen/X86/invalid-liveness.mir
llvm/test/CodeGen/X86/machine-region-info.mir
llvm/test/CodeGen/X86/pr27681.mir
llvm/test/CodeGen/X86/pre-coalesce.mir