llvm-project/llvm/lib
Bjorn Pettersson 985b9b7e42 [PM] Avoid duplicates in the Used/Preserved/Required sets
The pass analysis uses "sets" implemented using a SmallVector type
to keep track of Used, Preserved, Required and RequiredTransitive
passes. When having nested analyses we could end up with duplicates
in those sets, as there was no checks to see if a pass already
existed in the "set" before pushing to the vectors. This idea with
this patch is to avoid such duplicates by avoiding pushing elements
that already is contained when adding elements to those sets.

To align with the above PMDataManager::collectRequiredAndUsedAnalyses
is changed to skip adding both the Required and RequiredTransitive
passes to its result vectors (since RequiredTransitive always is
a subset of Required we ended up with duplicates when traversing
both sets).

Main goal with this is to avoid spending time verifying the same
analysis mulitple times in PMDataManager::verifyPreservedAnalysis
when iterating over the Preserved "set". It is assumed that removing
duplicates from a "set" shouldn't have any other negative impact
(I have not seen any problems so far). If this ends up causing
problems one could do some uniqueness filtering of the vector being
traversed in verifyPreservedAnalysis instead.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D94416
2021-01-20 13:55:18 +01:00
..
Analysis [llvm] Use llvm::all_of (NFC) 2021-01-19 20:19:17 -08:00
AsmParser [X86] Add x86_amx type for intel AMX. 2020-12-30 13:52:13 +08:00
BinaryFormat [Debuginfo][DW_OP_implicit_pointer] (1/7) Support for DW_OP_LLVM_implicit_pointer 2021-01-15 14:45:04 +05:30
Bitcode [llvm] Use llvm::sort (NFC) 2021-01-17 10:39:45 -08:00
Bitstream [llvm] Use llvm::append_range (NFC) 2021-01-06 18:27:33 -08:00
CodeGen [AMDGPU][GlobalISel] Avoid selecting S_PACK with constants 2021-01-20 11:54:53 +01:00
DWARFLinker [llvm] Use llvm::sort (NFC) 2021-01-17 10:39:45 -08:00
DebugInfo [llvm] Use llvm::all_of (NFC) 2021-01-19 20:19:17 -08:00
Demangle [llvm] Remove redundant return and continue statements (NFC) 2021-01-14 20:30:34 -08:00
ExecutionEngine [ORC] Move LookupRequest from OrcShared to Orc. 2021-01-19 20:23:47 +11:00
Extensions
FileCheck [llvm] Use llvm::sort (NFC) 2021-01-17 10:39:45 -08:00
Frontend [OpenMPOpt][WIP] Expand parallel region merging 2021-01-11 08:06:23 -08:00
FuzzMutate
Fuzzer
IR [PM] Avoid duplicates in the Used/Preserved/Required sets 2021-01-20 13:55:18 +01:00
IRReader
InterfaceStub [llvm-elfabi] Add flag to preserve timestamp when output is the same 2020-12-29 20:27:06 -08:00
LTO [LTO] Remove options to disable inlining, vectorization & GVNLoadPRE. 2021-01-16 16:29:15 +00:00
LineEditor
Linker [ExecutionEngine, Linker] Use erase_if (NFC) 2020-12-23 21:44:39 -08:00
MC Revert "[WebAssembly] call_indirect issues table number relocs" 2021-01-19 15:06:07 -08:00
MCA [llvm] Use llvm::find (NFC) 2021-01-19 20:19:14 -08:00
Object [WebAssembly] Change prefix on data segment flags to WASM_DATA_SEGMENT 2021-01-19 09:40:42 +01:00
ObjectYAML [WebAssembly] Change prefix on data segment flags to WASM_DATA_SEGMENT 2021-01-19 09:40:42 +01:00
Option [llvm] Simplify string comparisons (NFC) 2021-01-11 18:48:09 -08:00
Passes [LoopRotate] Add PrepareForLTO stage, avoid rotating with inline cands. 2021-01-19 10:15:29 +00:00
ProfileData [SampleFDO] Add the support to split the function profiles with context into 2021-01-19 15:16:19 -08:00
Remarks
Support [llvm] Use llvm::any_of (NFC) 2021-01-19 20:19:16 -08:00
TableGen [TableGen] Enhance !cast<string> to handle bit and bits types. 2021-01-14 10:20:35 -05:00
Target [AArch64] Add missing "flagm" feature to the .arch_extension directive. 2021-01-20 11:57:39 +00:00
Testing
TextAPI [llvm] Use llvm::sort (NFC) 2021-01-17 10:39:45 -08:00
ToolDrivers
Transforms [Coroutine] Remain alignment information when merging frame variables 2021-01-20 18:59:00 +08:00
WindowsManifest
XRay
CMakeLists.txt