14#ifndef LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
15#define LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
33class ModuleSummaryIndex;
36namespace wholeprogramdevirt {
59 for (
unsigned I = 0;
I !=
Size; ++
I) {
60 DataUsed.first[
I] = Val >> (
I * 8);
62 DataUsed.second[
I] = 0xff;
71 for (
unsigned I = 0;
I !=
Size; ++
I) {
72 DataUsed.first[
Size -
I - 1] = Val >> (
I * 8);
74 DataUsed.second[
Size -
I - 1] = 0xff;
82 *DataUsed.first |= 1 << (Pos % 8);
83 assert(!(*DataUsed.second & (1 << Pos % 8)));
84 *DataUsed.second |= 1 << (Pos % 8);
213 int64_t &OffsetByte,
uint64_t &OffsetBit);
220 int64_t &OffsetByte,
uint64_t &OffsetBit);
244 bool WholeProgramVisibilityEnabledInLTO);
246 Module &M,
bool WholeProgramVisibilityEnabledInLTO,
248 bool ValidateAllVtablesHaveTypeInfos,
269 std::map<
ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap);
276 std::map<
ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap);
This file defines the DenseSet and SmallDenseSet classes.
This header defines various interfaces for pass management in LLVM.
Machine Check Debug Module
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A container for analyses that lazily runs them and caches their results.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Implements a dense probed hash-table based set.
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.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
A set of analyses that are preserved following a run of a transformation pass.
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
uint64_t findLowestOffset(ArrayRef< VirtualCallTarget > Targets, bool IsAfter, uint64_t Size)
void setAfterReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocAfter, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
void setBeforeReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocBefore, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
This is an optimization pass for GlobalISel generic memory operations.
bool hasWholeProgramVisibility(bool WholeProgramVisibilityEnabledInLTO)
void updatePublicTypeTestCalls(Module &M, bool WholeProgramVisibilityEnabledInLTO)
void getVisibleToRegularObjVtableGUIDs(ModuleSummaryIndex &Index, DenseSet< GlobalValue::GUID > &VisibleToRegularObjSymbols, function_ref< bool(StringRef)> IsVisibleToRegularObj)
Based on typeID string, get all associated vtable GUIDS that are visible to regular objects.
void updateIndexWPDForExports(ModuleSummaryIndex &Summary, function_ref< bool(StringRef, ValueInfo)> isExported, std::map< ValueInfo, std::vector< VTableSlotSummary > > &LocalWPDTargetsMap)
Call after cross-module importing to update the recorded single impl devirt target names for any loca...
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
void runWholeProgramDevirtOnIndex(ModuleSummaryIndex &Summary, std::set< GlobalValue::GUID > &ExportedGUIDs, std::map< ValueInfo, std::vector< VTableSlotSummary > > &LocalWPDTargetsMap)
Perform index-based whole program devirtualization on the Summary index.
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
void updateVCallVisibilityInModule(Module &M, bool WholeProgramVisibilityEnabledInLTO, const DenseSet< GlobalValue::GUID > &DynamicExportSymbols, bool ValidateAllVtablesHaveTypeInfos, function_ref< bool(StringRef)> IsVisibleToRegularObj)
If whole program visibility asserted, then upgrade all public vcall visibility metadata on vtable def...
void updateVCallVisibilityInIndex(ModuleSummaryIndex &Index, bool WholeProgramVisibilityEnabledInLTO, const DenseSet< GlobalValue::GUID > &DynamicExportSymbols, const DenseSet< GlobalValue::GUID > &VisibleToRegularObjSymbols)
If whole program visibility asserted, then upgrade all public vcall visibility metadata on vtable def...
A CRTP mix-in to automatically provide informational APIs needed for passes.
Struct that holds a reference to a particular GUID in a global value summary.
WholeProgramDevirtPass(ModuleSummaryIndex *ExportSummary, const ModuleSummaryIndex *ImportSummary)
const ModuleSummaryIndex * ImportSummary
ModuleSummaryIndex * ExportSummary
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
void setBit(uint64_t Pos, bool b)
void setBE(uint64_t Pos, uint64_t Val, uint8_t Size)
void setLE(uint64_t Pos, uint64_t Val, uint8_t Size)
std::vector< uint8_t > Bytes
std::pair< uint8_t *, uint8_t * > getPtrToData(uint64_t Pos, uint8_t Size)
std::vector< uint8_t > BytesUsed
bool operator<(const TypeMemberInfo &other) const
uint64_t allocatedAfterBytes() const
VirtualCallTarget(const TypeMemberInfo *TM, bool IsBigEndian)
void setBeforeBit(uint64_t Pos)
void setBeforeBytes(uint64_t Pos, uint8_t Size)
void setAfterBit(uint64_t Pos)
uint64_t allocatedBeforeBytes() const
uint64_t minBeforeBytes() const
void setAfterBytes(uint64_t Pos, uint8_t Size)
uint64_t minAfterBytes() const
const TypeMemberInfo * TM