[llvm-dev] How to use -block-placement pass in LLVM

Yirui Liu via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 22 08:47:56 PST 2019


I am now working on a project involving profile-guided-optimization. I find
the documentation at http://llvm.org/docs/Passes.html#id49 named a pass
*-block-placement* to do simple PGO. I am wondering what tool and flags I
should use to run this pass.

I have found that this pass is located in
llvm-src/lib/CodeGen/MachineBlockPlacement.cpp, and
*MachineFunctionPass* cannot
be run from *opt* or *bugpoint*. According to the manual page of *llc*, I
cannot directly use *-block-placement, instead* using
*-print-after=block-placement* or *-print-before=block-placement.*
However, using these flags have no different results. I also used
*--debug-pass=Executions* to *llc*, and saw *-block-placement* passed as an
argument, but it was not executed. I am wondering if the pass -
*block-placement* runs automatically, and I should give other pgo-file
flags to trigger it, or the pass can run individually.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190122/1e28096c/attachment.html>

More information about the llvm-dev mailing list