103 return N->getSExtValue();
108 const APInt &Imm =
N->getValueAPF().bitcastToAPInt();
146 return "VE DAG->DAG Pattern Instruction Selection";
150 #include "VEGenDAGISel.inc"
153 SDNode *getGlobalBaseReg();
171 if (matchADDRrr(
LHS,
Base, Index)) {
184 if (isa<FrameIndexSDNode>(
RHS))
187 if (matchADDRri(
RHS, Index, Offset)) {
191 if (matchADDRri(
LHS,
Base, Offset)) {
205 if (matchADDRri(
Addr,
Base, Offset)) {
224 if (isa<FrameIndexSDNode>(
Addr))
231 if (
auto *CN = dyn_cast<ConstantSDNode>(
Addr)) {
245 if (matchADDRri(
Addr,
Base, Offset))
255 if (isa<FrameIndexSDNode>(
Addr))
262 if (
auto *CN = dyn_cast<ConstantSDNode>(
Addr)) {
274 if (isa<FrameIndexSDNode>(
Addr))
286 if (!CurDAG->haveNoCommonBitsSet(
Addr.getOperand(0),
Addr.getOperand(1)))
302 auto AddrTy =
Addr->getValueType(0);
304 Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), AddrTy);
313 if (CurDAG->isBaseWithConstantOffset(
Addr)) {
317 dyn_cast<FrameIndexSDNode>(
Addr.getOperand(0))) {
319 Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), AddrTy);
333 if (
N->isMachineOpcode()) {
338 switch (
N->getOpcode()) {
342 ReplaceNode(
N,
N->getOperand(0).getNode());
347 MVT SplatResTy =
N->getSimpleValueType(0);
352 auto BConst = dyn_cast<ConstantSDNode>(
N->getOperand(0));
355 bool BCTrueMask = (BConst->getSExtValue() != 0);
362 New = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
SDLoc(
N), VE::VM0,
365 New = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
SDLoc(
N), VE::VMP0,
371 ReplaceNode(
N,
New.getNode());
376 ReplaceNode(
N, getGlobalBaseReg());
383 SDNode *VEDAGToDAGISel::getGlobalBaseReg() {
386 ->getRegister(
GlobalBaseReg, TLI->getPointerTy(CurDAG->getDataLayout()))
394 return new VEDAGToDAGISel(
TM);