[SamplePGO] More pipeline changes when flattened profile used in ThinLTO postlink
authorTeresa Johnson <tejohnson@google.com>
Tue, 5 Feb 2019 04:09:19 +0000 (04:09 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 5 Feb 2019 04:09:19 +0000 (04:09 +0000)
commitb0bf530fb5f1483ebf3d45c262404133eb6ad539
treeceee1faf5e77a895b0c7458a7fdd7de5130d2a96
parenta9354b2f33730f4d4dddb0bdd0396c799f38ac7d
[SamplePGO] More pipeline changes when flattened profile used in ThinLTO postlink

Summary:
Follow on to D54819/r351476.

We also don't need to perform extra InstCombine pass when we aren't
loading the sample profile in the ThinLTO backend because we have a
flattened sample profile.

Additionally, for consistency and clarity, when we aren't reloading the
sample profile, perform ICP in the same location as non-sample PGO
backends. To this end I have moved the ICP invocation for non-SamplePGO
ThinLTO down into buildModuleSimplificationPipeline (partly addresses
the FIXME where we were previously setting this up).

Reviewers: wmi

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 353135
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/new-pm-thinlto-defaults.ll