14#ifndef LLVM_TRANSFORMS_IPO_LOWERTYPETESTS_H
15#define LLVM_TRANSFORMS_IPO_LOWERTYPETESTS_H
58 return Bits.size() == 1;
77 auto [MinIt, MaxIt] = std::minmax_element(Offsets.begin(), Offsets.end());
135 std::vector<std::vector<uint64_t>> Fragments;
138 std::vector<uint64_t> FragmentMap;
149 : Fragments(1), FragmentMap(NumObjects), Less(
std::
move(Less)) {}
240 bool UseCommandLine =
false;
249 : ExportSummary(ExportSummary), ImportSummary(ImportSummary) {}
This header defines various interfaces for pass management in LLVM.
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
LLVM_ABI void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
DropTypeTestsPass(lowertypetests::DropTestKind Kind=lowertypetests::DropTestKind::Assume)
LowerTypeTestsPass(ModuleSummaryIndex *ExportSummary, const ModuleSummaryIndex *ImportSummary)
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Class to hold module path string table and global value map, and encapsulate methods for operating on...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
A vector that has set insertion semantics.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
GlobalLayoutBuilder(uint64_t NumObjects, unique_function< bool(uint64_t, uint64_t)> Less=nullptr)
Construct a layout builder for NumObjects objects.
LLVM_ABI const std::vector< uint64_t > & build()
Flatten fragments into a single layout and return it.
LLVM_ABI void addFragment(const std::set< uint64_t > &F)
Add F to the layout while trying to keep its indices contiguous.
This class implements an extremely fast bulk output stream that can only output to a stream.
unique_function is a type-erasing functor similar to std::function.
LLVM_ABI SetVector< uint64_t > findCfiTypeIds(const Module &M)
Finds all 64-bit numeric type identifiers in M used for cross-DSO CFI.
DropTestKind
Specifies how to drop type tests.
@ All
Drop only llvm.assumes using type test value.
LLVM_ABI void createCfiMetadata(Module &DestM, const Module &SrcM, ArrayRef< GlobalValue * > CfiFunctions)
Creates cfi.functions, aliases, and symvers named metadata in DestM for CFI functions in CfiFunctions...
LLVM_ABI bool isJumpTableCanonical(Function *F)
LLVM_ABI bool hasTypeMetadata(const GlobalObject &GO)
Returns whether a global or its associated global has attached type metadata.
LLVM_ABI SetVector< GlobalValue * > findCfiFunctions(Module &M)
Finds all functions and aliases in M that may need CFI jump table entries.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Implement std::hash so that hash_code can be used in STL containers.
A CRTP mix-in for passes that can be skipped.
A CRTP mix-in for passes that should not be skipped.
LLVM_ABI BitSetInfo build()
SmallVector< uint64_t, 16 > Offsets
BitSetBuilder(ArrayRef< uint64_t > Offsets)
LLVM_ABI bool containsGlobalOffset(uint64_t Offset) const
LLVM_ABI void print(raw_ostream &OS) const
std::set< uint64_t > Bits
bool isSingleOffset() const
uint64_t BitAllocs[BitsPerByte]
The number of bytes allocated so far for each of the bits.
std::vector< uint8_t > Bytes
The byte array built so far.
LLVM_ABI void allocate(const std::set< uint64_t > &Bits, uint64_t BitSize, uint64_t &AllocByteOffset, uint8_t &AllocMask)
Allocate BitSize bits in the byte array where Bits contains the bits to set.