[BOLT][NFC] Print functions after attaching profile (-print-profile)
authorAmir Ayupov <aaupov@fb.com>
Thu, 29 Jun 2023 00:50:39 +0000 (17:50 -0700)
committerAmir Ayupov <aaupov@fb.com>
Thu, 29 Jun 2023 00:51:17 +0000 (17:51 -0700)
commitfd49cc87d0024c7d5c9f068bbf2f9a7e9a6ac0f3
tree5dcfd98bb94454303a4187b2f73d191702cfabc0
parentde19101e3302f4423f4946b1a916a4d19260d6ac
[BOLT][NFC] Print functions after attaching profile (-print-profile)

Add an extra point of dumping functions: immediately after attaching the profile information.
This dumping is enabled by newly introduced `-print-profile` and `-print-all`.

The reason is that in `aggregate-only`/perf2bolt mode BOLT may not reach the point of
printing the function after CFG is constructed (`-print-cfg`), while we may still want to inspect
the attached profile, especially for diff'ing purposes.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D153996
bolt/lib/Rewrite/RewriteInstance.cpp