16#include "llvm/Config/llvm-config.h"
37 bool addCurrentAddress)
39 PCAdjust(PCAdj), Modifier(modifier),
40 AddCurrentAddress(addCurrentAddress) {}
46 bool addCurrentAddress)
48 LabelId(id), Kind(kind), PCAdjust(PCAdj), Modifier(modifier),
49 AddCurrentAddress(addCurrentAddress) {}
82 ID.AddInteger(LabelId);
83 ID.AddInteger(PCAdjust);
88 if (ACPV->Kind == Kind &&
89 ACPV->PCAdjust == PCAdjust &&
90 ACPV->Modifier == Modifier &&
91 ACPV->LabelId == LabelId &&
92 ACPV->AddCurrentAddress == AddCurrentAddress) {
101#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
103 errs() <<
" " << *
this;
110 O <<
"-(LPC" << LabelId <<
"+" << (
unsigned)PCAdjust;
111 if (AddCurrentAddress) O <<
"-.";
120ARMConstantPoolConstant::ARMConstantPoolConstant(
Type *Ty,
126 bool AddCurrentAddress)
130ARMConstantPoolConstant::ARMConstantPoolConstant(
const Constant *
C,
135 bool AddCurrentAddress)
140ARMConstantPoolConstant::ARMConstantPoolConstant(
const GlobalVariable *GV,
178 bool AddCurrentAddress) {
184 return dyn_cast_or_null<GlobalValue>(CVal);
188 return dyn_cast_or_null<BlockAddress>(CVal);
194 getExistingMachineCPValueImpl<ARMConstantPoolConstant>(CP, Alignment);
197 CP->getConstants()[index].Val.MachineCPVal);
198 auto *
Constant = cast<ARMConstantPoolConstant>(CPV);
199 Constant->GVars.insert(GVars.begin(), GVars.end());
211 for (
const auto *GV : GVars)
226 unsigned id,
unsigned char PCAdj,
228 bool AddCurrentAddress)
235 unsigned char PCAdj) {
241 return getExistingMachineCPValueImpl<ARMConstantPoolSymbol>(CP, Alignment);
265 unsigned id,
unsigned char PCAdj,
267 bool AddCurrentAddress)
269 Modifier, AddCurrentAddress),
275 unsigned char PCAdj) {
281 return getExistingMachineCPValueImpl<ARMConstantPoolMBB>(CP, Alignment);
286 return ACPMBB && ACPMBB->MBB == MBB &&
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file defines a hash set that can be used to remove duplication of nodes in a graph.
static SymbolRef::Type getType(const Symbol *Sym)
ARMConstantPoolConstant - ARM-specific constant pool values for Constants, Functions,...
const GlobalValue * getGV() const
static ARMConstantPoolConstant * Create(const Constant *C, unsigned ID)
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
void print(raw_ostream &O) const override
print - Implement operator<<
const BlockAddress * getBlockAddress() const
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
ARMConstantPoolMBB - ARM-specific constantpool value of a machine basic block.
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
static ARMConstantPoolMBB * Create(LLVMContext &C, const MachineBasicBlock *mbb, unsigned ID, unsigned char PCAdj)
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
void print(raw_ostream &O) const override
print - Implement operator<<
ARMConstantPoolSymbol - ARM-specific constantpool values for external symbols.
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
void print(raw_ostream &O) const override
print - Implement operator<<
static ARMConstantPoolSymbol * Create(LLVMContext &C, StringRef s, unsigned ID, unsigned char PCAdj)
ARMConstantPoolValue - ARM specific constantpool value.
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
ARMConstantPoolValue(Type *Ty, unsigned id, ARMCP::ARMCPKind Kind, unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, bool AddCurrentAddress)
~ARMConstantPoolValue() override
void print(raw_ostream &O) const override
print - Implement operator<<
StringRef getModifierText() const
virtual bool hasSameValue(ARMConstantPoolValue *ACPV)
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
The address of a basic block.
This is an important base class in LLVM.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
This is an important class for using LLVM in a threaded context.
Abstract base class for all machine specific constantpool value subclasses.
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
static IntegerType * getInt32Ty(LLVMContext &C)
LLVMContext & getContext() const
All values hold a context through their type.
StringRef getName() const
Return a constant reference to the value's name.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ SECREL
Thread Pointer Offset.
@ GOT_PREL
Thread Local Storage (General Dynamic Mode)
@ SBREL
Section Relative (Windows TLS)
@ GOTTPOFF
Global Offset Table, PC Relative.
@ TPOFF
Global Offset Table, Thread Pointer Offset.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.