Go to the documentation of this file.
14 #ifndef LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
15 #define LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
29 template <
typename T>
class ArrayRef;
33 class ModuleSummaryIndex;
47 if (
Bytes.size() < Pos + Size) {
48 Bytes.resize(Pos + Size);
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);
73 assert(!DataUsed.second[Size -
I - 1]);
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 Module &M,
bool WholeProgramVisibilityEnabledInLTO,
259 std::map<
ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap);
266 std::map<
ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap);
270 #endif // LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
A set of analyses that are preserved following a run of a transformation pass.
const TypeMemberInfo * TM
void setAfterReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocAfter, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
This is an optimization pass for GlobalISel generic memory operations.
uint64_t findLowestOffset(ArrayRef< VirtualCallTarget > Targets, bool IsAfter, uint64_t Size)
const ModuleSummaryIndex * ImportSummary
A CRTP mix-in to automatically provide informational APIs needed for passes.
uint64_t allocatedBeforeBytes() const
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.
VirtualCallTarget(Function *Fn, const TypeMemberInfo *TM)
VirtualCallTarget(const TypeMemberInfo *TM, bool IsBigEndian)
class LLVM_NODISCARD MutableArrayRef
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
void setBeforeReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocBefore, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int b
uint64_t minBeforeBytes() const
std::vector< uint8_t > BytesUsed
std::pair< uint8_t *, uint8_t * > getPtrToData(uint64_t Pos, uint8_t Size)
Struct that holds a reference to a particular GUID in a global value summary.
void updateVCallVisibilityInIndex(ModuleSummaryIndex &Index, bool WholeProgramVisibilityEnabledInLTO, const DenseSet< GlobalValue::GUID > &DynamicExportSymbols)
If whole program visibility asserted, then upgrade all public vcall visibility metadata on vtable def...
void setBE(uint64_t Pos, uint64_t Val, uint8_t Size)
An efficient, type-erasing, non-owning reference to a callable.
Implements a dense probed hash-table based set.
ModuleSummaryIndex * ExportSummary
void setAfterBit(uint64_t Pos)
void setBeforeBytes(uint64_t Pos, uint8_t Size)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void setBit(uint64_t Pos, bool b)
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...
A Module instance is used to store all the information related to an LLVM module.
WholeProgramDevirtPass(ModuleSummaryIndex *ExportSummary, const ModuleSummaryIndex *ImportSummary)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void updateVCallVisibilityInModule(Module &M, bool WholeProgramVisibilityEnabledInLTO, const DenseSet< GlobalValue::GUID > &DynamicExportSymbols)
If whole program visibility asserted, then upgrade all public vcall visibility metadata on vtable def...
StringRef - Represent a constant reference to a string, i.e.
Machine Check Debug Module
bool operator<(const TypeMemberInfo &other) const
constexpr unsigned BitWidth
void setAfterBytes(uint64_t Pos, uint8_t Size)
uint64_t allocatedAfterBytes() const
Class to hold module path string table and global value map, and encapsulate methods for operating on...
std::vector< uint8_t > Bytes
A container for analyses that lazily runs them and caches their results.
void setBeforeBit(uint64_t Pos)
uint64_t minAfterBytes() const
void setLE(uint64_t Pos, uint64_t Val, uint8_t Size)