1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/lib/IR
Jianzhou Zhao b6143710cb Reduce dropTriviallyDeadConstantArrays cumulative time percentage from 17% to 4%
The history of dropTriviallyDeadConstantArrays is like this. Because the appending linkage uses too much memory (http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150105/251381.html), dropTriviallyDeadConstantArrays was introduced (https://reviews.llvm.org/rG81f385b0c6ea37dd7195a65be162c75bbdef29d2) to release unused constant arrays. Recently, dropTriviallyDeadConstantArrays was improved (https://reviews.llvm.org/rG81f385b0c6ea37dd7195a65be162c75bbdef29d2) to reduce its quadratic cost.

Our recent LTO profiling shows that when a target is large, 15-20% of time cost is from the SetVector::insert called by dropTriviallyDeadConstantArrays.

A large application has hundreds or thousands of modules; each module calls dropTriviallyDeadConstantArrays once for cleaning up tens of thousands of ConstantArrays a module has. In those ConstantArrays, usually around 5 can be deleted; a very very few deleted ConstantArrays reference other ConstantArrays: less than 10 out of millions.

Given this, the cost of SetVector::insert is mainly from the construction of WorkList from ArrayConstants. This motivated the fix that iterates ArrayConstants directly, and uses WorkList only when necessary.

Our evaluation shows that
1) The cumulative time percentage of dropTriviallyDeadConstantArrays is reduced from 15-17% to 4-6%.
2) For targets with LTO time > 20min, the time reduction is about 20%.
3) No observable performance impact for build without using LTO.

{F12506218}
{F12506221}

Reviewed By: mehdi_amini, tejohnson, jdoerfert

Differential Revision: https://reviews.llvm.org/D85379
2020-08-07 11:36:30 -07:00
..
AbstractCallSite.cpp Remove getNumUses() comparisons (NFC) 2020-05-02 11:05:19 +02:00
AsmWriter.cpp [DebugInfo] Support for DW_AT_associated and DW_AT_allocated. 2020-07-20 19:54:35 +05:30
AttributeImpl.h IR: Define byref parameter attribute 2020-07-20 10:23:09 -04:00
Attributes.cpp IR: Define byref parameter attribute 2020-07-20 10:23:09 -04:00
AutoUpgrade.cpp [X86] getX86MaskVec - replace mask limit from NumElts < 8 with NumElts <= 4 2020-08-06 11:46:19 +01:00
BasicBlock.cpp Revert "[IR] Clean up dead instructions after simplifying a conditional branch" 2020-06-16 10:32:15 +01:00
CMakeLists.txt [NFC] Split Knowledge retention and place it more appropriatly 2020-04-02 15:01:41 +02:00
Comdat.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstantFold.cpp Revert "[InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X transforms" and subsequent patches 2020-07-15 22:02:33 -07:00
ConstantFold.h Remove "mask" operand from shufflevector. 2020-03-31 13:08:59 -07:00
ConstantRange.cpp [ConstantRange][CVP] Make use of abs poison flag 2020-07-30 23:06:10 +02:00
Constants.cpp [SVE] Make Constant::getSplatValue work for scalable vector splats 2020-07-07 13:45:51 -07:00
ConstantsContext.h [IR] Add classof methods to ConstantExpr subclasses. 2020-07-01 11:56:12 -07:00
Core.cpp Remove GlobalValue::getAlignment(). 2020-06-23 19:13:42 -07:00
DataLayout.cpp [XCOFF][AIX] Use 'L..' instead of '.L' for getPrivateGlobalPrefix in DataLayout 2020-07-03 18:25:14 +00:00
DebugInfo.cpp Pass stripNonLineTableDebugInfo remapDebugLoc lambda DebugLoc arg by const reference not value. 2020-07-01 12:37:47 +01:00
DebugInfoMetadata.cpp [DebugInfo] Support for DW_AT_associated and DW_AT_allocated. 2020-07-20 19:54:35 +05:30
DebugLoc.cpp Pass DebugLoc::appendInlinedAt DebugLoc arg by const reference not value. 2020-07-01 16:38:51 +01:00
DiagnosticHandler.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DiagnosticInfo.cpp [NFC] Remove trailing space 2020-02-18 10:49:13 +08:00
DiagnosticPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DIBuilder.cpp [DebugInfo] Upgrade DISubrange to support Fortran dynamic arrays 2020-05-28 13:46:41 +05:30
Dominators.cpp Reapply "[DomTree] Replace ChildrenGetter with GraphTraits over GraphDiff." 2020-07-24 14:10:50 -07:00
FPEnv.cpp Fix some clang-tidy namespace closing comments warnings. NFC. 2020-06-26 09:58:21 +01:00
Function.cpp [InstCombine] Move target-specific inst combining 2020-07-22 15:59:49 +02:00
Globals.cpp Remove GlobalValue::getAlignment(). 2020-06-23 19:13:42 -07:00
GVMaterializer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InlineAsm.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Instruction.cpp [Instruction] Remove setProfWeight() 2020-06-04 15:10:55 +07:00
Instructions.cpp [IR] Add a few asserts to provide a better failure signature if you try to create a load/store/alloca with no alignment or insertion position 2020-07-14 18:47:44 -07:00
IntrinsicInst.cpp [VP][Fix] canIgnoreVectorLength for scalable types 2020-06-04 14:17:42 +02:00
IRBuilder.cpp [IR] Add IRBuilderBase::CreateVectorSplat(ElementCount EC) variant 2020-08-02 16:55:38 +01:00
IRPrintingPasses.cpp IRPrintingPasses.h - simplify unnecessary header with forward declarations. NFC. 2020-07-27 14:51:28 +01:00
LegacyPassManager.cpp [OldPM] Print out a bit more when passes lie about changing IR 2020-07-28 10:01:24 -06:00
LLVMBuild.txt [Remarks] Add string deduplication using a string table 2019-04-24 00:06:24 +00:00
LLVMContext.cpp Introduce a "gc-live" bundle for the gc arguments of a statepoint 2020-06-03 15:00:24 -07:00
LLVMContextImpl.cpp Reduce dropTriviallyDeadConstantArrays cumulative time percentage from 17% to 4% 2020-08-07 11:36:30 -07:00
LLVMContextImpl.h [NFC][APInt][DenseMapInfo] Move DenseMapAPIntKeyInfo into DenseMap.h as DenseMapInfo<APInt> 2020-08-03 23:31:13 +09:00
LLVMRemarkStreamer.cpp Avoid including FileSystem.h from MemoryBuffer.h 2020-02-29 12:30:23 -08:00
Mangler.cpp IR: Rename Argument::hasPassPointeeByValueAttr to prepare for byref 2020-07-16 13:50:49 -04:00
MDBuilder.cpp [MDBuilder] Don't use stable sort for sorting integers. 2020-03-28 21:19:46 +01:00
Metadata.cpp [IR] Avoid linear scan in MDNode::intersect() (NFC) 2020-05-28 19:38:46 +02:00
MetadataImpl.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Module.cpp [PGO] Improve the working set size heuristics under the partial sample PGO. 2020-06-01 10:29:23 -07:00
ModuleSummaryIndex.cpp [ThinLTO] Compile time improvement to propagateAttributes 2020-07-31 10:54:02 -07:00
Operator.cpp Fix some clang-tidy namespace closing comments warnings. NFC. 2020-06-26 09:58:21 +01:00
OptBisect.cpp Fix IR/Analysis layering issue with OptBisect 2019-02-28 04:00:55 +00:00
Pass.cpp [Pass] Ensure we don't include PassSupport.h or PassAnalysisSupport.h directly 2020-04-26 12:58:20 +01:00
PassInstrumentation.cpp [NewPM][PassInstrument] Add PrintPass callback to StandardInstrumentations 2020-07-30 10:07:57 -07:00
PassManager.cpp Revert rG5dd566b7c7b78bd- "PassManager.h - remove unnecessary Function.h/Module.h includes. NFCI." 2020-07-24 13:02:33 +01:00
PassRegistry.cpp [Pass] Ensure we don't include PassSupport.h or PassAnalysisSupport.h directly 2020-04-26 12:58:20 +01:00
PassTimingInfo.cpp [NewPM][PassInstrument] Add PrintPass callback to StandardInstrumentations 2020-07-30 10:07:57 -07:00
ProfileSummary.cpp ProfileSummary.cpp - fix implicit Format.h dependency. NFC. 2020-06-23 09:43:40 +01:00
SafepointIRVerifier.cpp Fix some clang-tidy namespace closing comments warnings. NFC. 2020-06-26 09:58:21 +01:00
Statepoint.cpp [Statepoint] Start the process of removing old interfaces 2020-06-03 20:00:52 -07:00
SymbolTableListTraitsImpl.h [IR] Lazily number instructions for local dominance queries 2020-02-18 14:44:24 -08:00
Type.cpp [SVE] Reject vector struct indexes for scalable vectors. 2020-06-30 13:52:38 -07:00
TypeFinder.cpp [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
Use.cpp [IR] Simplify Use::swap. NFCI. 2020-07-21 12:15:12 +01:00
User.cpp [NFC] Edit the comment in User::replaceUsesOfWith 2020-07-29 10:02:04 +08:00
Value.cpp [SROA][Mem2Reg] Use efficient droppable use API (after D83976) 2020-07-28 17:41:01 -05:00
ValueSymbolTable.cpp NFC: Clean up the implementation of StringPool a bit, and remove dependence on some "implicitly MallocAllocator" based methods on StringMapEntry. This allows reducing the #includes in StringMapEntry.h. 2020-04-12 16:37:17 -07:00
Verifier.cpp [Intrinsic] Add sshl.sat/ushl.sat, saturated shift intrinsics. 2020-08-07 15:09:24 +02:00