[LLVMdev] Capabilities of Clang's PGO (e.g. improving code density)
Diego Novillo
dnovillo at google.com
Wed May 27 07:42:49 PDT 2015
On Tue, May 26, 2015 at 11:47 PM, Lee Hunt <leehu at exchange.microsoft.com> wrote:
> For example, from reading different pages on how Clang PGO, it’s unclear if
> it does “block reordering” (i.e. moving unexecuted code blocks to a distant
> code page, leaving only ‘hot’ executed code packed together for greater code
> density). I find mention of “hot arc” optimization (-fprofile-arcs) , but
> I’m unclear if this is the same thing. Does Clang PGO do block reordering?
A small clarification. Clang itself does not implement any
optimizations. Clang limits itself to generate LLVM IR. The
annotated IR is then used by some LLVM optimizers to guide decisions.
At this time, there are few optimization passes that use the profile
information: block reordering and register allocation (to avoid
spilling on cold paths).
There are no other significant transformations that use profiling
information. We are working on that. Notably, we'd like to add
profiling-based decisions to the inliner, loop optimizers and the
vectorizer.
Diego.
More information about the llvm-dev
mailing list