xref: /minix3/external/bsd/llvm/dist/llvm/lib/Target/ARM/ARMISelLowering.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc //===-- ARMISelLowering.h - ARM DAG Lowering Interface ----------*- C++ -*-===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10f4a2713aSLionel Sambuc // This file defines the interfaces that ARM uses to lower LLVM code into a
11f4a2713aSLionel Sambuc // selection DAG.
12f4a2713aSLionel Sambuc //
13f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
14f4a2713aSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc #ifndef LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
16*0a6a1f1dSLionel Sambuc #define LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
17f4a2713aSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc #include "MCTargetDesc/ARMBaseInfo.h"
19f4a2713aSLionel Sambuc #include "llvm/CodeGen/CallingConvLower.h"
20f4a2713aSLionel Sambuc #include "llvm/CodeGen/SelectionDAG.h"
21f4a2713aSLionel Sambuc #include "llvm/Target/TargetLowering.h"
22f4a2713aSLionel Sambuc #include <vector>
23f4a2713aSLionel Sambuc 
24f4a2713aSLionel Sambuc namespace llvm {
25f4a2713aSLionel Sambuc   class ARMConstantPoolValue;
26*0a6a1f1dSLionel Sambuc   class ARMSubtarget;
27f4a2713aSLionel Sambuc 
28f4a2713aSLionel Sambuc   namespace ARMISD {
29f4a2713aSLionel Sambuc     // ARM Specific DAG Nodes
30f4a2713aSLionel Sambuc     enum NodeType {
31f4a2713aSLionel Sambuc       // Start the numbering where the builtin ops and target ops leave off.
32f4a2713aSLionel Sambuc       FIRST_NUMBER = ISD::BUILTIN_OP_END,
33f4a2713aSLionel Sambuc 
34f4a2713aSLionel Sambuc       Wrapper,      // Wrapper - A wrapper node for TargetConstantPool,
35f4a2713aSLionel Sambuc                     // TargetExternalSymbol, and TargetGlobalAddress.
36f4a2713aSLionel Sambuc       WrapperPIC,   // WrapperPIC - A wrapper node for TargetGlobalAddress in
37f4a2713aSLionel Sambuc                     // PIC mode.
38f4a2713aSLionel Sambuc       WrapperJT,    // WrapperJT - A wrapper node for TargetJumpTable
39f4a2713aSLionel Sambuc 
40f4a2713aSLionel Sambuc       // Add pseudo op to model memcpy for struct byval.
41f4a2713aSLionel Sambuc       COPY_STRUCT_BYVAL,
42f4a2713aSLionel Sambuc 
43f4a2713aSLionel Sambuc       CALL,         // Function call.
44f4a2713aSLionel Sambuc       CALL_PRED,    // Function call that's predicable.
45f4a2713aSLionel Sambuc       CALL_NOLINK,  // Function call with branch not branch-and-link.
46f4a2713aSLionel Sambuc       tCALL,        // Thumb function call.
47f4a2713aSLionel Sambuc       BRCOND,       // Conditional branch.
48f4a2713aSLionel Sambuc       BR_JT,        // Jumptable branch.
49f4a2713aSLionel Sambuc       BR2_JT,       // Jumptable branch (2 level - jumptable entry is a jump).
50f4a2713aSLionel Sambuc       RET_FLAG,     // Return with a flag operand.
51f4a2713aSLionel Sambuc       INTRET_FLAG,  // Interrupt return with an LR-offset and a flag operand.
52f4a2713aSLionel Sambuc 
53f4a2713aSLionel Sambuc       PIC_ADD,      // Add with a PC operand and a PIC label.
54f4a2713aSLionel Sambuc 
55f4a2713aSLionel Sambuc       CMP,          // ARM compare instructions.
56f4a2713aSLionel Sambuc       CMN,          // ARM CMN instructions.
57f4a2713aSLionel Sambuc       CMPZ,         // ARM compare that sets only Z flag.
58f4a2713aSLionel Sambuc       CMPFP,        // ARM VFP compare instruction, sets FPSCR.
59f4a2713aSLionel Sambuc       CMPFPw0,      // ARM VFP compare against zero instruction, sets FPSCR.
60f4a2713aSLionel Sambuc       FMSTAT,       // ARM fmstat instruction.
61f4a2713aSLionel Sambuc 
62f4a2713aSLionel Sambuc       CMOV,         // ARM conditional move instructions.
63f4a2713aSLionel Sambuc 
64f4a2713aSLionel Sambuc       BCC_i64,
65f4a2713aSLionel Sambuc 
66f4a2713aSLionel Sambuc       RBIT,         // ARM bitreverse instruction
67f4a2713aSLionel Sambuc 
68f4a2713aSLionel Sambuc       FTOSI,        // FP to sint within a FP register.
69f4a2713aSLionel Sambuc       FTOUI,        // FP to uint within a FP register.
70f4a2713aSLionel Sambuc       SITOF,        // sint to FP within a FP register.
71f4a2713aSLionel Sambuc       UITOF,        // uint to FP within a FP register.
72f4a2713aSLionel Sambuc 
73f4a2713aSLionel Sambuc       SRL_FLAG,     // V,Flag = srl_flag X -> srl X, 1 + save carry out.
74f4a2713aSLionel Sambuc       SRA_FLAG,     // V,Flag = sra_flag X -> sra X, 1 + save carry out.
75f4a2713aSLionel Sambuc       RRX,          // V = RRX X, Flag     -> srl X, 1 + shift in carry flag.
76f4a2713aSLionel Sambuc 
77f4a2713aSLionel Sambuc       ADDC,         // Add with carry
78f4a2713aSLionel Sambuc       ADDE,         // Add using carry
79f4a2713aSLionel Sambuc       SUBC,         // Sub with carry
80f4a2713aSLionel Sambuc       SUBE,         // Sub using carry
81f4a2713aSLionel Sambuc 
82f4a2713aSLionel Sambuc       VMOVRRD,      // double to two gprs.
83f4a2713aSLionel Sambuc       VMOVDRR,      // Two gprs to double.
84f4a2713aSLionel Sambuc 
85f4a2713aSLionel Sambuc       EH_SJLJ_SETJMP,         // SjLj exception handling setjmp.
86f4a2713aSLionel Sambuc       EH_SJLJ_LONGJMP,        // SjLj exception handling longjmp.
87f4a2713aSLionel Sambuc 
88f4a2713aSLionel Sambuc       TC_RETURN,    // Tail call return pseudo.
89f4a2713aSLionel Sambuc 
90f4a2713aSLionel Sambuc       THREAD_POINTER,
91f4a2713aSLionel Sambuc 
92f4a2713aSLionel Sambuc       DYN_ALLOC,    // Dynamic allocation on the stack.
93f4a2713aSLionel Sambuc 
94f4a2713aSLionel Sambuc       MEMBARRIER_MCR, // Memory barrier (MCR)
95f4a2713aSLionel Sambuc 
96f4a2713aSLionel Sambuc       PRELOAD,      // Preload
97f4a2713aSLionel Sambuc 
98*0a6a1f1dSLionel Sambuc       WIN__CHKSTK,  // Windows' __chkstk call to do stack probing.
99*0a6a1f1dSLionel Sambuc 
100f4a2713aSLionel Sambuc       VCEQ,         // Vector compare equal.
101f4a2713aSLionel Sambuc       VCEQZ,        // Vector compare equal to zero.
102f4a2713aSLionel Sambuc       VCGE,         // Vector compare greater than or equal.
103f4a2713aSLionel Sambuc       VCGEZ,        // Vector compare greater than or equal to zero.
104f4a2713aSLionel Sambuc       VCLEZ,        // Vector compare less than or equal to zero.
105f4a2713aSLionel Sambuc       VCGEU,        // Vector compare unsigned greater than or equal.
106f4a2713aSLionel Sambuc       VCGT,         // Vector compare greater than.
107f4a2713aSLionel Sambuc       VCGTZ,        // Vector compare greater than zero.
108f4a2713aSLionel Sambuc       VCLTZ,        // Vector compare less than zero.
109f4a2713aSLionel Sambuc       VCGTU,        // Vector compare unsigned greater than.
110f4a2713aSLionel Sambuc       VTST,         // Vector test bits.
111f4a2713aSLionel Sambuc 
112f4a2713aSLionel Sambuc       // Vector shift by immediate:
113f4a2713aSLionel Sambuc       VSHL,         // ...left
114f4a2713aSLionel Sambuc       VSHRs,        // ...right (signed)
115f4a2713aSLionel Sambuc       VSHRu,        // ...right (unsigned)
116f4a2713aSLionel Sambuc 
117f4a2713aSLionel Sambuc       // Vector rounding shift by immediate:
118f4a2713aSLionel Sambuc       VRSHRs,       // ...right (signed)
119f4a2713aSLionel Sambuc       VRSHRu,       // ...right (unsigned)
120f4a2713aSLionel Sambuc       VRSHRN,       // ...right narrow
121f4a2713aSLionel Sambuc 
122f4a2713aSLionel Sambuc       // Vector saturating shift by immediate:
123f4a2713aSLionel Sambuc       VQSHLs,       // ...left (signed)
124f4a2713aSLionel Sambuc       VQSHLu,       // ...left (unsigned)
125f4a2713aSLionel Sambuc       VQSHLsu,      // ...left (signed to unsigned)
126f4a2713aSLionel Sambuc       VQSHRNs,      // ...right narrow (signed)
127f4a2713aSLionel Sambuc       VQSHRNu,      // ...right narrow (unsigned)
128f4a2713aSLionel Sambuc       VQSHRNsu,     // ...right narrow (signed to unsigned)
129f4a2713aSLionel Sambuc 
130f4a2713aSLionel Sambuc       // Vector saturating rounding shift by immediate:
131f4a2713aSLionel Sambuc       VQRSHRNs,     // ...right narrow (signed)
132f4a2713aSLionel Sambuc       VQRSHRNu,     // ...right narrow (unsigned)
133f4a2713aSLionel Sambuc       VQRSHRNsu,    // ...right narrow (signed to unsigned)
134f4a2713aSLionel Sambuc 
135f4a2713aSLionel Sambuc       // Vector shift and insert:
136f4a2713aSLionel Sambuc       VSLI,         // ...left
137f4a2713aSLionel Sambuc       VSRI,         // ...right
138f4a2713aSLionel Sambuc 
139f4a2713aSLionel Sambuc       // Vector get lane (VMOV scalar to ARM core register)
140f4a2713aSLionel Sambuc       // (These are used for 8- and 16-bit element types only.)
141f4a2713aSLionel Sambuc       VGETLANEu,    // zero-extend vector extract element
142f4a2713aSLionel Sambuc       VGETLANEs,    // sign-extend vector extract element
143f4a2713aSLionel Sambuc 
144f4a2713aSLionel Sambuc       // Vector move immediate and move negated immediate:
145f4a2713aSLionel Sambuc       VMOVIMM,
146f4a2713aSLionel Sambuc       VMVNIMM,
147f4a2713aSLionel Sambuc 
148f4a2713aSLionel Sambuc       // Vector move f32 immediate:
149f4a2713aSLionel Sambuc       VMOVFPIMM,
150f4a2713aSLionel Sambuc 
151f4a2713aSLionel Sambuc       // Vector duplicate:
152f4a2713aSLionel Sambuc       VDUP,
153f4a2713aSLionel Sambuc       VDUPLANE,
154f4a2713aSLionel Sambuc 
155f4a2713aSLionel Sambuc       // Vector shuffles:
156f4a2713aSLionel Sambuc       VEXT,         // extract
157f4a2713aSLionel Sambuc       VREV64,       // reverse elements within 64-bit doublewords
158f4a2713aSLionel Sambuc       VREV32,       // reverse elements within 32-bit words
159f4a2713aSLionel Sambuc       VREV16,       // reverse elements within 16-bit halfwords
160f4a2713aSLionel Sambuc       VZIP,         // zip (interleave)
161f4a2713aSLionel Sambuc       VUZP,         // unzip (deinterleave)
162f4a2713aSLionel Sambuc       VTRN,         // transpose
163f4a2713aSLionel Sambuc       VTBL1,        // 1-register shuffle with mask
164f4a2713aSLionel Sambuc       VTBL2,        // 2-register shuffle with mask
165f4a2713aSLionel Sambuc 
166f4a2713aSLionel Sambuc       // Vector multiply long:
167f4a2713aSLionel Sambuc       VMULLs,       // ...signed
168f4a2713aSLionel Sambuc       VMULLu,       // ...unsigned
169f4a2713aSLionel Sambuc 
170f4a2713aSLionel Sambuc       UMLAL,        // 64bit Unsigned Accumulate Multiply
171f4a2713aSLionel Sambuc       SMLAL,        // 64bit Signed Accumulate Multiply
172f4a2713aSLionel Sambuc 
173f4a2713aSLionel Sambuc       // Operands of the standard BUILD_VECTOR node are not legalized, which
174f4a2713aSLionel Sambuc       // is fine if BUILD_VECTORs are always lowered to shuffles or other
175f4a2713aSLionel Sambuc       // operations, but for ARM some BUILD_VECTORs are legal as-is and their
176f4a2713aSLionel Sambuc       // operands need to be legalized.  Define an ARM-specific version of
177f4a2713aSLionel Sambuc       // BUILD_VECTOR for this purpose.
178f4a2713aSLionel Sambuc       BUILD_VECTOR,
179f4a2713aSLionel Sambuc 
180f4a2713aSLionel Sambuc       // Floating-point max and min:
181f4a2713aSLionel Sambuc       FMAX,
182f4a2713aSLionel Sambuc       FMIN,
183f4a2713aSLionel Sambuc       VMAXNM,
184f4a2713aSLionel Sambuc       VMINNM,
185f4a2713aSLionel Sambuc 
186f4a2713aSLionel Sambuc       // Bit-field insert
187f4a2713aSLionel Sambuc       BFI,
188f4a2713aSLionel Sambuc 
189f4a2713aSLionel Sambuc       // Vector OR with immediate
190f4a2713aSLionel Sambuc       VORRIMM,
191f4a2713aSLionel Sambuc       // Vector AND with NOT of immediate
192f4a2713aSLionel Sambuc       VBICIMM,
193f4a2713aSLionel Sambuc 
194f4a2713aSLionel Sambuc       // Vector bitwise select
195f4a2713aSLionel Sambuc       VBSL,
196f4a2713aSLionel Sambuc 
197f4a2713aSLionel Sambuc       // Vector load N-element structure to all lanes:
198f4a2713aSLionel Sambuc       VLD2DUP = ISD::FIRST_TARGET_MEMORY_OPCODE,
199f4a2713aSLionel Sambuc       VLD3DUP,
200f4a2713aSLionel Sambuc       VLD4DUP,
201f4a2713aSLionel Sambuc 
202f4a2713aSLionel Sambuc       // NEON loads with post-increment base updates:
203f4a2713aSLionel Sambuc       VLD1_UPD,
204f4a2713aSLionel Sambuc       VLD2_UPD,
205f4a2713aSLionel Sambuc       VLD3_UPD,
206f4a2713aSLionel Sambuc       VLD4_UPD,
207f4a2713aSLionel Sambuc       VLD2LN_UPD,
208f4a2713aSLionel Sambuc       VLD3LN_UPD,
209f4a2713aSLionel Sambuc       VLD4LN_UPD,
210f4a2713aSLionel Sambuc       VLD2DUP_UPD,
211f4a2713aSLionel Sambuc       VLD3DUP_UPD,
212f4a2713aSLionel Sambuc       VLD4DUP_UPD,
213f4a2713aSLionel Sambuc 
214f4a2713aSLionel Sambuc       // NEON stores with post-increment base updates:
215f4a2713aSLionel Sambuc       VST1_UPD,
216f4a2713aSLionel Sambuc       VST2_UPD,
217f4a2713aSLionel Sambuc       VST3_UPD,
218f4a2713aSLionel Sambuc       VST4_UPD,
219f4a2713aSLionel Sambuc       VST2LN_UPD,
220f4a2713aSLionel Sambuc       VST3LN_UPD,
221f4a2713aSLionel Sambuc       VST4LN_UPD
222f4a2713aSLionel Sambuc     };
223f4a2713aSLionel Sambuc   }
224f4a2713aSLionel Sambuc 
225f4a2713aSLionel Sambuc   /// Define some predicates that are used for node matching.
226f4a2713aSLionel Sambuc   namespace ARM {
227f4a2713aSLionel Sambuc     bool isBitFieldInvertedMask(unsigned v);
228f4a2713aSLionel Sambuc   }
229f4a2713aSLionel Sambuc 
230f4a2713aSLionel Sambuc   //===--------------------------------------------------------------------===//
231f4a2713aSLionel Sambuc   //  ARMTargetLowering - ARM Implementation of the TargetLowering interface
232f4a2713aSLionel Sambuc 
233f4a2713aSLionel Sambuc   class ARMTargetLowering : public TargetLowering {
234f4a2713aSLionel Sambuc   public:
235*0a6a1f1dSLionel Sambuc     explicit ARMTargetLowering(const TargetMachine &TM);
236f4a2713aSLionel Sambuc 
237*0a6a1f1dSLionel Sambuc     unsigned getJumpTableEncoding() const override;
238f4a2713aSLionel Sambuc 
239*0a6a1f1dSLionel Sambuc     SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
240f4a2713aSLionel Sambuc 
241f4a2713aSLionel Sambuc     /// ReplaceNodeResults - Replace the results of node with an illegal result
242f4a2713aSLionel Sambuc     /// type with new values built out of custom code.
243f4a2713aSLionel Sambuc     ///
244*0a6a1f1dSLionel Sambuc     void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue>&Results,
245*0a6a1f1dSLionel Sambuc                             SelectionDAG &DAG) const override;
246f4a2713aSLionel Sambuc 
247*0a6a1f1dSLionel Sambuc     const char *getTargetNodeName(unsigned Opcode) const override;
248f4a2713aSLionel Sambuc 
isSelectSupported(SelectSupportKind Kind)249*0a6a1f1dSLionel Sambuc     bool isSelectSupported(SelectSupportKind Kind) const override {
250f4a2713aSLionel Sambuc       // ARM does not support scalar condition selects on vectors.
251f4a2713aSLionel Sambuc       return (Kind != ScalarCondVectorVal);
252f4a2713aSLionel Sambuc     }
253f4a2713aSLionel Sambuc 
254f4a2713aSLionel Sambuc     /// getSetCCResultType - Return the value type to use for ISD::SETCC.
255*0a6a1f1dSLionel Sambuc     EVT getSetCCResultType(LLVMContext &Context, EVT VT) const override;
256f4a2713aSLionel Sambuc 
257*0a6a1f1dSLionel Sambuc     MachineBasicBlock *
258f4a2713aSLionel Sambuc       EmitInstrWithCustomInserter(MachineInstr *MI,
259*0a6a1f1dSLionel Sambuc                                   MachineBasicBlock *MBB) const override;
260f4a2713aSLionel Sambuc 
261*0a6a1f1dSLionel Sambuc     void AdjustInstrPostInstrSelection(MachineInstr *MI,
262*0a6a1f1dSLionel Sambuc                                        SDNode *Node) const override;
263f4a2713aSLionel Sambuc 
264f4a2713aSLionel Sambuc     SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const;
265*0a6a1f1dSLionel Sambuc     SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
266f4a2713aSLionel Sambuc 
267*0a6a1f1dSLionel Sambuc     bool isDesirableToTransformToIntegerOp(unsigned Opc, EVT VT) const override;
268f4a2713aSLionel Sambuc 
269*0a6a1f1dSLionel Sambuc     /// allowsMisalignedMemoryAccesses - Returns true if the target allows
270f4a2713aSLionel Sambuc     /// unaligned memory accesses of the specified type. Returns whether it
271f4a2713aSLionel Sambuc     /// is "fast" by reference in the second argument.
272*0a6a1f1dSLionel Sambuc     bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
273*0a6a1f1dSLionel Sambuc                                         unsigned Align,
274*0a6a1f1dSLionel Sambuc                                         bool *Fast) const override;
275f4a2713aSLionel Sambuc 
276*0a6a1f1dSLionel Sambuc     EVT getOptimalMemOpType(uint64_t Size,
277f4a2713aSLionel Sambuc                             unsigned DstAlign, unsigned SrcAlign,
278f4a2713aSLionel Sambuc                             bool IsMemset, bool ZeroMemset,
279f4a2713aSLionel Sambuc                             bool MemcpyStrSrc,
280*0a6a1f1dSLionel Sambuc                             MachineFunction &MF) const override;
281f4a2713aSLionel Sambuc 
282f4a2713aSLionel Sambuc     using TargetLowering::isZExtFree;
283*0a6a1f1dSLionel Sambuc     bool isZExtFree(SDValue Val, EVT VT2) const override;
284f4a2713aSLionel Sambuc 
285*0a6a1f1dSLionel Sambuc     bool allowTruncateForTailCall(Type *Ty1, Type *Ty2) const override;
286f4a2713aSLionel Sambuc 
287f4a2713aSLionel Sambuc 
288f4a2713aSLionel Sambuc     /// isLegalAddressingMode - Return true if the addressing mode represented
289f4a2713aSLionel Sambuc     /// by AM is legal for this target, for a load/store of the specified type.
290*0a6a1f1dSLionel Sambuc     bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const override;
291f4a2713aSLionel Sambuc     bool isLegalT2ScaledAddressingMode(const AddrMode &AM, EVT VT) const;
292f4a2713aSLionel Sambuc 
293f4a2713aSLionel Sambuc     /// isLegalICmpImmediate - Return true if the specified immediate is legal
294f4a2713aSLionel Sambuc     /// icmp immediate, that is the target has icmp instructions which can
295f4a2713aSLionel Sambuc     /// compare a register against the immediate without having to materialize
296f4a2713aSLionel Sambuc     /// the immediate into a register.
297*0a6a1f1dSLionel Sambuc     bool isLegalICmpImmediate(int64_t Imm) const override;
298f4a2713aSLionel Sambuc 
299f4a2713aSLionel Sambuc     /// isLegalAddImmediate - Return true if the specified immediate is legal
300f4a2713aSLionel Sambuc     /// add immediate, that is the target has add instructions which can
301f4a2713aSLionel Sambuc     /// add a register and the immediate without having to materialize
302f4a2713aSLionel Sambuc     /// the immediate into a register.
303*0a6a1f1dSLionel Sambuc     bool isLegalAddImmediate(int64_t Imm) const override;
304f4a2713aSLionel Sambuc 
305f4a2713aSLionel Sambuc     /// getPreIndexedAddressParts - returns true by value, base pointer and
306f4a2713aSLionel Sambuc     /// offset pointer and addressing mode by reference if the node's address
307f4a2713aSLionel Sambuc     /// can be legally represented as pre-indexed load / store address.
308*0a6a1f1dSLionel Sambuc     bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset,
309f4a2713aSLionel Sambuc                                    ISD::MemIndexedMode &AM,
310*0a6a1f1dSLionel Sambuc                                    SelectionDAG &DAG) const override;
311f4a2713aSLionel Sambuc 
312f4a2713aSLionel Sambuc     /// getPostIndexedAddressParts - returns true by value, base pointer and
313f4a2713aSLionel Sambuc     /// offset pointer and addressing mode by reference if this node can be
314f4a2713aSLionel Sambuc     /// combined with a load / store to form a post-indexed load / store.
315*0a6a1f1dSLionel Sambuc     bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base,
316*0a6a1f1dSLionel Sambuc                                     SDValue &Offset, ISD::MemIndexedMode &AM,
317*0a6a1f1dSLionel Sambuc                                     SelectionDAG &DAG) const override;
318f4a2713aSLionel Sambuc 
319*0a6a1f1dSLionel Sambuc     void computeKnownBitsForTargetNode(const SDValue Op, APInt &KnownZero,
320f4a2713aSLionel Sambuc                                        APInt &KnownOne,
321f4a2713aSLionel Sambuc                                        const SelectionDAG &DAG,
322*0a6a1f1dSLionel Sambuc                                        unsigned Depth) const override;
323f4a2713aSLionel Sambuc 
324f4a2713aSLionel Sambuc 
325*0a6a1f1dSLionel Sambuc     bool ExpandInlineAsm(CallInst *CI) const override;
326f4a2713aSLionel Sambuc 
327*0a6a1f1dSLionel Sambuc     ConstraintType
328*0a6a1f1dSLionel Sambuc       getConstraintType(const std::string &Constraint) const override;
329f4a2713aSLionel Sambuc 
330f4a2713aSLionel Sambuc     /// Examine constraint string and operand type and determine a weight value.
331f4a2713aSLionel Sambuc     /// The operand object must already have been set up with the operand type.
332f4a2713aSLionel Sambuc     ConstraintWeight getSingleConstraintMatchWeight(
333*0a6a1f1dSLionel Sambuc       AsmOperandInfo &info, const char *constraint) const override;
334f4a2713aSLionel Sambuc 
335f4a2713aSLionel Sambuc     std::pair<unsigned, const TargetRegisterClass*>
336f4a2713aSLionel Sambuc       getRegForInlineAsmConstraint(const std::string &Constraint,
337*0a6a1f1dSLionel Sambuc                                    MVT VT) const override;
338f4a2713aSLionel Sambuc 
339f4a2713aSLionel Sambuc     /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
340f4a2713aSLionel Sambuc     /// vector.  If it is invalid, don't add anything to Ops. If hasMemory is
341f4a2713aSLionel Sambuc     /// true it means one of the asm constraint of the inline asm instruction
342f4a2713aSLionel Sambuc     /// being processed is 'm'.
343*0a6a1f1dSLionel Sambuc     void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint,
344f4a2713aSLionel Sambuc                                       std::vector<SDValue> &Ops,
345*0a6a1f1dSLionel Sambuc                                       SelectionDAG &DAG) const override;
346f4a2713aSLionel Sambuc 
getSubtarget()347f4a2713aSLionel Sambuc     const ARMSubtarget* getSubtarget() const {
348f4a2713aSLionel Sambuc       return Subtarget;
349f4a2713aSLionel Sambuc     }
350f4a2713aSLionel Sambuc 
351f4a2713aSLionel Sambuc     /// getRegClassFor - Return the register class that should be used for the
352f4a2713aSLionel Sambuc     /// specified value type.
353*0a6a1f1dSLionel Sambuc     const TargetRegisterClass *getRegClassFor(MVT VT) const override;
354f4a2713aSLionel Sambuc 
355f4a2713aSLionel Sambuc     /// getMaximalGlobalOffset - Returns the maximal possible offset which can
356f4a2713aSLionel Sambuc     /// be used for loads / stores from the global.
357*0a6a1f1dSLionel Sambuc     unsigned getMaximalGlobalOffset() const override;
358*0a6a1f1dSLionel Sambuc 
359*0a6a1f1dSLionel Sambuc     /// Returns true if a cast between SrcAS and DestAS is a noop.
isNoopAddrSpaceCast(unsigned SrcAS,unsigned DestAS)360*0a6a1f1dSLionel Sambuc     bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override {
361*0a6a1f1dSLionel Sambuc       // Addrspacecasts are always noops.
362*0a6a1f1dSLionel Sambuc       return true;
363*0a6a1f1dSLionel Sambuc     }
364f4a2713aSLionel Sambuc 
365f4a2713aSLionel Sambuc     /// createFastISel - This method returns a target specific FastISel object,
366f4a2713aSLionel Sambuc     /// or null if the target does not support "fast" ISel.
367*0a6a1f1dSLionel Sambuc     FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
368*0a6a1f1dSLionel Sambuc                              const TargetLibraryInfo *libInfo) const override;
369f4a2713aSLionel Sambuc 
370*0a6a1f1dSLionel Sambuc     Sched::Preference getSchedulingPreference(SDNode *N) const override;
371f4a2713aSLionel Sambuc 
372*0a6a1f1dSLionel Sambuc     bool
373*0a6a1f1dSLionel Sambuc     isShuffleMaskLegal(const SmallVectorImpl<int> &M, EVT VT) const override;
374*0a6a1f1dSLionel Sambuc     bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
375f4a2713aSLionel Sambuc 
376f4a2713aSLionel Sambuc     /// isFPImmLegal - Returns true if the target can instruction select the
377f4a2713aSLionel Sambuc     /// specified FP immediate natively. If false, the legalizer will
378f4a2713aSLionel Sambuc     /// materialize the FP immediate as a load from a constant pool.
379*0a6a1f1dSLionel Sambuc     bool isFPImmLegal(const APFloat &Imm, EVT VT) const override;
380f4a2713aSLionel Sambuc 
381*0a6a1f1dSLionel Sambuc     bool getTgtMemIntrinsic(IntrinsicInfo &Info,
382f4a2713aSLionel Sambuc                             const CallInst &I,
383*0a6a1f1dSLionel Sambuc                             unsigned Intrinsic) const override;
384*0a6a1f1dSLionel Sambuc 
385*0a6a1f1dSLionel Sambuc     /// \brief Returns true if it is beneficial to convert a load of a constant
386*0a6a1f1dSLionel Sambuc     /// to just the constant itself.
387*0a6a1f1dSLionel Sambuc     bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
388*0a6a1f1dSLionel Sambuc                                            Type *Ty) const override;
389*0a6a1f1dSLionel Sambuc 
390*0a6a1f1dSLionel Sambuc     /// \brief Returns true if an argument of type Ty needs to be passed in a
391*0a6a1f1dSLionel Sambuc     /// contiguous block of registers in calling convention CallConv.
392*0a6a1f1dSLionel Sambuc     bool functionArgumentNeedsConsecutiveRegisters(
393*0a6a1f1dSLionel Sambuc         Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override;
394*0a6a1f1dSLionel Sambuc 
395*0a6a1f1dSLionel Sambuc     bool hasLoadLinkedStoreConditional() const override;
396*0a6a1f1dSLionel Sambuc     Instruction *makeDMB(IRBuilder<> &Builder, ARM_MB::MemBOpt Domain) const;
397*0a6a1f1dSLionel Sambuc     Value *emitLoadLinked(IRBuilder<> &Builder, Value *Addr,
398*0a6a1f1dSLionel Sambuc                           AtomicOrdering Ord) const override;
399*0a6a1f1dSLionel Sambuc     Value *emitStoreConditional(IRBuilder<> &Builder, Value *Val,
400*0a6a1f1dSLionel Sambuc                                 Value *Addr, AtomicOrdering Ord) const override;
401*0a6a1f1dSLionel Sambuc 
402*0a6a1f1dSLionel Sambuc     Instruction* emitLeadingFence(IRBuilder<> &Builder, AtomicOrdering Ord,
403*0a6a1f1dSLionel Sambuc                           bool IsStore, bool IsLoad) const override;
404*0a6a1f1dSLionel Sambuc     Instruction* emitTrailingFence(IRBuilder<> &Builder, AtomicOrdering Ord,
405*0a6a1f1dSLionel Sambuc                            bool IsStore, bool IsLoad) const override;
406*0a6a1f1dSLionel Sambuc 
407*0a6a1f1dSLionel Sambuc     bool shouldExpandAtomicLoadInIR(LoadInst *LI) const override;
408*0a6a1f1dSLionel Sambuc     bool shouldExpandAtomicStoreInIR(StoreInst *SI) const override;
409*0a6a1f1dSLionel Sambuc     bool shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const override;
410*0a6a1f1dSLionel Sambuc 
411*0a6a1f1dSLionel Sambuc     bool useLoadStackGuardNode() const override;
412*0a6a1f1dSLionel Sambuc 
413*0a6a1f1dSLionel Sambuc     bool canCombineStoreAndExtract(Type *VectorTy, Value *Idx,
414*0a6a1f1dSLionel Sambuc                                    unsigned &Cost) const override;
415*0a6a1f1dSLionel Sambuc 
416f4a2713aSLionel Sambuc   protected:
417f4a2713aSLionel Sambuc     std::pair<const TargetRegisterClass*, uint8_t>
418*0a6a1f1dSLionel Sambuc     findRepresentativeClass(MVT VT) const override;
419f4a2713aSLionel Sambuc 
420f4a2713aSLionel Sambuc   private:
421f4a2713aSLionel Sambuc     /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
422f4a2713aSLionel Sambuc     /// make the right decision when generating code for different targets.
423f4a2713aSLionel Sambuc     const ARMSubtarget *Subtarget;
424f4a2713aSLionel Sambuc 
425f4a2713aSLionel Sambuc     const TargetRegisterInfo *RegInfo;
426f4a2713aSLionel Sambuc 
427f4a2713aSLionel Sambuc     const InstrItineraryData *Itins;
428f4a2713aSLionel Sambuc 
429f4a2713aSLionel Sambuc     /// ARMPCLabelIndex - Keep track of the number of ARM PC labels created.
430f4a2713aSLionel Sambuc     ///
431f4a2713aSLionel Sambuc     unsigned ARMPCLabelIndex;
432f4a2713aSLionel Sambuc 
433f4a2713aSLionel Sambuc     void addTypeForNEON(MVT VT, MVT PromotedLdStVT, MVT PromotedBitwiseVT);
434f4a2713aSLionel Sambuc     void addDRTypeForNEON(MVT VT);
435f4a2713aSLionel Sambuc     void addQRTypeForNEON(MVT VT);
436*0a6a1f1dSLionel Sambuc     std::pair<SDValue, SDValue> getARMXALUOOp(SDValue Op, SelectionDAG &DAG, SDValue &ARMcc) const;
437f4a2713aSLionel Sambuc 
438f4a2713aSLionel Sambuc     typedef SmallVector<std::pair<unsigned, SDValue>, 8> RegsToPassVector;
439f4a2713aSLionel Sambuc     void PassF64ArgInRegs(SDLoc dl, SelectionDAG &DAG,
440f4a2713aSLionel Sambuc                           SDValue Chain, SDValue &Arg,
441f4a2713aSLionel Sambuc                           RegsToPassVector &RegsToPass,
442f4a2713aSLionel Sambuc                           CCValAssign &VA, CCValAssign &NextVA,
443f4a2713aSLionel Sambuc                           SDValue &StackPtr,
444f4a2713aSLionel Sambuc                           SmallVectorImpl<SDValue> &MemOpChains,
445f4a2713aSLionel Sambuc                           ISD::ArgFlagsTy Flags) const;
446f4a2713aSLionel Sambuc     SDValue GetF64FormalArgument(CCValAssign &VA, CCValAssign &NextVA,
447f4a2713aSLionel Sambuc                                  SDValue &Root, SelectionDAG &DAG,
448f4a2713aSLionel Sambuc                                  SDLoc dl) const;
449f4a2713aSLionel Sambuc 
450*0a6a1f1dSLionel Sambuc     CallingConv::ID getEffectiveCallingConv(CallingConv::ID CC,
451*0a6a1f1dSLionel Sambuc                                             bool isVarArg) const;
452f4a2713aSLionel Sambuc     CCAssignFn *CCAssignFnForNode(CallingConv::ID CC, bool Return,
453f4a2713aSLionel Sambuc                                   bool isVarArg) const;
454f4a2713aSLionel Sambuc     SDValue LowerMemOpCallTo(SDValue Chain, SDValue StackPtr, SDValue Arg,
455f4a2713aSLionel Sambuc                              SDLoc dl, SelectionDAG &DAG,
456f4a2713aSLionel Sambuc                              const CCValAssign &VA,
457f4a2713aSLionel Sambuc                              ISD::ArgFlagsTy Flags) const;
458f4a2713aSLionel Sambuc     SDValue LowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const;
459f4a2713aSLionel Sambuc     SDValue LowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const;
460f4a2713aSLionel Sambuc     SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG,
461f4a2713aSLionel Sambuc                                     const ARMSubtarget *Subtarget) const;
462f4a2713aSLionel Sambuc     SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
463f4a2713aSLionel Sambuc     SDValue LowerGlobalAddressDarwin(SDValue Op, SelectionDAG &DAG) const;
464f4a2713aSLionel Sambuc     SDValue LowerGlobalAddressELF(SDValue Op, SelectionDAG &DAG) const;
465*0a6a1f1dSLionel Sambuc     SDValue LowerGlobalAddressWindows(SDValue Op, SelectionDAG &DAG) const;
466f4a2713aSLionel Sambuc     SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
467f4a2713aSLionel Sambuc     SDValue LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA,
468f4a2713aSLionel Sambuc                                             SelectionDAG &DAG) const;
469f4a2713aSLionel Sambuc     SDValue LowerToTLSExecModels(GlobalAddressSDNode *GA,
470f4a2713aSLionel Sambuc                                  SelectionDAG &DAG,
471f4a2713aSLionel Sambuc                                  TLSModel::Model model) const;
472f4a2713aSLionel Sambuc     SDValue LowerGLOBAL_OFFSET_TABLE(SDValue Op, SelectionDAG &DAG) const;
473f4a2713aSLionel Sambuc     SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const;
474*0a6a1f1dSLionel Sambuc     SDValue LowerXALUO(SDValue Op, SelectionDAG &DAG) const;
475f4a2713aSLionel Sambuc     SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
476f4a2713aSLionel Sambuc     SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
477f4a2713aSLionel Sambuc     SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
478f4a2713aSLionel Sambuc     SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const;
479f4a2713aSLionel Sambuc     SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
480f4a2713aSLionel Sambuc     SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
481f4a2713aSLionel Sambuc     SDValue LowerShiftRightParts(SDValue Op, SelectionDAG &DAG) const;
482f4a2713aSLionel Sambuc     SDValue LowerShiftLeftParts(SDValue Op, SelectionDAG &DAG) const;
483f4a2713aSLionel Sambuc     SDValue LowerFLT_ROUNDS_(SDValue Op, SelectionDAG &DAG) const;
484f4a2713aSLionel Sambuc     SDValue LowerConstantFP(SDValue Op, SelectionDAG &DAG,
485f4a2713aSLionel Sambuc                             const ARMSubtarget *ST) const;
486f4a2713aSLionel Sambuc     SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
487f4a2713aSLionel Sambuc                               const ARMSubtarget *ST) const;
488f4a2713aSLionel Sambuc     SDValue LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const;
489f4a2713aSLionel Sambuc     SDValue LowerDivRem(SDValue Op, SelectionDAG &DAG) const;
490*0a6a1f1dSLionel Sambuc     SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
491*0a6a1f1dSLionel Sambuc     SDValue LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const;
492*0a6a1f1dSLionel Sambuc     SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) const;
493*0a6a1f1dSLionel Sambuc     SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG) const;
494*0a6a1f1dSLionel Sambuc     SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
495*0a6a1f1dSLionel Sambuc 
496*0a6a1f1dSLionel Sambuc     unsigned getRegisterByName(const char* RegName, EVT VT) const override;
497f4a2713aSLionel Sambuc 
498f4a2713aSLionel Sambuc     /// isFMAFasterThanFMulAndFAdd - Return true if an FMA operation is faster
499f4a2713aSLionel Sambuc     /// than a pair of fmul and fadd instructions. fmuladd intrinsics will be
500f4a2713aSLionel Sambuc     /// expanded to FMAs when this method returns true, otherwise fmuladd is
501f4a2713aSLionel Sambuc     /// expanded to fmul + fadd.
502f4a2713aSLionel Sambuc     ///
503f4a2713aSLionel Sambuc     /// ARM supports both fused and unfused multiply-add operations; we already
504f4a2713aSLionel Sambuc     /// lower a pair of fmul and fadd to the latter so it's not clear that there
505f4a2713aSLionel Sambuc     /// would be a gain or that the gain would be worthwhile enough to risk
506f4a2713aSLionel Sambuc     /// correctness bugs.
isFMAFasterThanFMulAndFAdd(EVT VT)507*0a6a1f1dSLionel Sambuc     bool isFMAFasterThanFMulAndFAdd(EVT VT) const override { return false; }
508f4a2713aSLionel Sambuc 
509f4a2713aSLionel Sambuc     SDValue ReconstructShuffle(SDValue Op, SelectionDAG &DAG) const;
510f4a2713aSLionel Sambuc 
511f4a2713aSLionel Sambuc     SDValue LowerCallResult(SDValue Chain, SDValue InFlag,
512f4a2713aSLionel Sambuc                             CallingConv::ID CallConv, bool isVarArg,
513f4a2713aSLionel Sambuc                             const SmallVectorImpl<ISD::InputArg> &Ins,
514f4a2713aSLionel Sambuc                             SDLoc dl, SelectionDAG &DAG,
515f4a2713aSLionel Sambuc                             SmallVectorImpl<SDValue> &InVals,
516f4a2713aSLionel Sambuc                             bool isThisReturn, SDValue ThisVal) const;
517f4a2713aSLionel Sambuc 
518*0a6a1f1dSLionel Sambuc     SDValue
519f4a2713aSLionel Sambuc       LowerFormalArguments(SDValue Chain,
520f4a2713aSLionel Sambuc                            CallingConv::ID CallConv, bool isVarArg,
521f4a2713aSLionel Sambuc                            const SmallVectorImpl<ISD::InputArg> &Ins,
522f4a2713aSLionel Sambuc                            SDLoc dl, SelectionDAG &DAG,
523*0a6a1f1dSLionel Sambuc                            SmallVectorImpl<SDValue> &InVals) const override;
524f4a2713aSLionel Sambuc 
525f4a2713aSLionel Sambuc     int StoreByValRegs(CCState &CCInfo, SelectionDAG &DAG,
526f4a2713aSLionel Sambuc                        SDLoc dl, SDValue &Chain,
527f4a2713aSLionel Sambuc                        const Value *OrigArg,
528f4a2713aSLionel Sambuc                        unsigned InRegsParamRecordIdx,
529f4a2713aSLionel Sambuc                        unsigned OffsetFromOrigArg,
530f4a2713aSLionel Sambuc                        unsigned ArgOffset,
531f4a2713aSLionel Sambuc                        unsigned ArgSize,
532*0a6a1f1dSLionel Sambuc                        bool ForceMutable,
533*0a6a1f1dSLionel Sambuc                        unsigned ByValStoreOffset,
534*0a6a1f1dSLionel Sambuc                        unsigned TotalArgRegsSaveSize) const;
535f4a2713aSLionel Sambuc 
536f4a2713aSLionel Sambuc     void VarArgStyleRegisters(CCState &CCInfo, SelectionDAG &DAG,
537f4a2713aSLionel Sambuc                               SDLoc dl, SDValue &Chain,
538f4a2713aSLionel Sambuc                               unsigned ArgOffset,
539*0a6a1f1dSLionel Sambuc                               unsigned TotalArgRegsSaveSize,
540f4a2713aSLionel Sambuc                               bool ForceMutable = false) const;
541f4a2713aSLionel Sambuc 
542f4a2713aSLionel Sambuc     void computeRegArea(CCState &CCInfo, MachineFunction &MF,
543f4a2713aSLionel Sambuc                         unsigned InRegsParamRecordIdx,
544f4a2713aSLionel Sambuc                         unsigned ArgSize,
545f4a2713aSLionel Sambuc                         unsigned &ArgRegsSize,
546f4a2713aSLionel Sambuc                         unsigned &ArgRegsSaveSize) const;
547f4a2713aSLionel Sambuc 
548*0a6a1f1dSLionel Sambuc     SDValue
549f4a2713aSLionel Sambuc       LowerCall(TargetLowering::CallLoweringInfo &CLI,
550*0a6a1f1dSLionel Sambuc                 SmallVectorImpl<SDValue> &InVals) const override;
551f4a2713aSLionel Sambuc 
552f4a2713aSLionel Sambuc     /// HandleByVal - Target-specific cleanup for ByVal support.
553*0a6a1f1dSLionel Sambuc     void HandleByVal(CCState *, unsigned &, unsigned) const override;
554f4a2713aSLionel Sambuc 
555f4a2713aSLionel Sambuc     /// IsEligibleForTailCallOptimization - Check whether the call is eligible
556f4a2713aSLionel Sambuc     /// for tail call optimization. Targets which want to do tail call
557f4a2713aSLionel Sambuc     /// optimization should implement this function.
558f4a2713aSLionel Sambuc     bool IsEligibleForTailCallOptimization(SDValue Callee,
559f4a2713aSLionel Sambuc                                            CallingConv::ID CalleeCC,
560f4a2713aSLionel Sambuc                                            bool isVarArg,
561f4a2713aSLionel Sambuc                                            bool isCalleeStructRet,
562f4a2713aSLionel Sambuc                                            bool isCallerStructRet,
563f4a2713aSLionel Sambuc                                     const SmallVectorImpl<ISD::OutputArg> &Outs,
564f4a2713aSLionel Sambuc                                     const SmallVectorImpl<SDValue> &OutVals,
565f4a2713aSLionel Sambuc                                     const SmallVectorImpl<ISD::InputArg> &Ins,
566f4a2713aSLionel Sambuc                                            SelectionDAG& DAG) const;
567f4a2713aSLionel Sambuc 
568*0a6a1f1dSLionel Sambuc     bool CanLowerReturn(CallingConv::ID CallConv,
569f4a2713aSLionel Sambuc                         MachineFunction &MF, bool isVarArg,
570f4a2713aSLionel Sambuc                         const SmallVectorImpl<ISD::OutputArg> &Outs,
571*0a6a1f1dSLionel Sambuc                         LLVMContext &Context) const override;
572f4a2713aSLionel Sambuc 
573*0a6a1f1dSLionel Sambuc     SDValue
574f4a2713aSLionel Sambuc       LowerReturn(SDValue Chain,
575f4a2713aSLionel Sambuc                   CallingConv::ID CallConv, bool isVarArg,
576f4a2713aSLionel Sambuc                   const SmallVectorImpl<ISD::OutputArg> &Outs,
577f4a2713aSLionel Sambuc                   const SmallVectorImpl<SDValue> &OutVals,
578*0a6a1f1dSLionel Sambuc                   SDLoc dl, SelectionDAG &DAG) const override;
579f4a2713aSLionel Sambuc 
580*0a6a1f1dSLionel Sambuc     bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;
581f4a2713aSLionel Sambuc 
582*0a6a1f1dSLionel Sambuc     bool mayBeEmittedAsTailCall(CallInst *CI) const override;
583f4a2713aSLionel Sambuc 
584*0a6a1f1dSLionel Sambuc     SDValue getCMOV(SDLoc dl, EVT VT, SDValue FalseVal, SDValue TrueVal,
585*0a6a1f1dSLionel Sambuc                     SDValue ARMcc, SDValue CCR, SDValue Cmp,
586*0a6a1f1dSLionel Sambuc                     SelectionDAG &DAG) const;
587f4a2713aSLionel Sambuc     SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC,
588f4a2713aSLionel Sambuc                       SDValue &ARMcc, SelectionDAG &DAG, SDLoc dl) const;
589f4a2713aSLionel Sambuc     SDValue getVFPCmp(SDValue LHS, SDValue RHS,
590f4a2713aSLionel Sambuc                       SelectionDAG &DAG, SDLoc dl) const;
591f4a2713aSLionel Sambuc     SDValue duplicateCmp(SDValue Cmp, SelectionDAG &DAG) const;
592f4a2713aSLionel Sambuc 
593f4a2713aSLionel Sambuc     SDValue OptimizeVFPBrcond(SDValue Op, SelectionDAG &DAG) const;
594f4a2713aSLionel Sambuc 
595f4a2713aSLionel Sambuc     void SetupEntryBlockForSjLj(MachineInstr *MI,
596f4a2713aSLionel Sambuc                                 MachineBasicBlock *MBB,
597f4a2713aSLionel Sambuc                                 MachineBasicBlock *DispatchBB, int FI) const;
598f4a2713aSLionel Sambuc 
599f4a2713aSLionel Sambuc     MachineBasicBlock *EmitSjLjDispatchBlock(MachineInstr *MI,
600f4a2713aSLionel Sambuc                                              MachineBasicBlock *MBB) const;
601f4a2713aSLionel Sambuc 
602f4a2713aSLionel Sambuc     bool RemapAddSubWithFlags(MachineInstr *MI, MachineBasicBlock *BB) const;
603f4a2713aSLionel Sambuc 
604f4a2713aSLionel Sambuc     MachineBasicBlock *EmitStructByval(MachineInstr *MI,
605f4a2713aSLionel Sambuc                                        MachineBasicBlock *MBB) const;
606*0a6a1f1dSLionel Sambuc 
607*0a6a1f1dSLionel Sambuc     MachineBasicBlock *EmitLowered__chkstk(MachineInstr *MI,
608*0a6a1f1dSLionel Sambuc                                            MachineBasicBlock *MBB) const;
609f4a2713aSLionel Sambuc   };
610f4a2713aSLionel Sambuc 
611f4a2713aSLionel Sambuc   enum NEONModImmType {
612f4a2713aSLionel Sambuc     VMOVModImm,
613f4a2713aSLionel Sambuc     VMVNModImm,
614f4a2713aSLionel Sambuc     OtherModImm
615f4a2713aSLionel Sambuc   };
616f4a2713aSLionel Sambuc 
617f4a2713aSLionel Sambuc   namespace ARM {
618f4a2713aSLionel Sambuc     FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
619f4a2713aSLionel Sambuc                              const TargetLibraryInfo *libInfo);
620f4a2713aSLionel Sambuc   }
621f4a2713aSLionel Sambuc }
622f4a2713aSLionel Sambuc 
623f4a2713aSLionel Sambuc #endif  // ARMISELLOWERING_H
624