llvm-project/llvm/test/Transforms
modimo ce7f9cdb50 [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks
This change leverages the work done in D83743 to replay in the SampleProfile inliner to also be used in the CGSCC inliner. NOTE: currently restricted to non-ML advisors only.

The added switch `-cgscc-inline-replay=<remarks file>` will replay the inlining decisions in that file where the remarks file is generated via `-Rpass=inline`. The aim here is to make it easier to analyze changes that would modify inlining heuristics to be separated from this behavior. Doing so allows easier examination of assembly and runtime behavior compared to the baseline rather than trying to dig through the large churn caused by inlining.

In LTO compilation, since inlining is done twice you can separately specify replay by passing the flag to the FE (`-cgscc-inline-replay=`) and to the linker (`-Wl,cgscc-inline-replay=`) with the remarks generated from their respective places.

Testing on mysqld by comparing the inline decisions between base (generates remarks.txt) and diff (replay using identical input/tools with remarks.txt) and examining the inlining sites with `diff` shows 14,000 mismatches out of 247,341 for a ~94% replay accuracy. I believe this gap can be narrowed further though for the general case we may never achieve full accuracy. For my personal use, this is close enough to be representative: I set the baseline as the one generated by the replay on identical input/toolset and compare that to my modified input/toolset using the same replay.

Testing:
ninja check-llvm
newly added test correctly replays CGSCC inlining decisions

Reviewed By: mtrofin, wenlei

Differential Revision: https://reviews.llvm.org/D94334
2021-01-25 15:38:57 -08:00
..
ADCE [SimplifyCFG] Teach FoldValueComparisonIntoPredecessors() to preserve DomTree, part 1 2021-01-01 03:25:22 +03:00
AddDiscriminators
AggressiveInstCombine [AggressiveInstCombine] Generalize foldGuardedRotateToFunnelShift to generic funnel shifts (REAPPLIED) 2020-12-21 15:22:27 +00:00
AlignmentFromAssumptions
ArgumentPromotion [ArgPromotion] Delay dead GEP removal until doPromotion. 2021-01-04 09:51:20 +00:00
AtomicExpand [AArch64] Out-of-line atomics (-moutline-atomics) implementation. 2020-11-20 13:30:12 +00:00
Attributor [ValueTracking] Don't assume readonly function will return 2021-01-24 10:40:21 +01:00
BDCE [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
BlockExtractor [BlockExtract][NewPM] Port -extract-blocks to NPM 2020-10-21 12:51:11 -07:00
BranchFolding
CallSiteSplitting [SimplifyCFG] Teach simplifyUnreachable() to preserve DomTree 2020-12-18 00:37:22 +03:00
CalledValuePropagation
CanonicalizeAliases [NPM] Move more O0 pass building into PassBuilder 2020-11-19 11:22:23 -08:00
CanonicalizeFreezeInLoops
CodeExtractor [HotColdSplit] Reflect full cost of parameters in split penalty 2020-12-18 17:06:17 -08:00
CodeGenPrepare [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
ConstantHoisting [test] Fix const-addr-no-neg-offset.ll under NPM 2020-11-13 23:29:58 -08:00
ConstantMerge
ConstraintElimination [ConstraintElimination] Add support for select form of and/or 2020-12-30 21:27:36 +09:00
Coroutines [InstCombine] Remove unused llvm.experimental.noalias.scope.decl 2021-01-24 13:55:50 +01:00
CorrelatedValuePropagation [LVI] Handle unions of conditions 2021-01-01 16:46:21 +01:00
CrossDSOCFI
DCE [Tests] Add willreturn to libcalls in some tests 2021-01-22 21:47:35 +01:00
DeadArgElim Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV" 2021-01-25 13:53:38 -08:00
DeadStoreElimination [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
DivRemPairs
EarlyCSE [noalias.decl] Look through llvm.experimental.noalias.scope.decl 2021-01-19 20:09:42 +01:00
EliminateAvailableExternally
EntryExitInstrumenter
ExpandMemCmp
FixIrreducible [FixIrreducible][NewPM] Port -fix-irreducible to NPM 2020-10-09 09:22:09 -07:00
Float2Int
ForcedFunctionAttrs
FunctionAttrs [ValueTracking] Don't assume readonly function will return 2021-01-24 10:40:21 +01:00
FunctionImport [CGProfile] allows bitcast in metadata node storing function pointers 2020-11-13 09:28:21 -08:00
GCOVProfiling
GVN [GVN] do not repeat PRE on failure to split critical edge 2021-01-25 11:23:44 -08:00
GVNHoist [ValueTracking] Don't assume readonly function will return 2021-01-24 10:40:21 +01:00
GVNSink [SimplifyCFG] Teach HoistThenElseCodeToIf() to preserve DomTree 2020-12-30 00:48:10 +03:00
GlobalDCE [SimplifyCFG] MergeBlockIntoPredecessor() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
GlobalMerge
GlobalOpt Fix for Bug 48055. 2020-12-04 11:05:01 -08:00
GlobalSplit
GuardWidening
HardwareLoops [ARM] Remove LLC tests from transform/hardware loop tests. 2021-01-16 18:30:21 +00:00
HelloNew
HotColdSplit [HotColdSplit] Reflect full cost of parameters in split penalty 2020-12-18 17:06:17 -08:00
IRCE [IRCE] Add test case for PR48051 2020-12-14 12:01:19 +00:00
IROutliner [IROutliner] Adapting to hoisted bitcasts in CodeExtractor 2021-01-13 11:10:37 -06:00
IndVarSimplify [LoopDeletion] Handle inner loops w/untaken backedges 2021-01-22 16:31:29 -08:00
IndirectBrExpand
InferAddressSpaces [NewPM] Port infer-address-spaces 2020-12-28 19:58:12 -08:00
InferFunctionAttrs [FunctionAttrs] Infer willreturn for functions without loops 2021-01-21 20:29:33 +01:00
Inline [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks 2021-01-25 15:38:57 -08:00
InstCombine [InstCombine] narrow min/max intrinsics with extended inputs 2021-01-25 07:52:50 -05:00
InstMerge OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
InstNamer Port -instnamer to NPM 2020-10-22 12:08:36 -07:00
InstSimplify [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
InterleavedAccess [CodeGen] Update transformations to use poison for shufflevector/insertelem's initial vector elem 2021-01-10 18:03:51 +09:00
Internalize
JumpThreading [ValueTracking] Don't assume readonly function will return 2021-01-24 10:40:21 +01:00
LCSSA [DebugInfo] Avoid re-ordering assignments in LCSSA 2020-12-17 16:17:32 +00:00
LICM [InferAttrs] Mark some library functions as willreturn. 2021-01-18 13:40:21 +00:00
LoadStoreVectorizer Precommit transform tests that have poison as insertelement's placeholder 2020-12-24 11:46:17 +09:00
LoopDataPrefetch
LoopDeletion [LoopDeletion] Handle inner loops w/untaken backedges 2021-01-22 16:31:29 -08:00
LoopDistribute [LoopDistribute] Add tests with uncomputable BTCs. 2021-01-01 13:57:03 +00:00
LoopFlatten [test] Fix widen-iv.ll under NPM 2020-12-07 19:34:31 -08:00
LoopFusion [test] Fix LoopFusion tests under NewPM 2020-12-07 17:37:42 -08:00
LoopIdiom [Tests] Added test for memcpy loop idiom recognization 2021-01-13 14:55:46 +01:00
LoopInstSimplify
LoopInterchange Scalar: Don't visit constants in findInnerReductionPhi in LoopInterchange 2021-01-21 12:33:06 -08:00
LoopLoadElim [LoopLoadElim] Add tests with uncomputable BTCs. 2021-01-01 13:57:02 +00:00
LoopPredication
LoopReroll [SCEV] Strength nowrap flags after constant folding 2020-10-25 18:00:22 +01:00
LoopRotate [LoopRotate] Use llvm.experimental.noalias.scope.decl for duplicating noalias metadata as needed 2021-01-24 13:53:13 +01:00
LoopSimplify Precommit tests that have poison as shufflevector's placeholder 2020-12-29 17:09:31 +09:00
LoopSimplifyCFG [LoopSimplifyCFG][NewPM] Rename simplify-cfg -> loop-simplifycfg 2020-09-21 08:27:19 -07:00
LoopStrengthReduce [LSR] Drop potentially invalid nowrap flags when switching to post-inc IV (PR46943) 2021-01-25 23:13:48 +01:00
LoopTransformWarning
LoopUnroll [LoopUnroll] Use llvm.experimental.noalias.scope.decl for duplicating noalias metadata as needed 2021-01-24 13:48:20 +01:00
LoopUnrollAndJam [NPM] Share pass building options with legacy PM 2020-11-23 13:04:05 -08:00
LoopUnswitch [LoopUnswitch] Fix logic to avoid unswitching with atomic loads. 2021-01-22 15:10:12 +00:00
LoopVectorize [CostModel] Tests for showing the cost of intrinsics from the vectorizer. NFC 2021-01-24 14:47:15 +00:00
LoopVersioning Revert "[BasicAA] Handle two unknown sizes for GEPs" 2020-12-18 17:59:12 +00:00
LoopVersioningLICM [NewPM][opt] Run the "default" AA pipeline by default 2021-01-21 21:08:54 -08:00
LowerAtomic
LowerConstantIntrinsics
LowerExpectIntrinsic Revert "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2020-11-14 13:12:38 +03:00
LowerGuardIntrinsic
LowerInvoke
LowerMatrixIntrinsics [Matrix] Propagate shape information through fneg 2021-01-22 14:34:28 -08:00
LowerSwitch
LowerTypeTests [FileCheck] Enforce --allow-unused-prefixes=false for llvm/test/Transforms 2020-12-09 08:51:38 -08:00
LowerWidenableCondition
MakeGuardsExplicit
Mem2Reg
MemCpyOpt [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
MergeFunc OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
MergeICmps [MergeICmps] Fix missing split. 2020-12-01 16:50:55 +01:00
MetaRenamer OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
NameAnonGlobals [NPM] Move more O0 pass building into PassBuilder 2020-11-19 11:22:23 -08:00
NaryReassociate [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions 2020-12-04 16:17:50 +07:00
NewGVN [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
ObjCARC Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV" 2021-01-25 13:53:38 -08:00
OpenMP [ValueTracking] Don't assume readonly function will return 2021-01-24 10:40:21 +01:00
PGOProfile [SimplifyCFG] Teach FoldValueComparisonIntoPredecessors() to preserve DomTree, part 2 2021-01-01 03:25:24 +03:00
PartialInlining [PartialInliner]: Handle code regions in a switch stmt cases 2020-11-02 14:32:45 -05:00
PartiallyInlineLibCalls
PhaseOrdering [InstCombine] Remove unused llvm.experimental.noalias.scope.decl 2021-01-24 13:55:50 +01:00
PlaceSafepoints [PlaceSafepoints] Pin tests to legacy PM 2020-10-26 20:07:37 -07:00
PreISelIntrinsicLowering
PruneEH [FuncAttrs] Infer noreturn 2021-01-05 13:25:42 -08:00
Reassociate [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
Reg2Mem [Reg2Mem] add support for the new pass manager 2020-11-08 11:14:05 +00:00
RewriteStatepointsForGC [IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder 2020-12-30 04:21:04 +09:00
SCCP [PredicateInfo] Handle logical and/or 2021-01-20 21:03:07 +01:00
SLPVectorizer [SLP] fix fast-math requirements for fmin/fmax reductions 2021-01-24 08:55:56 -05:00
SROA Use unary CreateShuffleVector if possible 2020-12-30 22:36:08 +09:00
SafeStack OpaquePtr: Bulk update tests to use typed byval 2020-11-20 14:00:46 -05:00
SampleProfile [SampleFDO] Report error when reading a bad/incompatible profile instead of 2021-01-25 10:28:23 -08:00
ScalarizeMaskedMemIntrin
Scalarizer [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
SeparateConstOffsetFromGEP [NewPM] Port -separate-const-offset-from-gep 2020-11-09 17:42:36 -08:00
SimpleLoopUnswitch [NewPM] Only non-trivially loop unswitch at -O3 and for non-optsize functions 2021-01-13 14:54:49 -08:00
SimplifyCFG [SimplifyCFG] Regenerate test checks (NFC) 2021-01-23 21:24:54 +01:00
Sink Sink: Handle instruction sink when a user is dead 2020-10-09 16:20:26 -07:00
SpeculateAroundPHIs
SpeculativeExecution Precommit tests that have poison as shufflevector's placeholder 2020-12-29 17:09:31 +09:00
StraightLineStrengthReduce [NPM] Add remaining test of -slsr 2020-11-17 14:41:01 +08:00
StripDeadPrototypes
StripSymbols
StructurizeCFG [test] Pin backedge-id-bug-xfail.ll to legacy PM 2021-01-04 13:09:42 -08:00
SyntheticCountsPropagation
TailCallElim OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
ThinLTOBitcodeWriter [NewPM][opt] Run the "default" AA pipeline by default 2021-01-21 21:08:54 -08:00
TypePromotion/ARM
UnifyFunctionExitNodes [NPM] Port -mergereturn to NPM 2020-10-20 10:33:58 -07:00
UnifyLoopExits [NPM] port -unify-loop-exits to NPM 2020-10-20 10:46:57 -07:00
UniqueInternalLinkageNames Add sample-profile-suffix-elision-policy attribute with -funique-internal-linkage-names. 2021-01-12 15:15:53 -08:00
Util [PredicateInfo] Handle logical and/or 2021-01-20 21:03:07 +01:00
VectorCombine [Constant] Update ConstantVector::get to return poison if all input elems are poison 2021-01-07 09:26:07 +09:00
WholeProgramDevirt [WholeProgramDevirt][NewPM] Add NPM testing path to match legacy pass 2020-09-30 17:27:37 -07:00