35#define DEBUG_TYPE "arc-isel"
36#define PASS_NAME "ARC DAG->DAG Pattern Instruction Selection"
44 ARCDAGToDAGISel() =
delete;
58#include "ARCGenDAGISel.inc"
66 ID, std::make_unique<ARCDAGToDAGISel>(TM, OptLevel)) {}
69char ARCDAGToDAGISelLegacy::ID;
79 return new ARCDAGToDAGISelLegacy(TM, OptLevel);
99 !CurDAG->isBaseWithConstantOffset(
Addr)) {
102 int FI = cast<FrameIndexSDNode>(
Addr)->getIndex();
103 Base = CurDAG->getTargetFrameIndex(
104 FI, TLI->getPointerTy(CurDAG->getDataLayout()));
113 int32_t RHSC =
RHS->getSExtValue();
122 int FI = cast<FrameIndexSDNode>(
Base)->getIndex();
123 Base = CurDAG->getTargetFrameIndex(
124 FI, TLI->getPointerTy(CurDAG->getDataLayout()));
142 int32_t RHSC =
RHS->getSExtValue();
156 if ((FIN = dyn_cast<FrameIndexSDNode>(
Addr))) {
157 Base = CurDAG->getTargetFrameIndex(FIN->
getIndex(), MVT::i32);
163 if ((FIN = dyn_cast<FrameIndexSDNode>(
Addr.getOperand(0))) &&
164 (CN = dyn_cast<ConstantSDNode>(
Addr.getOperand(1))) &&
167 Base = CurDAG->getTargetFrameIndex(FIN->
getIndex(), MVT::i32);
176void ARCDAGToDAGISel::Select(
SDNode *
N) {
177 switch (
N->getOpcode()) {
180 ReplaceNode(
N, CurDAG->getMachineNode(
181 isInt<12>(CVal) ? ARC::MOV_rs12 : ARC::MOV_rlimm,
183 CurDAG->getTargetConstant(CVal,
SDLoc(
N), MVT::i32)));
amdgpu AMDGPU Register Bank Select
This file contains the declarations for the subclasses of Constant, which represent the different fla...
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file describes how to lower LLVM code to machine code.
int64_t getSExtValue() const
FunctionPass class - This class is used to implement most global optimizations.
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.
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ ADD
Simple integer binary arithmetic operators.
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createARCISelDag(ARCTargetMachine &TM, CodeGenOptLevel OptLevel)
This pass converts a legalized DAG into a ARC-specific DAG, ready for instruction scheduling.
CodeGenOptLevel
Code generation optimization level.