15 #ifndef LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H 16 #define LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H 27 template <
typename T>
class ArrayRef;
28 template <
typename T>
class MutableArrayRef;
31 class ModuleSummaryIndex;
44 if (Bytes.size() < Pos +
Size) {
45 Bytes.resize(Pos + Size);
46 BytesUsed.resize(Pos + Size);
48 return std::make_pair(Bytes.data() + Pos, BytesUsed.data() + Pos);
53 void setLE(uint64_t Pos, uint64_t Val, uint8_t
Size) {
56 for (
unsigned I = 0;
I !=
Size; ++
I) {
57 DataUsed.first[
I] = Val >> (
I * 8);
59 DataUsed.second[
I] = 0xff;
65 void setBE(uint64_t Pos, uint64_t Val, uint8_t
Size) {
68 for (
unsigned I = 0;
I !=
Size; ++
I) {
69 DataUsed.first[Size -
I - 1] = Val >> (
I * 8);
70 assert(!DataUsed.second[Size -
I - 1]);
71 DataUsed.second[Size -
I - 1] = 0xff;
79 *DataUsed.first |= 1 << (Pos % 8);
80 assert(!(*DataUsed.second & (1 << Pos % 8)));
81 *DataUsed.second |= 1 << (Pos % 8);
91 uint64_t ObjectSize = 0;
112 return Bits < other.
Bits || (Bits == other.
Bits && Offset < other.
Offset);
122 : Fn(nullptr), TM(TM), IsBigEndian(IsBigEndian), WasDevirt(
false) {}
168 assert(Pos >= 8 * minBeforeBytes());
174 assert(Pos >= 8 * minAfterBytes());
182 assert(Pos >= 8 * minBeforeBytes());
191 assert(Pos >= 8 * minAfterBytes());
209 uint64_t AllocBefore,
unsigned BitWidth,
210 int64_t &OffsetByte, uint64_t &OffsetBit);
216 uint64_t AllocAfter,
unsigned BitWidth,
217 int64_t &OffsetByte, uint64_t &OffsetBit);
226 : ExportSummary(ExportSummary), ImportSummary(ImportSummary) {
227 assert(!(ExportSummary && ImportSummary));
234 #endif // LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
const ModuleSummaryIndex * ImportSummary
This class represents lattice values for constants.
void setBit(uint64_t Pos, bool b)
std::vector< uint8_t > BytesUsed
A Module instance is used to store all the information related to an LLVM module. ...
void setAfterReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocAfter, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
WholeProgramDevirtPass(ModuleSummaryIndex *ExportSummary, const ModuleSummaryIndex *ImportSummary)
void setBeforeReturnValues(MutableArrayRef< VirtualCallTarget > Targets, uint64_t AllocBefore, unsigned BitWidth, int64_t &OffsetByte, uint64_t &OffsetBit)
uint64_t minAfterBytes() const
A CRTP mix-in to automatically provide informational APIs needed for passes.
void setAfterBytes(uint64_t Pos, uint8_t Size)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Class to hold module path string table and global value map, and encapsulate methods for operating on...
VirtualCallTarget(const TypeMemberInfo *TM, bool IsBigEndian)
void setBeforeBytes(uint64_t Pos, uint8_t Size)
A set of analyses that are preserved following a run of a transformation pass.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
uint64_t allocatedBeforeBytes() const
Module.h This file contains the declarations for the Module class.
void setBeforeBit(uint64_t Pos)
void setBE(uint64_t Pos, uint64_t Val, uint8_t Size)
ModuleSummaryIndex * ExportSummary
std::vector< uint8_t > Bytes
uint64_t findLowestOffset(ArrayRef< VirtualCallTarget > Targets, bool IsAfter, uint64_t Size)
void setAfterBit(uint64_t Pos)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint64_t minBeforeBytes() const
std::pair< uint8_t *, uint8_t * > getPtrToData(uint64_t Pos, uint8_t Size)
const TypeMemberInfo * TM
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
bool operator<(const TypeMemberInfo &other) const
uint64_t allocatedAfterBytes() const
void setLE(uint64_t Pos, uint64_t Val, uint8_t Size)