51 return CurDAG->getTargetConstant(Imm, dl,
MVT::i32);
54 inline bool immMskBitp(
SDNode *inN)
const {
61 return (msksize >= 1 && msksize <= 8) ||
62 msksize == 16 || msksize == 24 || msksize == 32;
68 bool SelectInlineAsmMemoryOperand(
const SDValue &Op,
unsigned ConstraintID,
69 std::vector<SDValue> &OutOps)
override;
71 const char *getPassName()
const override {
72 return "XCore DAG->DAG Pattern Instruction Selection";
76 #include "XCoreGenDAGISel.inc"
85 return new XCoreDAGToDAGISel(TM, OptLevel);
88 bool XCoreDAGToDAGISel::SelectADDRspii(
SDValue Addr,
SDValue &Base,
91 if ((FIN = dyn_cast<FrameIndexSDNode>(Addr))) {
98 if ((FIN = dyn_cast<FrameIndexSDNode>(Addr.
getOperand(0)))
111 bool XCoreDAGToDAGISel::
112 SelectInlineAsmMemoryOperand(
const SDValue &Op,
unsigned ConstraintID,
113 std::vector<SDValue> &OutOps) {
115 switch (ConstraintID) {
116 default:
return true;
119 default:
return true;
124 Reg = CurDAG->getRegister(XCore::DP,
MVT::i32);
128 OutOps.push_back(Reg);
138 uint64_t Val = cast<ConstantSDNode>(
N)->getZExtValue();
143 return CurDAG->getMachineNode(XCore::MKMSK_rus, dl,
147 SDValue CPIdx = CurDAG->getTargetConstantPool(
149 getTargetLowering()->getPointerTy(CurDAG->getDataLayout()));
150 SDNode *node = CurDAG->getMachineNode(XCore::LDWCP_lru6, dl,
MVT::i32,
152 CurDAG->getEntryNode());
154 MemOp[0] = MF->getMachineMemOperand(
156 cast<MachineSDNode>(node)->setMemRefs(MemOp, MemOp + 1);
197 if (
SDNode *ResNode = SelectBRIND(N))
202 return SelectCode(N);
238 unsigned IntNo = cast<ConstantSDNode>(Addr->
getOperand(1))->getZExtValue();
239 if (IntNo != Intrinsic::xcore_checkevent)
243 if (!CheckEventChainOut.use_empty()) {
259 SDValue constOne = getI32Imm(1, dl);
262 constOne, Chain), 0);
268 return CurDAG->SelectNodeTo(N, XCore::BRFU_lu6,
MVT::Other,
271 return CurDAG->SelectNodeTo(N, XCore::BAU_1r,
MVT::Other, nextAddr, Glue);
void push_back(const T &Elt)
The memory access reads data.
static SDValue replaceInChain(SelectionDAG *CurDAG, SDValue Chain, SDValue Old, SDValue New)
Given a chain return a new chain where any appearance of Old is replaced by New.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
unsigned getNumOperands() const
Return the number of values used by this operation.
const SDValue & getOperand(unsigned Num) const
static MachinePointerInfo getConstantPool()
getConstantPool - Return a MachinePointerInfo record that refers to the constant pool.
std::size_t countLeadingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the most significant bit to the least stopping at the first 1...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
MachineMemOperand - A description of a memory reference used in the backend.
Reg
All possible values of the reg field in the ModR/M byte.
Simple integer binary arithmetic operators.
SDNode * getNode() const
get the SDNode which holds the desired result
const SDValue & getOperand(unsigned i) const
FunctionPass * createXCoreISelDag(XCoreTargetMachine &TM, CodeGenOpt::Level OptLevel)
createXCoreISelDag - This pass converts a legalized DAG into a XCore-specific DAG, ready for instruction scheduling.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
unsigned getOpcode() const
FunctionPass class - This class is used to implement most global optimizations.
TokenFactor - This node takes multiple tokens as input and produces a single token result...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Represents one node in the SelectionDAG.
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruc...
int64_t getSExtValue() const
bool isMask_32(uint32_t Value)
isMask_32 - This function returns true if the argument is a non-empty sequence of ones starting at th...
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
static IntegerType * getInt32Ty(LLVMContext &C)
bool isUInt< 16 >(uint64_t x)
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
This file describes how to lower LLVM code to machine code.
uint64_t getZExtValue() const