1 //===-- AArch64ISelDAGToDAG.cpp - A dag to dag inst selector for AArch64 --===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines an instruction selector for the AArch64 target.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "aarch64-isel"
16 #include "AArch64InstrInfo.h"
17 #include "AArch64Subtarget.h"
18 #include "AArch64TargetMachine.h"
19 #include "Utils/AArch64BaseInfo.h"
20 #include "llvm/ADT/APSInt.h"
21 #include "llvm/CodeGen/SelectionDAGISel.h"
22 #include "llvm/IR/GlobalValue.h"
23 #include "llvm/Support/Debug.h"
24 #include "llvm/Support/raw_ostream.h"
28 //===--------------------------------------------------------------------===//
29 /// AArch64 specific code to select AArch64 machine instructions for
30 /// SelectionDAG operations.
34 class AArch64DAGToDAGISel : public SelectionDAGISel {
35 AArch64TargetMachine &TM;
37 /// Keep a pointer to the AArch64Subtarget around so that we can
38 /// make the right decision when generating code for different targets.
39 const AArch64Subtarget *Subtarget;
42 explicit AArch64DAGToDAGISel(AArch64TargetMachine &tm,
43 CodeGenOpt::Level OptLevel)
44 : SelectionDAGISel(tm, OptLevel), TM(tm),
45 Subtarget(&TM.getSubtarget<AArch64Subtarget>()) {
48 virtual const char *getPassName() const {
49 return "AArch64 Instruction Selection";
52 // Include the pieces autogenerated from the target description.
53 #include "AArch64GenDAGISel.inc"
55 template<unsigned MemSize>
56 bool SelectOffsetUImm12(SDValue N, SDValue &UImm12) {
57 const ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N);
58 if (!CN || CN->getZExtValue() % MemSize != 0
59 || CN->getZExtValue() / MemSize > 0xfff)
62 UImm12 = CurDAG->getTargetConstant(CN->getZExtValue() / MemSize, MVT::i64);
66 template<unsigned RegWidth>
67 bool SelectCVTFixedPosOperand(SDValue N, SDValue &FixedPos) {
68 return SelectCVTFixedPosOperand(N, FixedPos, RegWidth);
71 /// Used for pre-lowered address-reference nodes, so we already know
72 /// the fields match. This operand's job is simply to add an
73 /// appropriate shift operand to the MOVZ/MOVK instruction.
74 template<unsigned LogShift>
75 bool SelectMOVWAddressRef(SDValue N, SDValue &Imm, SDValue &Shift) {
77 Shift = CurDAG->getTargetConstant(LogShift, MVT::i32);
81 bool SelectFPZeroOperand(SDValue N, SDValue &Dummy);
83 bool SelectCVTFixedPosOperand(SDValue N, SDValue &FixedPos,
86 bool SelectInlineAsmMemoryOperand(const SDValue &Op,
88 std::vector<SDValue> &OutOps);
90 bool SelectLogicalImm(SDValue N, SDValue &Imm);
92 template<unsigned RegWidth>
93 bool SelectTSTBOperand(SDValue N, SDValue &FixedPos) {
94 return SelectTSTBOperand(N, FixedPos, RegWidth);
97 bool SelectTSTBOperand(SDValue N, SDValue &FixedPos, unsigned RegWidth);
99 SDNode *SelectAtomic(SDNode *N, unsigned Op8, unsigned Op16, unsigned Op32,
102 /// Put the given constant into a pool and return a DAG which will give its
104 SDValue getConstantPoolItemAddress(SDLoc DL, const Constant *CV);
106 SDNode *TrySelectToMoveImm(SDNode *N);
107 SDNode *LowerToFPLitPool(SDNode *Node);
108 SDNode *SelectToLitPool(SDNode *N);
110 SDNode* Select(SDNode*);
112 /// Get the opcode for table lookup instruction
113 unsigned getTBLOpc(bool IsExt, bool Is64Bit, unsigned NumOfVec);
115 /// Select NEON table lookup intrinsics. NumVecs should be 1, 2, 3 or 4.
116 /// IsExt is to indicate if the result will be extended with an argument.
117 SDNode *SelectVTBL(SDNode *N, unsigned NumVecs, bool IsExt);
119 /// Select NEON load intrinsics. NumVecs should be 1, 2, 3 or 4.
120 SDNode *SelectVLD(SDNode *N, unsigned NumVecs, bool isUpdating,
121 const uint16_t *Opcode);
123 /// Select NEON store intrinsics. NumVecs should be 1, 2, 3 or 4.
124 SDNode *SelectVST(SDNode *N, unsigned NumVecs, bool isUpdating,
125 const uint16_t *Opcodes);
127 /// Form sequences of consecutive 64/128-bit registers for use in NEON
128 /// instructions making use of a vector-list (e.g. ldN, tbl). Vecs must have
129 /// between 1 and 4 elements. If it contains a single element that is returned
130 /// unchanged; otherwise a REG_SEQUENCE value is returned.
131 SDValue createDTuple(ArrayRef<SDValue> Vecs);
132 SDValue createQTuple(ArrayRef<SDValue> Vecs);
134 /// Generic helper for the createDTuple/createQTuple
135 /// functions. Those should almost always be called instead.
136 SDValue createTuple(ArrayRef<SDValue> Vecs, unsigned RegClassIDs[],
142 AArch64DAGToDAGISel::SelectCVTFixedPosOperand(SDValue N, SDValue &FixedPos,
144 const ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N);
145 if (!CN) return false;
147 // An FCVT[SU] instruction performs: convertToInt(Val * 2^fbits) where fbits
148 // is between 1 and 32 for a destination w-register, or 1 and 64 for an
151 // By this stage, we've detected (fp_to_[su]int (fmul Val, THIS_NODE)) so we
152 // want THIS_NODE to be 2^fbits. This is much easier to deal with using
156 // fbits is between 1 and 64 in the worst-case, which means the fmul
157 // could have 2^64 as an actual operand. Need 65 bits of precision.
158 APSInt IntVal(65, true);
159 CN->getValueAPF().convertToInteger(IntVal, APFloat::rmTowardZero, &IsExact);
161 // N.b. isPowerOf2 also checks for > 0.
162 if (!IsExact || !IntVal.isPowerOf2()) return false;
163 unsigned FBits = IntVal.logBase2();
165 // Checks above should have guaranteed that we haven't lost information in
166 // finding FBits, but it must still be in range.
167 if (FBits == 0 || FBits > RegWidth) return false;
169 FixedPos = CurDAG->getTargetConstant(64 - FBits, MVT::i32);
174 AArch64DAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op,
176 std::vector<SDValue> &OutOps) {
177 switch (ConstraintCode) {
178 default: llvm_unreachable("Unrecognised AArch64 memory constraint");
180 // FIXME: more freedom is actually permitted for 'm'. We can go
181 // hunting for a base and an offset if we want. Of course, since
182 // we don't really know how the operand is going to be used we're
183 // probably restricted to the load/store pair's simm7 as an offset
186 OutOps.push_back(Op);
193 AArch64DAGToDAGISel::SelectFPZeroOperand(SDValue N, SDValue &Dummy) {
194 ConstantFPSDNode *Imm = dyn_cast<ConstantFPSDNode>(N);
195 if (!Imm || !Imm->getValueAPF().isPosZero())
198 // Doesn't actually carry any information, but keeps TableGen quiet.
199 Dummy = CurDAG->getTargetConstant(0, MVT::i32);
203 bool AArch64DAGToDAGISel::SelectLogicalImm(SDValue N, SDValue &Imm) {
205 uint32_t RegWidth = N.getValueType().getSizeInBits();
207 ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N);
208 if (!CN) return false;
210 if (!A64Imms::isLogicalImm(RegWidth, CN->getZExtValue(), Bits))
213 Imm = CurDAG->getTargetConstant(Bits, MVT::i32);
217 SDNode *AArch64DAGToDAGISel::TrySelectToMoveImm(SDNode *Node) {
220 EVT DestType = Node->getValueType(0);
221 unsigned DestWidth = DestType.getSizeInBits();
226 uint32_t LogicalBits;
228 uint64_t BitPat = cast<ConstantSDNode>(Node)->getZExtValue();
229 if (A64Imms::isMOVZImm(DestWidth, BitPat, UImm16, Shift)) {
231 MOVOpcode = DestWidth == 64 ? AArch64::MOVZxii : AArch64::MOVZwii;
232 } else if (A64Imms::isMOVNImm(DestWidth, BitPat, UImm16, Shift)) {
234 MOVOpcode = DestWidth == 64 ? AArch64::MOVNxii : AArch64::MOVNwii;
235 } else if (DestWidth == 64 && A64Imms::isMOVNImm(32, BitPat, UImm16, Shift)) {
236 // To get something like 0x0000_0000_ffff_1234 into a 64-bit register we can
237 // use a 32-bit instruction: "movn w0, 0xedbc".
239 MOVOpcode = AArch64::MOVNwii;
240 } else if (A64Imms::isLogicalImm(DestWidth, BitPat, LogicalBits)) {
241 MOVOpcode = DestWidth == 64 ? AArch64::ORRxxi : AArch64::ORRwwi;
242 uint16_t ZR = DestWidth == 64 ? AArch64::XZR : AArch64::WZR;
244 return CurDAG->getMachineNode(MOVOpcode, dl, DestType,
245 CurDAG->getRegister(ZR, DestType),
246 CurDAG->getTargetConstant(LogicalBits, MVT::i32));
248 // Can't handle it in one instruction. There's scope for permitting two (or
249 // more) instructions, but that'll need more thought.
253 ResNode = CurDAG->getMachineNode(MOVOpcode, dl, MOVType,
254 CurDAG->getTargetConstant(UImm16, MVT::i32),
255 CurDAG->getTargetConstant(Shift, MVT::i32));
257 if (MOVType != DestType) {
258 ResNode = CurDAG->getMachineNode(TargetOpcode::SUBREG_TO_REG, dl,
259 MVT::i64, MVT::i32, MVT::Other,
260 CurDAG->getTargetConstant(0, MVT::i64),
262 CurDAG->getTargetConstant(AArch64::sub_32, MVT::i32));
269 AArch64DAGToDAGISel::getConstantPoolItemAddress(SDLoc DL,
270 const Constant *CV) {
271 EVT PtrVT = getTargetLowering()->getPointerTy();
273 switch (getTargetLowering()->getTargetMachine().getCodeModel()) {
274 case CodeModel::Small: {
276 getTargetLowering()->getDataLayout()->getABITypeAlignment(CV->getType());
277 return CurDAG->getNode(
278 AArch64ISD::WrapperSmall, DL, PtrVT,
279 CurDAG->getTargetConstantPool(CV, PtrVT, 0, 0, AArch64II::MO_NO_FLAG),
280 CurDAG->getTargetConstantPool(CV, PtrVT, 0, 0, AArch64II::MO_LO12),
281 CurDAG->getConstant(Alignment, MVT::i32));
283 case CodeModel::Large: {
285 LitAddr = CurDAG->getMachineNode(
286 AArch64::MOVZxii, DL, PtrVT,
287 CurDAG->getTargetConstantPool(CV, PtrVT, 0, 0, AArch64II::MO_ABS_G3),
288 CurDAG->getTargetConstant(3, MVT::i32));
289 LitAddr = CurDAG->getMachineNode(
290 AArch64::MOVKxii, DL, PtrVT, SDValue(LitAddr, 0),
291 CurDAG->getTargetConstantPool(CV, PtrVT, 0, 0, AArch64II::MO_ABS_G2_NC),
292 CurDAG->getTargetConstant(2, MVT::i32));
293 LitAddr = CurDAG->getMachineNode(
294 AArch64::MOVKxii, DL, PtrVT, SDValue(LitAddr, 0),
295 CurDAG->getTargetConstantPool(CV, PtrVT, 0, 0, AArch64II::MO_ABS_G1_NC),
296 CurDAG->getTargetConstant(1, MVT::i32));
297 LitAddr = CurDAG->getMachineNode(
298 AArch64::MOVKxii, DL, PtrVT, SDValue(LitAddr, 0),
299 CurDAG->getTargetConstantPool(CV, PtrVT, 0, 0, AArch64II::MO_ABS_G0_NC),
300 CurDAG->getTargetConstant(0, MVT::i32));
301 return SDValue(LitAddr, 0);
304 llvm_unreachable("Only small and large code models supported now");
308 SDNode *AArch64DAGToDAGISel::SelectToLitPool(SDNode *Node) {
310 uint64_t UnsignedVal = cast<ConstantSDNode>(Node)->getZExtValue();
311 int64_t SignedVal = cast<ConstantSDNode>(Node)->getSExtValue();
312 EVT DestType = Node->getValueType(0);
314 // Since we may end up loading a 64-bit constant from a 32-bit entry the
315 // constant in the pool may have a different type to the eventual node.
316 ISD::LoadExtType Extension;
319 assert((DestType == MVT::i64 || DestType == MVT::i32)
320 && "Only expect integer constants at the moment");
322 if (DestType == MVT::i32) {
323 Extension = ISD::NON_EXTLOAD;
325 } else if (UnsignedVal <= UINT32_MAX) {
326 Extension = ISD::ZEXTLOAD;
328 } else if (SignedVal >= INT32_MIN && SignedVal <= INT32_MAX) {
329 Extension = ISD::SEXTLOAD;
332 Extension = ISD::NON_EXTLOAD;
336 Constant *CV = ConstantInt::get(Type::getIntNTy(*CurDAG->getContext(),
337 MemType.getSizeInBits()),
339 SDValue PoolAddr = getConstantPoolItemAddress(DL, CV);
341 getTargetLowering()->getDataLayout()->getABITypeAlignment(CV->getType());
343 return CurDAG->getExtLoad(Extension, DL, DestType, CurDAG->getEntryNode(),
345 MachinePointerInfo::getConstantPool(), MemType,
346 /* isVolatile = */ false,
347 /* isNonTemporal = */ false,
348 Alignment).getNode();
351 SDNode *AArch64DAGToDAGISel::LowerToFPLitPool(SDNode *Node) {
353 const ConstantFP *FV = cast<ConstantFPSDNode>(Node)->getConstantFPValue();
354 EVT DestType = Node->getValueType(0);
357 getTargetLowering()->getDataLayout()->getABITypeAlignment(FV->getType());
358 SDValue PoolAddr = getConstantPoolItemAddress(DL, FV);
360 return CurDAG->getLoad(DestType, DL, CurDAG->getEntryNode(), PoolAddr,
361 MachinePointerInfo::getConstantPool(),
362 /* isVolatile = */ false,
363 /* isNonTemporal = */ false,
364 /* isInvariant = */ true,
365 Alignment).getNode();
369 AArch64DAGToDAGISel::SelectTSTBOperand(SDValue N, SDValue &FixedPos,
371 const ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N);
372 if (!CN) return false;
374 uint64_t Val = CN->getZExtValue();
376 if (!isPowerOf2_64(Val)) return false;
378 unsigned TestedBit = Log2_64(Val);
379 // Checks above should have guaranteed that we haven't lost information in
380 // finding TestedBit, but it must still be in range.
381 if (TestedBit >= RegWidth) return false;
383 FixedPos = CurDAG->getTargetConstant(TestedBit, MVT::i64);
387 SDNode *AArch64DAGToDAGISel::SelectAtomic(SDNode *Node, unsigned Op8,
388 unsigned Op16,unsigned Op32,
390 // Mostly direct translation to the given operations, except that we preserve
391 // the AtomicOrdering for use later on.
392 AtomicSDNode *AN = cast<AtomicSDNode>(Node);
393 EVT VT = AN->getMemoryVT();
398 else if (VT == MVT::i16)
400 else if (VT == MVT::i32)
402 else if (VT == MVT::i64)
405 llvm_unreachable("Unexpected atomic operation");
407 SmallVector<SDValue, 4> Ops;
408 for (unsigned i = 1; i < AN->getNumOperands(); ++i)
409 Ops.push_back(AN->getOperand(i));
411 Ops.push_back(CurDAG->getTargetConstant(AN->getOrdering(), MVT::i32));
412 Ops.push_back(AN->getOperand(0)); // Chain moves to the end
414 return CurDAG->SelectNodeTo(Node, Op,
415 AN->getValueType(0), MVT::Other,
416 &Ops[0], Ops.size());
419 SDValue AArch64DAGToDAGISel::createDTuple(ArrayRef<SDValue> Regs) {
420 static unsigned RegClassIDs[] = { AArch64::DPairRegClassID,
421 AArch64::DTripleRegClassID,
422 AArch64::DQuadRegClassID };
423 static unsigned SubRegs[] = { AArch64::dsub_0, AArch64::dsub_1,
424 AArch64::dsub_2, AArch64::dsub_3 };
426 return createTuple(Regs, RegClassIDs, SubRegs);
429 SDValue AArch64DAGToDAGISel::createQTuple(ArrayRef<SDValue> Regs) {
430 static unsigned RegClassIDs[] = { AArch64::QPairRegClassID,
431 AArch64::QTripleRegClassID,
432 AArch64::QQuadRegClassID };
433 static unsigned SubRegs[] = { AArch64::qsub_0, AArch64::qsub_1,
434 AArch64::qsub_2, AArch64::qsub_3 };
436 return createTuple(Regs, RegClassIDs, SubRegs);
439 SDValue AArch64DAGToDAGISel::createTuple(ArrayRef<SDValue> Regs,
440 unsigned RegClassIDs[],
441 unsigned SubRegs[]) {
442 // There's no special register-class for a vector-list of 1 element: it's just
444 if (Regs.size() == 1)
447 assert(Regs.size() >= 2 && Regs.size() <= 4);
449 SDLoc DL(Regs[0].getNode());
451 SmallVector<SDValue, 4> Ops;
453 // First operand of REG_SEQUENCE is the desired RegClass.
455 CurDAG->getTargetConstant(RegClassIDs[Regs.size() - 2], MVT::i32));
457 // Then we get pairs of source & subregister-position for the components.
458 for (unsigned i = 0; i < Regs.size(); ++i) {
459 Ops.push_back(Regs[i]);
460 Ops.push_back(CurDAG->getTargetConstant(SubRegs[i], MVT::i32));
464 CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, DL, MVT::Untyped, Ops);
465 return SDValue(N, 0);
469 // Get the register stride update opcode of a VLD/VST instruction that
470 // is otherwise equivalent to the given fixed stride updating instruction.
471 static unsigned getVLDSTRegisterUpdateOpcode(unsigned Opc) {
474 case AArch64::LD1WB_8B_fixed: return AArch64::LD1WB_8B_register;
475 case AArch64::LD1WB_4H_fixed: return AArch64::LD1WB_4H_register;
476 case AArch64::LD1WB_2S_fixed: return AArch64::LD1WB_2S_register;
477 case AArch64::LD1WB_1D_fixed: return AArch64::LD1WB_1D_register;
478 case AArch64::LD1WB_16B_fixed: return AArch64::LD1WB_16B_register;
479 case AArch64::LD1WB_8H_fixed: return AArch64::LD1WB_8H_register;
480 case AArch64::LD1WB_4S_fixed: return AArch64::LD1WB_4S_register;
481 case AArch64::LD1WB_2D_fixed: return AArch64::LD1WB_2D_register;
483 case AArch64::LD2WB_8B_fixed: return AArch64::LD2WB_8B_register;
484 case AArch64::LD2WB_4H_fixed: return AArch64::LD2WB_4H_register;
485 case AArch64::LD2WB_2S_fixed: return AArch64::LD2WB_2S_register;
486 case AArch64::LD1WB2V_1D_fixed: return AArch64::LD1WB2V_1D_register;
487 case AArch64::LD2WB_16B_fixed: return AArch64::LD2WB_16B_register;
488 case AArch64::LD2WB_8H_fixed: return AArch64::LD2WB_8H_register;
489 case AArch64::LD2WB_4S_fixed: return AArch64::LD2WB_4S_register;
490 case AArch64::LD2WB_2D_fixed: return AArch64::LD2WB_2D_register;
492 case AArch64::LD3WB_8B_fixed: return AArch64::LD3WB_8B_register;
493 case AArch64::LD3WB_4H_fixed: return AArch64::LD3WB_4H_register;
494 case AArch64::LD3WB_2S_fixed: return AArch64::LD3WB_2S_register;
495 case AArch64::LD1WB3V_1D_fixed: return AArch64::LD1WB3V_1D_register;
496 case AArch64::LD3WB_16B_fixed: return AArch64::LD3WB_16B_register;
497 case AArch64::LD3WB_8H_fixed: return AArch64::LD3WB_8H_register;
498 case AArch64::LD3WB_4S_fixed: return AArch64::LD3WB_4S_register;
499 case AArch64::LD3WB_2D_fixed: return AArch64::LD3WB_2D_register;
501 case AArch64::LD4WB_8B_fixed: return AArch64::LD4WB_8B_register;
502 case AArch64::LD4WB_4H_fixed: return AArch64::LD4WB_4H_register;
503 case AArch64::LD4WB_2S_fixed: return AArch64::LD4WB_2S_register;
504 case AArch64::LD1WB4V_1D_fixed: return AArch64::LD1WB4V_1D_register;
505 case AArch64::LD4WB_16B_fixed: return AArch64::LD4WB_16B_register;
506 case AArch64::LD4WB_8H_fixed: return AArch64::LD4WB_8H_register;
507 case AArch64::LD4WB_4S_fixed: return AArch64::LD4WB_4S_register;
508 case AArch64::LD4WB_2D_fixed: return AArch64::LD4WB_2D_register;
510 case AArch64::ST1WB_8B_fixed: return AArch64::ST1WB_8B_register;
511 case AArch64::ST1WB_4H_fixed: return AArch64::ST1WB_4H_register;
512 case AArch64::ST1WB_2S_fixed: return AArch64::ST1WB_2S_register;
513 case AArch64::ST1WB_1D_fixed: return AArch64::ST1WB_1D_register;
514 case AArch64::ST1WB_16B_fixed: return AArch64::ST1WB_16B_register;
515 case AArch64::ST1WB_8H_fixed: return AArch64::ST1WB_8H_register;
516 case AArch64::ST1WB_4S_fixed: return AArch64::ST1WB_4S_register;
517 case AArch64::ST1WB_2D_fixed: return AArch64::ST1WB_2D_register;
519 case AArch64::ST2WB_8B_fixed: return AArch64::ST2WB_8B_register;
520 case AArch64::ST2WB_4H_fixed: return AArch64::ST2WB_4H_register;
521 case AArch64::ST2WB_2S_fixed: return AArch64::ST2WB_2S_register;
522 case AArch64::ST1WB2V_1D_fixed: return AArch64::ST1WB2V_1D_register;
523 case AArch64::ST2WB_16B_fixed: return AArch64::ST2WB_16B_register;
524 case AArch64::ST2WB_8H_fixed: return AArch64::ST2WB_8H_register;
525 case AArch64::ST2WB_4S_fixed: return AArch64::ST2WB_4S_register;
526 case AArch64::ST2WB_2D_fixed: return AArch64::ST2WB_2D_register;
528 case AArch64::ST3WB_8B_fixed: return AArch64::ST3WB_8B_register;
529 case AArch64::ST3WB_4H_fixed: return AArch64::ST3WB_4H_register;
530 case AArch64::ST3WB_2S_fixed: return AArch64::ST3WB_2S_register;
531 case AArch64::ST1WB3V_1D_fixed: return AArch64::ST1WB3V_1D_register;
532 case AArch64::ST3WB_16B_fixed: return AArch64::ST3WB_16B_register;
533 case AArch64::ST3WB_8H_fixed: return AArch64::ST3WB_8H_register;
534 case AArch64::ST3WB_4S_fixed: return AArch64::ST3WB_4S_register;
535 case AArch64::ST3WB_2D_fixed: return AArch64::ST3WB_2D_register;
537 case AArch64::ST4WB_8B_fixed: return AArch64::ST4WB_8B_register;
538 case AArch64::ST4WB_4H_fixed: return AArch64::ST4WB_4H_register;
539 case AArch64::ST4WB_2S_fixed: return AArch64::ST4WB_2S_register;
540 case AArch64::ST1WB4V_1D_fixed: return AArch64::ST1WB4V_1D_register;
541 case AArch64::ST4WB_16B_fixed: return AArch64::ST4WB_16B_register;
542 case AArch64::ST4WB_8H_fixed: return AArch64::ST4WB_8H_register;
543 case AArch64::ST4WB_4S_fixed: return AArch64::ST4WB_4S_register;
544 case AArch64::ST4WB_2D_fixed: return AArch64::ST4WB_2D_register;
546 return Opc; // If not one we handle, return it unchanged.
549 SDNode *AArch64DAGToDAGISel::SelectVLD(SDNode *N, unsigned NumVecs,
551 const uint16_t *Opcodes) {
552 assert(NumVecs >= 1 && NumVecs <= 4 && "VLD NumVecs out-of-range");
554 EVT VT = N->getValueType(0);
555 unsigned OpcodeIndex;
556 switch (VT.getSimpleVT().SimpleTy) {
557 default: llvm_unreachable("unhandled vector load type");
558 case MVT::v8i8: OpcodeIndex = 0; break;
559 case MVT::v4i16: OpcodeIndex = 1; break;
561 case MVT::v2i32: OpcodeIndex = 2; break;
563 case MVT::v1i64: OpcodeIndex = 3; break;
564 case MVT::v16i8: OpcodeIndex = 4; break;
566 case MVT::v8i16: OpcodeIndex = 5; break;
568 case MVT::v4i32: OpcodeIndex = 6; break;
570 case MVT::v2i64: OpcodeIndex = 7; break;
572 unsigned Opc = Opcodes[OpcodeIndex];
574 SmallVector<SDValue, 2> Ops;
575 unsigned AddrOpIdx = isUpdating ? 1 : 2;
576 Ops.push_back(N->getOperand(AddrOpIdx)); // Push back the Memory Address
579 SDValue Inc = N->getOperand(AddrOpIdx + 1);
580 if (!isa<ConstantSDNode>(Inc.getNode())) // Increment in Register
581 Opc = getVLDSTRegisterUpdateOpcode(Opc);
585 Ops.push_back(N->getOperand(0)); // Push back the Chain
587 std::vector<EVT> ResTys;
588 bool is64BitVector = VT.is64BitVector();
591 ResTys.push_back(VT);
592 else if (NumVecs == 3)
593 ResTys.push_back(MVT::Untyped);
595 EVT ResTy = EVT::getVectorVT(*CurDAG->getContext(), MVT::i64,
596 is64BitVector ? NumVecs : NumVecs * 2);
597 ResTys.push_back(ResTy);
601 ResTys.push_back(MVT::i64); // Type of the updated register
602 ResTys.push_back(MVT::Other); // Type of the Chain
604 SDNode *VLd = CurDAG->getMachineNode(Opc, dl, ResTys, Ops);
606 // Transfer memoperands.
607 MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
608 MemOp[0] = cast<MemIntrinsicSDNode>(N)->getMemOperand();
609 cast<MachineSDNode>(VLd)->setMemRefs(MemOp, MemOp + 1);
614 // If NumVecs > 1, the return result is a super register containing 2-4
615 // consecutive vector registers.
616 SDValue SuperReg = SDValue(VLd, 0);
618 unsigned Sub0 = is64BitVector ? AArch64::dsub_0 : AArch64::qsub_0;
619 for (unsigned Vec = 0; Vec < NumVecs; ++Vec)
620 ReplaceUses(SDValue(N, Vec),
621 CurDAG->getTargetExtractSubreg(Sub0 + Vec, dl, VT, SuperReg));
622 // Update users of the Chain
623 ReplaceUses(SDValue(N, NumVecs), SDValue(VLd, 1));
625 ReplaceUses(SDValue(N, NumVecs + 1), SDValue(VLd, 2));
630 SDNode *AArch64DAGToDAGISel::SelectVST(SDNode *N, unsigned NumVecs,
632 const uint16_t *Opcodes) {
633 assert(NumVecs >= 1 && NumVecs <= 4 && "VST NumVecs out-of-range");
636 MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
637 MemOp[0] = cast<MemIntrinsicSDNode>(N)->getMemOperand();
639 unsigned AddrOpIdx = isUpdating ? 1 : 2;
640 unsigned Vec0Idx = 3; // AddrOpIdx + (isUpdating ? 2 : 1)
641 EVT VT = N->getOperand(Vec0Idx).getValueType();
642 unsigned OpcodeIndex;
643 switch (VT.getSimpleVT().SimpleTy) {
644 default: llvm_unreachable("unhandled vector store type");
645 case MVT::v8i8: OpcodeIndex = 0; break;
646 case MVT::v4i16: OpcodeIndex = 1; break;
648 case MVT::v2i32: OpcodeIndex = 2; break;
650 case MVT::v1i64: OpcodeIndex = 3; break;
651 case MVT::v16i8: OpcodeIndex = 4; break;
653 case MVT::v8i16: OpcodeIndex = 5; break;
655 case MVT::v4i32: OpcodeIndex = 6; break;
657 case MVT::v2i64: OpcodeIndex = 7; break;
659 unsigned Opc = Opcodes[OpcodeIndex];
661 std::vector<EVT> ResTys;
663 ResTys.push_back(MVT::i64);
664 ResTys.push_back(MVT::Other); // Type for the Chain
666 SmallVector<SDValue, 6> Ops;
667 Ops.push_back(N->getOperand(AddrOpIdx)); // Push back the Memory Address
670 SDValue Inc = N->getOperand(AddrOpIdx + 1);
671 if (!isa<ConstantSDNode>(Inc.getNode())) // Increment in Register
672 Opc = getVLDSTRegisterUpdateOpcode(Opc);
675 bool is64BitVector = VT.is64BitVector();
677 SmallVector<SDValue, 4> Regs(N->op_begin() + Vec0Idx,
678 N->op_begin() + Vec0Idx + NumVecs);
679 SDValue SrcReg = is64BitVector ? createDTuple(Regs) : createQTuple(Regs);
680 Ops.push_back(SrcReg);
682 // Push back the Chain
683 Ops.push_back(N->getOperand(0));
685 // Transfer memoperands.
686 SDNode *VSt = CurDAG->getMachineNode(Opc, dl, ResTys, Ops);
687 cast<MachineSDNode>(VSt)->setMemRefs(MemOp, MemOp + 1);
692 unsigned AArch64DAGToDAGISel::getTBLOpc(bool IsExt, bool Is64Bit,
694 assert(NumOfVec >= 1 && NumOfVec <= 4 && "VST NumVecs out-of-range");
702 Opc = Is64Bit ? AArch64::TBX1_8b : AArch64::TBX1_16b;
704 Opc = Is64Bit ? AArch64::TBL1_8b : AArch64::TBL1_16b;
708 Opc = Is64Bit ? AArch64::TBX2_8b : AArch64::TBX2_16b;
710 Opc = Is64Bit ? AArch64::TBL2_8b : AArch64::TBL2_16b;
714 Opc = Is64Bit ? AArch64::TBX3_8b : AArch64::TBX3_16b;
716 Opc = Is64Bit ? AArch64::TBL3_8b : AArch64::TBL3_16b;
720 Opc = Is64Bit ? AArch64::TBX4_8b : AArch64::TBX4_16b;
722 Opc = Is64Bit ? AArch64::TBL4_8b : AArch64::TBL4_16b;
729 SDNode *AArch64DAGToDAGISel::SelectVTBL(SDNode *N, unsigned NumVecs,
731 assert(NumVecs >= 1 && NumVecs <= 4 && "VST NumVecs out-of-range");
734 // Check the element of look up table is 64-bit or not
735 unsigned Vec0Idx = IsExt ? 2 : 1;
736 SDValue V0 = N->getOperand(Vec0Idx + 0);
737 EVT VT = V0.getValueType();
738 assert(!VT.is64BitVector() &&
739 "The element of lookup table for vtbl and vtbx must be 128-bit");
741 // Check the return value type is 64-bit or not
742 EVT ResVT = N->getValueType(0);
743 bool is64BitRes = ResVT.is64BitVector();
745 // Create new SDValue for vector list
746 SmallVector<SDValue, 4> Regs(N->op_begin() + Vec0Idx,
747 N->op_begin() + Vec0Idx + NumVecs);
748 SDValue TblReg = createQTuple(Regs);
749 unsigned Opc = getTBLOpc(IsExt, is64BitRes, NumVecs);
751 SmallVector<SDValue, 3> Ops;
753 Ops.push_back(N->getOperand(1));
754 Ops.push_back(TblReg);
755 Ops.push_back(N->getOperand(Vec0Idx + NumVecs));
756 return CurDAG->getMachineNode(Opc, dl, ResVT, Ops);
759 SDNode *AArch64DAGToDAGISel::Select(SDNode *Node) {
760 // Dump information about the Node being selected
761 DEBUG(dbgs() << "Selecting: "; Node->dump(CurDAG); dbgs() << "\n");
763 if (Node->isMachineOpcode()) {
764 DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << "\n");
769 switch (Node->getOpcode()) {
770 case ISD::ATOMIC_LOAD_ADD:
771 return SelectAtomic(Node,
772 AArch64::ATOMIC_LOAD_ADD_I8,
773 AArch64::ATOMIC_LOAD_ADD_I16,
774 AArch64::ATOMIC_LOAD_ADD_I32,
775 AArch64::ATOMIC_LOAD_ADD_I64);
776 case ISD::ATOMIC_LOAD_SUB:
777 return SelectAtomic(Node,
778 AArch64::ATOMIC_LOAD_SUB_I8,
779 AArch64::ATOMIC_LOAD_SUB_I16,
780 AArch64::ATOMIC_LOAD_SUB_I32,
781 AArch64::ATOMIC_LOAD_SUB_I64);
782 case ISD::ATOMIC_LOAD_AND:
783 return SelectAtomic(Node,
784 AArch64::ATOMIC_LOAD_AND_I8,
785 AArch64::ATOMIC_LOAD_AND_I16,
786 AArch64::ATOMIC_LOAD_AND_I32,
787 AArch64::ATOMIC_LOAD_AND_I64);
788 case ISD::ATOMIC_LOAD_OR:
789 return SelectAtomic(Node,
790 AArch64::ATOMIC_LOAD_OR_I8,
791 AArch64::ATOMIC_LOAD_OR_I16,
792 AArch64::ATOMIC_LOAD_OR_I32,
793 AArch64::ATOMIC_LOAD_OR_I64);
794 case ISD::ATOMIC_LOAD_XOR:
795 return SelectAtomic(Node,
796 AArch64::ATOMIC_LOAD_XOR_I8,
797 AArch64::ATOMIC_LOAD_XOR_I16,
798 AArch64::ATOMIC_LOAD_XOR_I32,
799 AArch64::ATOMIC_LOAD_XOR_I64);
800 case ISD::ATOMIC_LOAD_NAND:
801 return SelectAtomic(Node,
802 AArch64::ATOMIC_LOAD_NAND_I8,
803 AArch64::ATOMIC_LOAD_NAND_I16,
804 AArch64::ATOMIC_LOAD_NAND_I32,
805 AArch64::ATOMIC_LOAD_NAND_I64);
806 case ISD::ATOMIC_LOAD_MIN:
807 return SelectAtomic(Node,
808 AArch64::ATOMIC_LOAD_MIN_I8,
809 AArch64::ATOMIC_LOAD_MIN_I16,
810 AArch64::ATOMIC_LOAD_MIN_I32,
811 AArch64::ATOMIC_LOAD_MIN_I64);
812 case ISD::ATOMIC_LOAD_MAX:
813 return SelectAtomic(Node,
814 AArch64::ATOMIC_LOAD_MAX_I8,
815 AArch64::ATOMIC_LOAD_MAX_I16,
816 AArch64::ATOMIC_LOAD_MAX_I32,
817 AArch64::ATOMIC_LOAD_MAX_I64);
818 case ISD::ATOMIC_LOAD_UMIN:
819 return SelectAtomic(Node,
820 AArch64::ATOMIC_LOAD_UMIN_I8,
821 AArch64::ATOMIC_LOAD_UMIN_I16,
822 AArch64::ATOMIC_LOAD_UMIN_I32,
823 AArch64::ATOMIC_LOAD_UMIN_I64);
824 case ISD::ATOMIC_LOAD_UMAX:
825 return SelectAtomic(Node,
826 AArch64::ATOMIC_LOAD_UMAX_I8,
827 AArch64::ATOMIC_LOAD_UMAX_I16,
828 AArch64::ATOMIC_LOAD_UMAX_I32,
829 AArch64::ATOMIC_LOAD_UMAX_I64);
830 case ISD::ATOMIC_SWAP:
831 return SelectAtomic(Node,
832 AArch64::ATOMIC_SWAP_I8,
833 AArch64::ATOMIC_SWAP_I16,
834 AArch64::ATOMIC_SWAP_I32,
835 AArch64::ATOMIC_SWAP_I64);
836 case ISD::ATOMIC_CMP_SWAP:
837 return SelectAtomic(Node,
838 AArch64::ATOMIC_CMP_SWAP_I8,
839 AArch64::ATOMIC_CMP_SWAP_I16,
840 AArch64::ATOMIC_CMP_SWAP_I32,
841 AArch64::ATOMIC_CMP_SWAP_I64);
842 case ISD::FrameIndex: {
843 int FI = cast<FrameIndexSDNode>(Node)->getIndex();
844 EVT PtrTy = getTargetLowering()->getPointerTy();
845 SDValue TFI = CurDAG->getTargetFrameIndex(FI, PtrTy);
846 return CurDAG->SelectNodeTo(Node, AArch64::ADDxxi_lsl0_s, PtrTy,
847 TFI, CurDAG->getTargetConstant(0, PtrTy));
849 case ISD::ConstantPool: {
850 // Constant pools are fine, just create a Target entry.
851 ConstantPoolSDNode *CN = cast<ConstantPoolSDNode>(Node);
852 const Constant *C = CN->getConstVal();
853 SDValue CP = CurDAG->getTargetConstantPool(C, CN->getValueType(0));
855 ReplaceUses(SDValue(Node, 0), CP);
858 case ISD::Constant: {
860 if (cast<ConstantSDNode>(Node)->getZExtValue() == 0) {
861 // XZR and WZR are probably even better than an actual move: most of the
862 // time they can be folded into another instruction with *no* cost.
864 EVT Ty = Node->getValueType(0);
865 assert((Ty == MVT::i32 || Ty == MVT::i64) && "unexpected type");
866 uint16_t Register = Ty == MVT::i32 ? AArch64::WZR : AArch64::XZR;
867 ResNode = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
869 Register, Ty).getNode();
872 // Next best option is a move-immediate, see if we can do that.
874 ResNode = TrySelectToMoveImm(Node);
880 // If even that fails we fall back to a lit-pool entry at the moment. Future
881 // tuning may change this to a sequence of MOVZ/MOVN/MOVK instructions.
882 ResNode = SelectToLitPool(Node);
883 assert(ResNode && "We need *some* way to materialise a constant");
885 // We want to continue selection at this point since the litpool access
886 // generated used generic nodes for simplicity.
887 ReplaceUses(SDValue(Node, 0), SDValue(ResNode, 0));
891 case ISD::ConstantFP: {
892 if (A64Imms::isFPImm(cast<ConstantFPSDNode>(Node)->getValueAPF())) {
893 // FMOV will take care of it from TableGen
897 SDNode *ResNode = LowerToFPLitPool(Node);
898 ReplaceUses(SDValue(Node, 0), SDValue(ResNode, 0));
900 // We want to continue selection at this point since the litpool access
901 // generated used generic nodes for simplicity.
905 case AArch64ISD::NEON_LD1_UPD: {
906 static const uint16_t Opcodes[] = {
907 AArch64::LD1WB_8B_fixed, AArch64::LD1WB_4H_fixed,
908 AArch64::LD1WB_2S_fixed, AArch64::LD1WB_1D_fixed,
909 AArch64::LD1WB_16B_fixed, AArch64::LD1WB_8H_fixed,
910 AArch64::LD1WB_4S_fixed, AArch64::LD1WB_2D_fixed
912 return SelectVLD(Node, 1, true, Opcodes);
914 case AArch64ISD::NEON_LD2_UPD: {
915 static const uint16_t Opcodes[] = {
916 AArch64::LD2WB_8B_fixed, AArch64::LD2WB_4H_fixed,
917 AArch64::LD2WB_2S_fixed, AArch64::LD1WB2V_1D_fixed,
918 AArch64::LD2WB_16B_fixed, AArch64::LD2WB_8H_fixed,
919 AArch64::LD2WB_4S_fixed, AArch64::LD2WB_2D_fixed
921 return SelectVLD(Node, 2, true, Opcodes);
923 case AArch64ISD::NEON_LD3_UPD: {
924 static const uint16_t Opcodes[] = {
925 AArch64::LD3WB_8B_fixed, AArch64::LD3WB_4H_fixed,
926 AArch64::LD3WB_2S_fixed, AArch64::LD1WB3V_1D_fixed,
927 AArch64::LD3WB_16B_fixed, AArch64::LD3WB_8H_fixed,
928 AArch64::LD3WB_4S_fixed, AArch64::LD3WB_2D_fixed
930 return SelectVLD(Node, 3, true, Opcodes);
932 case AArch64ISD::NEON_LD4_UPD: {
933 static const uint16_t Opcodes[] = {
934 AArch64::LD4WB_8B_fixed, AArch64::LD4WB_4H_fixed,
935 AArch64::LD4WB_2S_fixed, AArch64::LD1WB4V_1D_fixed,
936 AArch64::LD4WB_16B_fixed, AArch64::LD4WB_8H_fixed,
937 AArch64::LD4WB_4S_fixed, AArch64::LD4WB_2D_fixed
939 return SelectVLD(Node, 4, true, Opcodes);
941 case AArch64ISD::NEON_ST1_UPD: {
942 static const uint16_t Opcodes[] = {
943 AArch64::ST1WB_8B_fixed, AArch64::ST1WB_4H_fixed,
944 AArch64::ST1WB_2S_fixed, AArch64::ST1WB_1D_fixed,
945 AArch64::ST1WB_16B_fixed, AArch64::ST1WB_8H_fixed,
946 AArch64::ST1WB_4S_fixed, AArch64::ST1WB_2D_fixed
948 return SelectVST(Node, 1, true, Opcodes);
950 case AArch64ISD::NEON_ST2_UPD: {
951 static const uint16_t Opcodes[] = {
952 AArch64::ST2WB_8B_fixed, AArch64::ST2WB_4H_fixed,
953 AArch64::ST2WB_2S_fixed, AArch64::ST1WB2V_1D_fixed,
954 AArch64::ST2WB_16B_fixed, AArch64::ST2WB_8H_fixed,
955 AArch64::ST2WB_4S_fixed, AArch64::ST2WB_2D_fixed
957 return SelectVST(Node, 2, true, Opcodes);
959 case AArch64ISD::NEON_ST3_UPD: {
960 static const uint16_t Opcodes[] = {
961 AArch64::ST3WB_8B_fixed, AArch64::ST3WB_4H_fixed,
962 AArch64::ST3WB_2S_fixed, AArch64::ST1WB3V_1D_fixed,
963 AArch64::ST3WB_16B_fixed, AArch64::ST3WB_8H_fixed,
964 AArch64::ST3WB_4S_fixed, AArch64::ST3WB_2D_fixed
966 return SelectVST(Node, 3, true, Opcodes);
968 case AArch64ISD::NEON_ST4_UPD: {
969 static const uint16_t Opcodes[] = {
970 AArch64::ST4WB_8B_fixed, AArch64::ST4WB_4H_fixed,
971 AArch64::ST4WB_2S_fixed, AArch64::ST1WB4V_1D_fixed,
972 AArch64::ST4WB_16B_fixed, AArch64::ST4WB_8H_fixed,
973 AArch64::ST4WB_4S_fixed, AArch64::ST4WB_2D_fixed
975 return SelectVST(Node, 4, true, Opcodes);
977 case ISD::INTRINSIC_WO_CHAIN: {
978 unsigned IntNo = cast<ConstantSDNode>(Node->getOperand(0))->getZExtValue();
983 case Intrinsic::aarch64_neon_vtbx1:
985 case Intrinsic::aarch64_neon_vtbl1:
986 return SelectVTBL(Node, 1, IsExt);
987 case Intrinsic::aarch64_neon_vtbx2:
989 case Intrinsic::aarch64_neon_vtbl2:
990 return SelectVTBL(Node, 2, IsExt);
991 case Intrinsic::aarch64_neon_vtbx3:
993 case Intrinsic::aarch64_neon_vtbl3:
994 return SelectVTBL(Node, 3, IsExt);
995 case Intrinsic::aarch64_neon_vtbx4:
997 case Intrinsic::aarch64_neon_vtbl4:
998 return SelectVTBL(Node, 4, IsExt);
1002 case ISD::INTRINSIC_VOID:
1003 case ISD::INTRINSIC_W_CHAIN: {
1004 unsigned IntNo = cast<ConstantSDNode>(Node->getOperand(1))->getZExtValue();
1009 case Intrinsic::arm_neon_vld1: {
1010 static const uint16_t Opcodes[] = { AArch64::LD1_8B, AArch64::LD1_4H,
1011 AArch64::LD1_2S, AArch64::LD1_1D,
1012 AArch64::LD1_16B, AArch64::LD1_8H,
1013 AArch64::LD1_4S, AArch64::LD1_2D };
1014 return SelectVLD(Node, 1, false, Opcodes);
1016 case Intrinsic::arm_neon_vld2: {
1017 static const uint16_t Opcodes[] = { AArch64::LD2_8B, AArch64::LD2_4H,
1018 AArch64::LD2_2S, AArch64::LD1_2V_1D,
1019 AArch64::LD2_16B, AArch64::LD2_8H,
1020 AArch64::LD2_4S, AArch64::LD2_2D };
1021 return SelectVLD(Node, 2, false, Opcodes);
1023 case Intrinsic::arm_neon_vld3: {
1024 static const uint16_t Opcodes[] = { AArch64::LD3_8B, AArch64::LD3_4H,
1025 AArch64::LD3_2S, AArch64::LD1_3V_1D,
1026 AArch64::LD3_16B, AArch64::LD3_8H,
1027 AArch64::LD3_4S, AArch64::LD3_2D };
1028 return SelectVLD(Node, 3, false, Opcodes);
1030 case Intrinsic::arm_neon_vld4: {
1031 static const uint16_t Opcodes[] = { AArch64::LD4_8B, AArch64::LD4_4H,
1032 AArch64::LD4_2S, AArch64::LD1_4V_1D,
1033 AArch64::LD4_16B, AArch64::LD4_8H,
1034 AArch64::LD4_4S, AArch64::LD4_2D };
1035 return SelectVLD(Node, 4, false, Opcodes);
1037 case Intrinsic::arm_neon_vst1: {
1038 static const uint16_t Opcodes[] = { AArch64::ST1_8B, AArch64::ST1_4H,
1039 AArch64::ST1_2S, AArch64::ST1_1D,
1040 AArch64::ST1_16B, AArch64::ST1_8H,
1041 AArch64::ST1_4S, AArch64::ST1_2D };
1042 return SelectVST(Node, 1, false, Opcodes);
1044 case Intrinsic::arm_neon_vst2: {
1045 static const uint16_t Opcodes[] = { AArch64::ST2_8B, AArch64::ST2_4H,
1046 AArch64::ST2_2S, AArch64::ST1_2V_1D,
1047 AArch64::ST2_16B, AArch64::ST2_8H,
1048 AArch64::ST2_4S, AArch64::ST2_2D };
1049 return SelectVST(Node, 2, false, Opcodes);
1051 case Intrinsic::arm_neon_vst3: {
1052 static const uint16_t Opcodes[] = { AArch64::ST3_8B, AArch64::ST3_4H,
1053 AArch64::ST3_2S, AArch64::ST1_3V_1D,
1054 AArch64::ST3_16B, AArch64::ST3_8H,
1055 AArch64::ST3_4S, AArch64::ST3_2D };
1056 return SelectVST(Node, 3, false, Opcodes);
1058 case Intrinsic::arm_neon_vst4: {
1059 static const uint16_t Opcodes[] = { AArch64::ST4_8B, AArch64::ST4_4H,
1060 AArch64::ST4_2S, AArch64::ST1_4V_1D,
1061 AArch64::ST4_16B, AArch64::ST4_8H,
1062 AArch64::ST4_4S, AArch64::ST4_2D };
1063 return SelectVST(Node, 4, false, Opcodes);
1069 break; // Let generic code handle it
1072 SDNode *ResNode = SelectCode(Node);
1074 DEBUG(dbgs() << "=> ";
1075 if (ResNode == NULL || ResNode == Node)
1078 ResNode->dump(CurDAG);
1084 /// This pass converts a legalized DAG into a AArch64-specific DAG, ready for
1085 /// instruction scheduling.
1086 FunctionPass *llvm::createAArch64ISelDAG(AArch64TargetMachine &TM,
1087 CodeGenOpt::Level OptLevel) {
1088 return new AArch64DAGToDAGISel(TM, OptLevel);