llvm-project/llvm/lib/Transforms/IPO
modimo 20faf78919 [ThinLTO] Add noRecurse and noUnwind thinlink function attribute propagation
Thinlink provides an opportunity to propagate function attributes across modules, enabling additional propagation opportunities.

This change propagates (currently default off, turn on with `disable-thinlto-funcattrs=1`) noRecurse and noUnwind based off of function summaries of the prevailing functions in bottom-up call-graph order. Testing on clang self-build:
1. There's a 35-40% increase in noUnwind functions due to the additional propagation opportunities.
2. Throughput is measured at 10-15% increase in thinlink time which itself is 1.5% of E2E link time.

Implementation-wise this adds the following summary function attributes:
1. noUnwind: function is noUnwind
2. mayThrow: function contains a non-call instruction that `Instruction::mayThrow` returns true on (e.g. windows SEH instructions)
3. hasUnknownCall: function contains calls that don't make it into the summary call-graph thus should not be propagated from (e.g. indirect for now, could add no-opt functions as well)

Testing:
Clang self-build passes and 2nd stage build passes check-all
ninja check-all with newly added tests passing

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D36850
2021-09-27 12:28:07 -07:00
..
AlwaysInliner.cpp [coroutine] should disable inline before calling coro split 2020-12-08 08:53:08 -08:00
Annotation2Metadata.cpp Add pass to add !annotate metadata from @llvm.global.annotations. 2020-11-16 14:57:11 +00:00
ArgumentPromotion.cpp [IR] Return AAMDNodes from Instruction::getMetadata() (NFC) 2021-09-16 21:06:57 +02:00
Attributor.cpp [NFC] Use newly introduced *AtIndex methods 2021-09-01 11:18:41 -07:00
AttributorAttributes.cpp Attributor: Fix crash on undef in !callees 2021-09-14 19:49:34 -04:00
BarrierNoopPass.cpp
BlockExtractor.cpp Internalize some cl::opt global variables or move them under namespace llvm 2021-05-07 11:15:43 -07:00
CMakeLists.txt [OpenMP][OpenMPIRBuilder] Implement loop unrolling. 2021-09-04 19:18:58 -05:00
CalledValuePropagation.cpp
ConstantMerge.cpp [IPO] Use make_early_inc_range (NFC) 2021-09-14 08:59:36 -07:00
CrossDSOCFI.cpp
DeadArgumentElimination.cpp [IPO] Use make_early_inc_range (NFC) 2021-09-14 08:59:36 -07:00
ElimAvailExtern.cpp
ExtractGV.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
ForceFunctionAttrs.cpp [ForceFunctionAttrs] Add const (NFC) 2021-09-03 22:29:58 -07:00
FunctionAttrs.cpp [ThinLTO] Add noRecurse and noUnwind thinlink function attribute propagation 2021-09-27 12:28:07 -07:00
FunctionImport.cpp [ThinLTO] Add noRecurse and noUnwind thinlink function attribute propagation 2021-09-27 12:28:07 -07:00
FunctionSpecialization.cpp [FuncSpec] Don't specialise (or crash) on poison or constexpr values 2021-09-27 14:58:53 +01:00
GlobalDCE.cpp [GlobalDCE] Handle relative pointers in VFE (for Swift vtables) 2021-08-31 07:07:22 -07:00
GlobalOpt.cpp [GlobalOpt] Do not shrink global to bool for an unfavorable AS 2021-09-16 23:13:30 -04:00
GlobalSplit.cpp
HotColdSplitting.cpp Calculate getTerminator only when necessary 2021-06-13 20:16:07 -07:00
IPO.cpp Function Specialization Pass 2021-06-11 09:11:29 +01:00
IROutliner.cpp Fix Wdocumentation warnings. NFCI. 2021-09-17 12:45:56 +01:00
InferFunctionAttrs.cpp [inferattrs] Don't infer lib func attributes for nobuiltin functions 2021-04-16 15:36:15 -07:00
InlineSimple.cpp
Inliner.cpp [ModuleInlinerWrapperPass] Do some naive printing of wrapped pipeline with -print-pipeline-passes 2021-09-23 09:54:42 +02:00
Internalize.cpp [IR] Rename `comdat noduplicates` to `comdat nodeduplicate` 2021-07-20 12:47:10 -07:00
LoopExtractor.cpp [NPM] Added -print-pipeline-passes print params for a few passes. 2021-09-15 08:34:04 +02:00
LowerTypeTests.cpp [LTT] Handle merged llvm.assume when dropping type tests 2021-05-25 17:02:13 -07:00
MergeFunctions.cpp [OpaquePtr] Use GlobalValue::getValueType() more 2021-07-13 09:34:34 -07:00
OpenMPOpt.cpp [OpenMP][FIX] Be more deliberate about invalidating the AAKernelInfo state 2021-09-23 00:04:30 -05:00
PartialInlining.cpp NFC: Migrate PartialInlining to work on InstructionCost 2021-03-30 11:59:45 +01:00
PassManagerBuilder.cpp [Passes] Run vector-combine early with -fenable-matrix. 2021-09-22 12:48:32 +01:00
PruneEH.cpp [Local] Do not introduce a new `llvm.trap` before `unreachable` 2021-07-26 23:33:36 -05:00
SCCP.cpp Function Specialization Pass 2021-06-11 09:11:29 +01:00
SampleContextTracker.cpp [CSSPGO] Honor preinliner decision for ThinLTO importing 2021-09-02 17:29:26 -07:00
SampleProfile.cpp [SamplePGO] Add switch to honor zero count on block level as accurate 2021-09-21 17:06:37 -07:00
SampleProfileProbe.cpp [CSSPGO] Undoing the concept of dangling pseudo probe 2021-06-18 15:14:11 -07:00
StripDeadPrototypes.cpp [IPO] Use make_early_inc_range (NFC) 2021-09-14 08:59:36 -07:00
StripSymbols.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
SyntheticCountsPropagation.cpp Internalize some cl::opt global variables or move them under namespace llvm 2021-05-07 11:15:43 -07:00
ThinLTOBitcodeWriter.cpp [Transforms] Use make_early_inc_range (NFC) 2021-09-15 19:55:24 -07:00
WholeProgramDevirt.cpp [NFC] Replace Function handling of attributes with less confusing calls 2021-08-17 21:05:40 -07:00