llvm-project/llvm/lib/IR
Teresa Johnson 96cb97c453 [ThinLTO] Update combined index for SamplePGO indirect calls to locals
In ThinLTO for locals we normally compute the GUID from the name after
prepending the source path to get a unique global id. SamplePGO indirect
call profiles contain the target GUID without this uniquification,
however (unless compiling with -funique-internal-linkage-names).

In order to correctly handle the call edges added to the combined index
for these indirect calls, during importing and bitcode writing we
consult a map of original to full GUID to identify the actual callee.
However, for a large application this was consuming a lot of compile
time as we need to do this repeatedly (especially during importing where
we may traverse call edges multiple times).

To fix this implement a suggestion in one of the FIXME comments, and
actually modify the call edges during a single traversal after the index
is built to perform the fixups once. I combined this fixup with the dead
code analysis performed on the index in order to avoid adding an
additional walk of the index. The dead code analysis is the first
analysis performed on the index.

This reduced the time required for a large thin link with SamplePGO by
about 20%.

No new test added, but I confirmed that there are existing tests that
will fail when no fixup is performed.

Differential Revision: https://reviews.llvm.org/D110374
2021-09-24 12:29:49 -07:00
..
AbstractCallSite.cpp
AsmWriter.cpp [DebugInfo] Enhance DIImportedEntity to accept children entities 2021-09-16 10:41:55 +05:30
Assumptions.cpp [OpenMP] Check OpenMP assumptions on call-sites as well 2021-09-10 14:52:47 -04:00
AttributeImpl.h [Attributes] Use single method to fetch type from AttributeSet (NFC) 2021-07-14 21:10:56 +02:00
Attributes.cpp [NFC] Rename attribute methods that work with indexes 2021-09-01 10:43:14 -07:00
AutoUpgrade.cpp [ARM] Support neon.vld auto-upgrade with opaque pointers 2021-09-11 16:34:32 +02:00
BasicBlock.cpp [IR] Add BasicBlock::isEntryBlock() (NFC) 2021-05-15 12:41:58 +02:00
BuiltinGCs.cpp [GC][NFC] Move GCStrategy from CodeGen to IR 2021-05-13 12:31:59 +07:00
CMakeLists.txt [GC][NFC] Move GCStrategy from CodeGen to IR 2021-05-13 12:31:59 +07:00
Comdat.cpp [IR] Rename `comdat noduplicates` to `comdat nodeduplicate` 2021-07-20 12:47:10 -07:00
ConstantFold.cpp [ConstantFold] ConstantFoldGetElementPtr - use APInt::isNegative() instead of getSExtValue() to support big ints 2021-09-24 18:18:53 +01:00
ConstantFold.h
ConstantRange.cpp [APInt] Normalize naming on keep constructors / predicate methods. 2021-09-09 09:50:24 -07:00
Constants.cpp [IR] Handle constant expressions in containsUndefinedElement() 2021-09-09 22:04:12 +02:00
ConstantsContext.h [IR] Added operator delete to subclasses of User to avoid UB 2021-07-08 11:59:22 +02:00
Core.cpp [NFC][C API] Make LLVMSetInstrParamAlignment's index param type LLVMAttributeIndex 2021-09-07 15:13:45 -07:00
DIBuilder.cpp [DebugInfo] Enhance DIImportedEntity to accept children entities 2021-09-16 10:41:55 +05:30
DataLayout.cpp [SystemZ][z/OS] Add GOFF Support to the DataLayout 2021-09-24 14:09:01 -04:00
DebugInfo.cpp [DebugInfo] Enhance DIImportedEntity to accept children entities 2021-09-16 10:41:55 +05:30
DebugInfoMetadata.cpp [DebugInfo] Enhance DIImportedEntity to accept children entities 2021-09-16 10:41:55 +05:30
DebugLoc.cpp [IR] Delete unused ReplaceLast in DebugLoc::appendInlineAt 2021-01-08 23:28:22 -08:00
DiagnosticHandler.cpp
DiagnosticInfo.cpp Make DiagnosticInfoResourceLimit's limit param required 2021-09-21 15:27:58 -07:00
DiagnosticPrinter.cpp
Dominators.cpp [gvn] Precisely propagate equalities to phi operands 2021-03-08 08:59:00 -08:00
FPEnv.cpp
Function.cpp [IR] Remove unused parameter (NFC) 2021-09-10 18:16:22 +02:00
GCStrategy.cpp [GC][NFC] Make getGCStrategy by name available in IR 2021-08-02 14:26:04 +07:00
GVMaterializer.cpp
Globals.cpp Resolve {GlobalValue,GloalIndirectSymol}::getBaseObject confusion 2021-09-23 09:23:35 -07:00
IRBuilder.cpp [BPF] Use elementtype attribute for preserve.array/struct.index intrinsics 2021-07-17 11:09:18 +02:00
IRPrintingPasses.cpp [NewPM] Support --print-before/after in NPM 2020-12-03 16:52:14 -08:00
InlineAsm.cpp Support unwinding from inline assembly 2021-05-13 19:13:03 +01:00
Instruction.cpp [NFC] More get/removeAttribute() cleanup 2021-08-17 21:05:41 -07:00
Instructions.cpp [IR] Look through bitcast in hasFnAttribute() 2021-09-21 21:57:02 +02:00
IntrinsicInst.cpp [VP] Declaration and docs for vp.select intrinsic 2021-09-02 11:17:14 +02:00
LLVMContext.cpp [OpaquePtr] Forbid mixing typed and opaque pointers 2021-09-10 15:18:23 +02:00
LLVMContextImpl.cpp [OpaquePtr] Forbid mixing typed and opaque pointers 2021-09-10 15:18:23 +02:00
LLVMContextImpl.h [DebugInfo] Enhance DIImportedEntity to accept children entities 2021-09-16 10:41:55 +05:30
LLVMRemarkStreamer.cpp [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
LegacyPassManager.cpp [opt] Error if -debug-pass is specified alongside the new PM 2021-03-02 15:59:28 -08:00
MDBuilder.cpp [CSSPGO] Pseudo probe encoding and emission. 2020-12-10 17:29:28 -08:00
Mangler.cpp [COFF] Force Symbols containing '.' to be quoted 2021-08-30 17:26:57 -04:00
Metadata.cpp [IR] Re-group AAMDNodes relevant interfaces. NFC. 2021-09-21 14:29:33 -04:00
MetadataImpl.h
Module.cpp [PredicateInfo] Use Intrinsic::getDeclaration now that it handles unnamed types. 2021-07-28 19:30:29 +02:00
ModuleSummaryIndex.cpp [ThinLTO] Update combined index for SamplePGO indirect calls to locals 2021-09-24 12:29:49 -07:00
Operator.cpp Partial Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands" 2021-06-24 09:46:38 +01:00
OptBisect.cpp Delay initialization of OptBisect 2021-08-05 09:04:17 -05:00
Pass.cpp [PM] Avoid duplicates in the Used/Preserved/Required sets 2021-01-20 13:55:18 +01:00
PassInstrumentation.cpp [NewPM] Handle passes with params in -print-before/-print-after 2021-07-09 09:27:37 +02:00
PassManager.cpp [NPM] Added opt option -print-pipeline-passes. 2021-09-02 08:23:33 +02:00
PassRegistry.cpp [Analysis, IR] Use *Map::lookup (NFC) 2020-12-29 19:23:24 -08:00
PassTimingInfo.cpp [Time-report] Add a flag -ftime-report={per-pass,per-pass-run} to control the pass timing aggregation 2020-12-08 10:13:19 -08:00
PrintPasses.cpp [IR] Use llvm::is_contained (NFC) 2020-12-08 19:06:37 -08:00
ProfileSummary.cpp
PseudoProbe.cpp [IR] Remove addPseudoProbeAttribute (NFC) 2021-08-26 09:02:26 -07:00
ReplaceConstant.cpp [IR] Simplify createReplacementInstr 2021-06-23 10:47:43 +01:00
SafepointIRVerifier.cpp [llvm] Use append_range (NFC) 2021-01-27 23:25:41 -08:00
Statepoint.cpp [NFC] One more AttributeList::getAttribute(FunctionIndex) -> getFnAttr() 2021-08-13 16:49:05 -07:00
StructuralHash.cpp
SymbolTableListTraitsImpl.h
Type.cpp [OpaquePtr] Forbid mixing typed and opaque pointers 2021-09-10 15:18:23 +02:00
TypeFinder.cpp [IR] Make TypeFinder aware of DIArgList values 2021-05-28 17:09:45 +02:00
Use.cpp
User.cpp Use AssumeInst in a few more places [nfc] 2021-04-06 13:18:53 -07:00
Value.cpp [InstCombine] Improve TryToSinkInstruction with multiple uses 2021-09-21 10:04:04 -04:00
ValueSymbolTable.cpp PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23 2021-07-08 13:37:57 -07:00
Verifier.cpp [Verifier] Try to fix MSVC build 2021-09-20 18:47:25 +02:00