25 bool isConstantLoad(
const MemSDNode *
N,
int cbID)
const;
31 R600DAGToDAGISel() =
delete;
49#include "R600GenDAGISel.inc"
57 ID,
std::make_unique<R600DAGToDAGISel>(
TM, OptLevel)) {}
60char R600DAGToDAGISelLegacy::ID = 0;
69bool R600DAGToDAGISel::isConstantLoad(
const MemSDNode *
N,
int CbId)
const {
79bool R600DAGToDAGISel::SelectGlobalValueConstantOffset(
SDValue Addr,
83 CurDAG->getIntPtrConstant(Cst->getZExtValue() / 4,
SDLoc(
Addr),
true);
89bool R600DAGToDAGISel::SelectGlobalValueVariableOffset(
SDValue Addr,
92 if (!isa<ConstantSDNode>(
Addr)) {
100void R600DAGToDAGISel::Select(
SDNode *
N) {
101 unsigned int Opc =
N->getOpcode();
102 if (
N->isMachineOpcode()) {
113 EVT VT =
N->getValueType(0);
120 switch (NumVectorElts) {
122 RegClassID = R600::R600_Reg64RegClassID;
126 RegClassID = R600::R600_Reg128VerticalRegClassID;
128 RegClassID = R600::R600_Reg128RegClassID;
133 SelectBuildVector(
N, RegClassID);
146 if ((
C = dyn_cast<ConstantSDNode>(
Addr))) {
147 Base = CurDAG->getRegister(R600::INDIRECT_BASE_ADDR, MVT::i32);
148 Offset = CurDAG->getTargetConstant(
C->getZExtValue(),
DL, MVT::i32);
150 (
C = dyn_cast<ConstantSDNode>(
Addr.getOperand(0)))) {
151 Base = CurDAG->getRegister(R600::INDIRECT_BASE_ADDR, MVT::i32);
152 Offset = CurDAG->getTargetConstant(
C->getZExtValue(),
DL, MVT::i32);
154 (
C = dyn_cast<ConstantSDNode>(
Addr.getOperand(1)))) {
156 Offset = CurDAG->getTargetConstant(
C->getZExtValue(),
DL, MVT::i32);
159 Offset = CurDAG->getTargetConstant(0,
DL, MVT::i32);
170 (IMMOffset = dyn_cast<ConstantSDNode>(
Addr.getOperand(1))) &&
178 }
else if ((IMMOffset = dyn_cast<ConstantSDNode>(
Addr)) &&
180 Base = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
181 SDLoc(CurDAG->getEntryNode()), R600::ZERO,
198 return new R600DAGToDAGISelLegacy(
TM, OptLevel);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Defines an instruction selector for the AMDGPU target.
amdgpu AMDGPU Register Bank Select
const char LLVMTargetMachineRef TM
Provides R600 specific target descriptions.
AMDGPU R600 specific subclass of TargetSubtarget.
AMDGPU specific code to select AMDGPU machine instructions for SelectionDAG operations.
bool runOnMachineFunction(MachineFunction &MF) override
void PreprocessISelDAG() override
PreprocessISelDAG - This hook allows targets to hack on the graph before instruction selection starts...
uint64_t getZExtValue() const
FunctionPass class - This class is used to implement most global optimizations.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
This is an abstract virtual class for memory operations.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
virtual bool runOnMachineFunction(MachineFunction &mf)
Primary interface to the complete machine description for the target machine.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ CONSTANT_ADDRESS_32BIT
Address space for 32-bit constant memory.
@ CONSTANT_ADDRESS
Address space for constant memory (VTX2).
@ BUILD_VERTICAL_VECTOR
This node is for VLIW targets and it is used to represent a vector that is stored in consecutive regi...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
@ ADD
Simple integer binary arithmetic operators.
@ SCALAR_TO_VECTOR
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
CodeGenOptLevel
Code generation optimization level.
FunctionPass * createR600ISelDag(TargetMachine &TM, CodeGenOptLevel OptLevel)
This pass converts a legalized DAG into a R600-specific.
Implement std::hash so that hash_code can be used in STL containers.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.