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