]> granicus.if.org Git - llvm/commit
Refine the PGOOpt and SamplePGOSupport handling.
authorDehao Chen <dehao@google.com>
Sat, 29 Jul 2017 04:10:24 +0000 (04:10 +0000)
committerDehao Chen <dehao@google.com>
Sat, 29 Jul 2017 04:10:24 +0000 (04:10 +0000)
commit04fe17a73458e04fcdcb72d5539fd2fa1ccc5d4d
tree54f9090b825b19d78b925a00e7d81fec24296fb7
parent39aff8ce5a34ff2878e827c582613150b80077d9
Refine the PGOOpt and SamplePGOSupport handling.

Summary:
Now that SamplePGOSupport is part of PGOOpt, there are several places that need tweaking:
1. AddDiscriminator pass should *not* be invoked at ThinLTOBackend (as it's already invoked in the PreLink phase)
2. addPGOInstrPasses should only be invoked when either ProfileGenFile or ProfileUseFile is non-empty.
3. SampleProfileLoaderPass should only be invoked when SampleProfileFile is non-empty.
4. PGOIndirectCallPromotion should only be invoked in ProfileUse phase, or in ThinLTOBackend of SamplePGO.

Reviewers: chandlerc, tejohnson, davidxl

Reviewed By: chandlerc

Subscribers: sanjoy, mehdi_amini, eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309478 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Passes/PassBuilder.h
lib/Passes/PassBuilder.cpp
test/Other/new-pm-thinlto-defaults.ll