There is currently no way to view CFG graphically with layout decision after MBP pass. Developers currently rely on debug text dump to debug layout related bugs.
This patch adds the capability to dump/view cfg dump file after MBP pass. It enhances the existing MBFI graph dumping with an optional functionality to display the layout order of an machine basic block. The order of a basic block is displayed as a sequence number encoded in brackets [] after the block name string. The graph will also show branch probabilities and frequencies/count information.
The option is:
-mllvm -view-block-layout-with-bfi=[integer|fraction|count]
To filter, do -mllvm -view-bfi-func-name=<name>
Example for CodeGen/PowerPC/tail-dup-layout.ll
- block layout with tailduplication enabled:
https://reviews.llvm.org/F3024165
- block layout with tail-dup disabled: