26 #ifndef LLVM_BUILD_GLOBAL_ISEL
27 #error "You shouldn't build this"
31 using namespace TargetOpcode;
42 for (
auto Ty : {p0, s1, s8, s16, s32, s64})
45 for (
unsigned BinOp : {G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR, G_SHL}) {
48 for (
auto Ty : {s32, s64, v2s32, v4s32, v2s64})
51 for (
auto Ty : {s1, s8, s16})
58 for (
auto Ty : {s1, s8, s16, s32})
63 for (
unsigned BinOp : {G_LSHR, G_ASHR, G_SDIV, G_UDIV}) {
64 for (
auto Ty : {s32, s64})
67 for (
auto Ty : {s1, s8, s16})
71 for (
unsigned BinOp : {G_SREM, G_UREM})
72 for (
auto Ty : { s1, s8, s16, s32, s64 })
75 for (
unsigned Op : {G_SMULO, G_UMULO})
78 for (
unsigned Op : {G_UADDE, G_USUBE, G_SADDO, G_SSUBO, G_SMULH, G_UMULH}) {
79 for (
auto Ty : { s32, s64 })
85 for (
unsigned BinOp : {G_FADD, G_FSUB, G_FMA, G_FMUL, G_FDIV})
86 for (
auto Ty : {s32, s64})
89 for (
unsigned BinOp : {G_FREM, G_FPOW}) {
94 for (
auto Ty : {s32, s64, p0}) {
98 for (
auto Ty : {s1, s8, s16}) {
105 for (
auto Ty : {s1, s8, s16, s32, s64, p0})
108 for (
auto Ty : {s32, s64})
111 for (
unsigned MemOp : {G_LOAD, G_STORE}) {
112 for (
auto Ty : {s8, s16, s32, s64, p0, v2s32})
122 for (
auto Ty : {s32, s64}) {
129 for (
auto Ty : {s1, s8, s16})
139 for (
auto Ty : {s1, s8, s16}) {
148 for (
auto Ty : { s1, s8, s16, s32, s64 }) {
154 for (
auto Ty : { s1, s8, s16, s32 }) {
164 for (
auto Ty : { s16, s32 })
167 for (
auto Ty : { s32, s64 })
170 for (
auto Ty : { s1, s8, s16, s32 })
173 for (
auto Ty : { s8, s16, s32, s64 })
177 for (
auto Ty : { s32, s64 }) {
183 for (
auto Ty : { s1, s8, s16 }) {
190 for (
auto Ty : { s32, s64 }) {
198 for (
auto Ty : {s1, s8, s16, s32})
203 for (
auto Ty : {s1, s8, s16})
206 for (
auto Ty : {s32, s64, p0})
215 for (
auto Ty : {s1, s8, s16, s32, s64})
224 for (
auto Ty : {s1, s8, s16, s32, s64}) {
231 for (
int EltSize = 8; EltSize <= 64; EltSize *= 2) {
252 for (
auto Ty : {s8, s16, s32, s64, p0})
265 case TargetOpcode::G_VAARG:
266 return legalizeVaArg(MI, MRI, MIRBuilder);
292 if (Align > PtrSize) {
294 auto AlignMinus1 = MIRBuilder.
buildConstant(IntPtrTy, Align - 1);
297 MIRBuilder.
buildGEP(ListTmp, List, AlignMinus1->getOperand(0).getReg());
308 ValSize,
std::max(Align, PtrSize)));
314 MIRBuilder.
buildGEP(NewList, DstPtr, SizeReg);
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
MachineInstrBuilder buildGEP(unsigned Res, unsigned Op0, unsigned Op1)
Build and insert Res<def> = G_GEP Op0, Op1.
LLT getType(unsigned VReg) const
Get the low-level type of VReg or LLT{} if VReg is not a generic (target independent) virtual registe...
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
unsigned createGenericVirtualRegister(LLT Ty)
Create and return a new generic virtual register with low-level type Ty.
MachineInstrBuilder buildStore(unsigned Val, unsigned Addr, MachineMemOperand &MMO)
Build and insert G_STORE Val, Addr, MMO.
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
This file declares the targeting of the Machinelegalizer class for AArch64.
void computeTables()
Compute any ancillary tables needed to quickly decide how an operation should be handled.
MachineFunction & getMF()
Getter for the function we currently build.
static LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
The target wants to do something special with this combination of operand and type.
unsigned const MachineRegisterInfo * MRI
MachineInstrBuilder buildPtrMask(unsigned Res, unsigned Op0, uint32_t NumBits)
Build and insert Res<def> = G_PTR_MASK Op0, NumBits.
const MachineOperand & getOperand(unsigned i) const
Helper class to build MachineInstr.
void setInstr(MachineInstr &MI)
Set the insertion point to before MI.
This class contains a discriminated union of information about pointers in memory operands...
The memory access writes data.
The operation should be implemented as a call to some kind of runtime support library.
bool legalizeCustom(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder) const override
The operation should be implemented in terms of a wider scalar base-type.
This file declares the MachineIRBuilder class.
The operation itself must be expressed in terms of simpler actions on this target.
The operation is expected to be selectable directly by the target, and no transformation is necessary...
llvm_unreachable("Unknown RegBank!")
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
The memory access reads data.
Representation of each machine instruction.
MachineInstrBuilder buildConstant(unsigned Res, const ConstantInt &Val)
Build and insert Res = G_CONSTANT Val.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
unsigned getReg() const
getReg - Returns the register number.
static LLT pointer(uint16_t AddressSpace, unsigned SizeInBits)
Get a low-level pointer in the given address space (defaulting to 0).
MachineInstrBuilder buildLoad(unsigned Res, unsigned Addr, MachineMemOperand &MMO)
Build and insert Res<def> = G_LOAD Addr, MMO.
unsigned getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
static LLT vector(uint16_t NumElements, unsigned ScalarSizeInBits)
Get a low-level vector of some number of elements and element width.
void setAction(const InstrAspect &Aspect, LegalizeAction Action)
More friendly way to set an action for common types that have an LLT representation.
unsigned Log2_64(uint64_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.