LLVM API Documentation

ARMISelLowering.h
Go to the documentation of this file.
00001 //===-- ARMISelLowering.h - ARM DAG Lowering Interface ----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the interfaces that ARM uses to lower LLVM code into a
00011 // selection DAG.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
00016 #define LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
00017 
00018 #include "MCTargetDesc/ARMBaseInfo.h"
00019 #include "llvm/CodeGen/CallingConvLower.h"
00020 #include "llvm/CodeGen/SelectionDAG.h"
00021 #include "llvm/Target/TargetLowering.h"
00022 #include <vector>
00023 
00024 namespace llvm {
00025   class ARMConstantPoolValue;
00026   class ARMSubtarget;
00027 
00028   namespace ARMISD {
00029     // ARM Specific DAG Nodes
00030     enum NodeType {
00031       // Start the numbering where the builtin ops and target ops leave off.
00032       FIRST_NUMBER = ISD::BUILTIN_OP_END,
00033 
00034       Wrapper,      // Wrapper - A wrapper node for TargetConstantPool,
00035                     // TargetExternalSymbol, and TargetGlobalAddress.
00036       WrapperPIC,   // WrapperPIC - A wrapper node for TargetGlobalAddress in
00037                     // PIC mode.
00038       WrapperJT,    // WrapperJT - A wrapper node for TargetJumpTable
00039 
00040       // Add pseudo op to model memcpy for struct byval.
00041       COPY_STRUCT_BYVAL,
00042 
00043       CALL,         // Function call.
00044       CALL_PRED,    // Function call that's predicable.
00045       CALL_NOLINK,  // Function call with branch not branch-and-link.
00046       tCALL,        // Thumb function call.
00047       BRCOND,       // Conditional branch.
00048       BR_JT,        // Jumptable branch.
00049       BR2_JT,       // Jumptable branch (2 level - jumptable entry is a jump).
00050       RET_FLAG,     // Return with a flag operand.
00051       INTRET_FLAG,  // Interrupt return with an LR-offset and a flag operand.
00052 
00053       PIC_ADD,      // Add with a PC operand and a PIC label.
00054 
00055       CMP,          // ARM compare instructions.
00056       CMN,          // ARM CMN instructions.
00057       CMPZ,         // ARM compare that sets only Z flag.
00058       CMPFP,        // ARM VFP compare instruction, sets FPSCR.
00059       CMPFPw0,      // ARM VFP compare against zero instruction, sets FPSCR.
00060       FMSTAT,       // ARM fmstat instruction.
00061 
00062       CMOV,         // ARM conditional move instructions.
00063 
00064       BCC_i64,
00065 
00066       RBIT,         // ARM bitreverse instruction
00067 
00068       FTOSI,        // FP to sint within a FP register.
00069       FTOUI,        // FP to uint within a FP register.
00070       SITOF,        // sint to FP within a FP register.
00071       UITOF,        // uint to FP within a FP register.
00072 
00073       SRL_FLAG,     // V,Flag = srl_flag X -> srl X, 1 + save carry out.
00074       SRA_FLAG,     // V,Flag = sra_flag X -> sra X, 1 + save carry out.
00075       RRX,          // V = RRX X, Flag     -> srl X, 1 + shift in carry flag.
00076 
00077       ADDC,         // Add with carry
00078       ADDE,         // Add using carry
00079       SUBC,         // Sub with carry
00080       SUBE,         // Sub using carry
00081 
00082       VMOVRRD,      // double to two gprs.
00083       VMOVDRR,      // Two gprs to double.
00084 
00085       EH_SJLJ_SETJMP,         // SjLj exception handling setjmp.
00086       EH_SJLJ_LONGJMP,        // SjLj exception handling longjmp.
00087 
00088       TC_RETURN,    // Tail call return pseudo.
00089 
00090       THREAD_POINTER,
00091 
00092       DYN_ALLOC,    // Dynamic allocation on the stack.
00093 
00094       MEMBARRIER_MCR, // Memory barrier (MCR)
00095 
00096       PRELOAD,      // Preload
00097 
00098       WIN__CHKSTK,  // Windows' __chkstk call to do stack probing.
00099 
00100       VCEQ,         // Vector compare equal.
00101       VCEQZ,        // Vector compare equal to zero.
00102       VCGE,         // Vector compare greater than or equal.
00103       VCGEZ,        // Vector compare greater than or equal to zero.
00104       VCLEZ,        // Vector compare less than or equal to zero.
00105       VCGEU,        // Vector compare unsigned greater than or equal.
00106       VCGT,         // Vector compare greater than.
00107       VCGTZ,        // Vector compare greater than zero.
00108       VCLTZ,        // Vector compare less than zero.
00109       VCGTU,        // Vector compare unsigned greater than.
00110       VTST,         // Vector test bits.
00111 
00112       // Vector shift by immediate:
00113       VSHL,         // ...left
00114       VSHRs,        // ...right (signed)
00115       VSHRu,        // ...right (unsigned)
00116 
00117       // Vector rounding shift by immediate:
00118       VRSHRs,       // ...right (signed)
00119       VRSHRu,       // ...right (unsigned)
00120       VRSHRN,       // ...right narrow
00121 
00122       // Vector saturating shift by immediate:
00123       VQSHLs,       // ...left (signed)
00124       VQSHLu,       // ...left (unsigned)
00125       VQSHLsu,      // ...left (signed to unsigned)
00126       VQSHRNs,      // ...right narrow (signed)
00127       VQSHRNu,      // ...right narrow (unsigned)
00128       VQSHRNsu,     // ...right narrow (signed to unsigned)
00129 
00130       // Vector saturating rounding shift by immediate:
00131       VQRSHRNs,     // ...right narrow (signed)
00132       VQRSHRNu,     // ...right narrow (unsigned)
00133       VQRSHRNsu,    // ...right narrow (signed to unsigned)
00134 
00135       // Vector shift and insert:
00136       VSLI,         // ...left
00137       VSRI,         // ...right
00138 
00139       // Vector get lane (VMOV scalar to ARM core register)
00140       // (These are used for 8- and 16-bit element types only.)
00141       VGETLANEu,    // zero-extend vector extract element
00142       VGETLANEs,    // sign-extend vector extract element
00143 
00144       // Vector move immediate and move negated immediate:
00145       VMOVIMM,
00146       VMVNIMM,
00147 
00148       // Vector move f32 immediate:
00149       VMOVFPIMM,
00150 
00151       // Vector duplicate:
00152       VDUP,
00153       VDUPLANE,
00154 
00155       // Vector shuffles:
00156       VEXT,         // extract
00157       VREV64,       // reverse elements within 64-bit doublewords
00158       VREV32,       // reverse elements within 32-bit words
00159       VREV16,       // reverse elements within 16-bit halfwords
00160       VZIP,         // zip (interleave)
00161       VUZP,         // unzip (deinterleave)
00162       VTRN,         // transpose
00163       VTBL1,        // 1-register shuffle with mask
00164       VTBL2,        // 2-register shuffle with mask
00165 
00166       // Vector multiply long:
00167       VMULLs,       // ...signed
00168       VMULLu,       // ...unsigned
00169 
00170       UMLAL,        // 64bit Unsigned Accumulate Multiply
00171       SMLAL,        // 64bit Signed Accumulate Multiply
00172 
00173       // Operands of the standard BUILD_VECTOR node are not legalized, which
00174       // is fine if BUILD_VECTORs are always lowered to shuffles or other
00175       // operations, but for ARM some BUILD_VECTORs are legal as-is and their
00176       // operands need to be legalized.  Define an ARM-specific version of
00177       // BUILD_VECTOR for this purpose.
00178       BUILD_VECTOR,
00179 
00180       // Floating-point max and min:
00181       FMAX,
00182       FMIN,
00183       VMAXNM,
00184       VMINNM,
00185 
00186       // Bit-field insert
00187       BFI,
00188 
00189       // Vector OR with immediate
00190       VORRIMM,
00191       // Vector AND with NOT of immediate
00192       VBICIMM,
00193 
00194       // Vector bitwise select
00195       VBSL,
00196 
00197       // Vector load N-element structure to all lanes:
00198       VLD2DUP = ISD::FIRST_TARGET_MEMORY_OPCODE,
00199       VLD3DUP,
00200       VLD4DUP,
00201 
00202       // NEON loads with post-increment base updates:
00203       VLD1_UPD,
00204       VLD2_UPD,
00205       VLD3_UPD,
00206       VLD4_UPD,
00207       VLD2LN_UPD,
00208       VLD3LN_UPD,
00209       VLD4LN_UPD,
00210       VLD2DUP_UPD,
00211       VLD3DUP_UPD,
00212       VLD4DUP_UPD,
00213 
00214       // NEON stores with post-increment base updates:
00215       VST1_UPD,
00216       VST2_UPD,
00217       VST3_UPD,
00218       VST4_UPD,
00219       VST2LN_UPD,
00220       VST3LN_UPD,
00221       VST4LN_UPD
00222     };
00223   }
00224 
00225   /// Define some predicates that are used for node matching.
00226   namespace ARM {
00227     bool isBitFieldInvertedMask(unsigned v);
00228   }
00229 
00230   //===--------------------------------------------------------------------===//
00231   //  ARMTargetLowering - ARM Implementation of the TargetLowering interface
00232 
00233   class ARMTargetLowering : public TargetLowering {
00234   public:
00235     explicit ARMTargetLowering(TargetMachine &TM);
00236 
00237     unsigned getJumpTableEncoding() const override;
00238 
00239     SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
00240 
00241     /// ReplaceNodeResults - Replace the results of node with an illegal result
00242     /// type with new values built out of custom code.
00243     ///
00244     void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue>&Results,
00245                             SelectionDAG &DAG) const override;
00246 
00247     const char *getTargetNodeName(unsigned Opcode) const override;
00248 
00249     bool isSelectSupported(SelectSupportKind Kind) const override {
00250       // ARM does not support scalar condition selects on vectors.
00251       return (Kind != ScalarCondVectorVal);
00252     }
00253 
00254     /// getSetCCResultType - Return the value type to use for ISD::SETCC.
00255     EVT getSetCCResultType(LLVMContext &Context, EVT VT) const override;
00256 
00257     MachineBasicBlock *
00258       EmitInstrWithCustomInserter(MachineInstr *MI,
00259                                   MachineBasicBlock *MBB) const override;
00260 
00261     void AdjustInstrPostInstrSelection(MachineInstr *MI,
00262                                        SDNode *Node) const override;
00263 
00264     SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const;
00265     SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
00266 
00267     bool isDesirableToTransformToIntegerOp(unsigned Opc, EVT VT) const override;
00268 
00269     /// allowsMisalignedMemoryAccesses - Returns true if the target allows
00270     /// unaligned memory accesses of the specified type. Returns whether it
00271     /// is "fast" by reference in the second argument.
00272     bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
00273                                         unsigned Align,
00274                                         bool *Fast) const override;
00275 
00276     EVT getOptimalMemOpType(uint64_t Size,
00277                             unsigned DstAlign, unsigned SrcAlign,
00278                             bool IsMemset, bool ZeroMemset,
00279                             bool MemcpyStrSrc,
00280                             MachineFunction &MF) const override;
00281 
00282     using TargetLowering::isZExtFree;
00283     bool isZExtFree(SDValue Val, EVT VT2) const override;
00284 
00285     bool allowTruncateForTailCall(Type *Ty1, Type *Ty2) const override;
00286 
00287 
00288     /// isLegalAddressingMode - Return true if the addressing mode represented
00289     /// by AM is legal for this target, for a load/store of the specified type.
00290     bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const override;
00291     bool isLegalT2ScaledAddressingMode(const AddrMode &AM, EVT VT) const;
00292 
00293     /// isLegalICmpImmediate - Return true if the specified immediate is legal
00294     /// icmp immediate, that is the target has icmp instructions which can
00295     /// compare a register against the immediate without having to materialize
00296     /// the immediate into a register.
00297     bool isLegalICmpImmediate(int64_t Imm) const override;
00298 
00299     /// isLegalAddImmediate - Return true if the specified immediate is legal
00300     /// add immediate, that is the target has add instructions which can
00301     /// add a register and the immediate without having to materialize
00302     /// the immediate into a register.
00303     bool isLegalAddImmediate(int64_t Imm) const override;
00304 
00305     /// getPreIndexedAddressParts - returns true by value, base pointer and
00306     /// offset pointer and addressing mode by reference if the node's address
00307     /// can be legally represented as pre-indexed load / store address.
00308     bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset,
00309                                    ISD::MemIndexedMode &AM,
00310                                    SelectionDAG &DAG) const override;
00311 
00312     /// getPostIndexedAddressParts - returns true by value, base pointer and
00313     /// offset pointer and addressing mode by reference if this node can be
00314     /// combined with a load / store to form a post-indexed load / store.
00315     bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base,
00316                                     SDValue &Offset, ISD::MemIndexedMode &AM,
00317                                     SelectionDAG &DAG) const override;
00318 
00319     void computeKnownBitsForTargetNode(const SDValue Op, APInt &KnownZero,
00320                                        APInt &KnownOne,
00321                                        const SelectionDAG &DAG,
00322                                        unsigned Depth) const override;
00323 
00324 
00325     bool ExpandInlineAsm(CallInst *CI) const override;
00326 
00327     ConstraintType
00328       getConstraintType(const std::string &Constraint) const override;
00329 
00330     /// Examine constraint string and operand type and determine a weight value.
00331     /// The operand object must already have been set up with the operand type.
00332     ConstraintWeight getSingleConstraintMatchWeight(
00333       AsmOperandInfo &info, const char *constraint) const override;
00334 
00335     std::pair<unsigned, const TargetRegisterClass*>
00336       getRegForInlineAsmConstraint(const std::string &Constraint,
00337                                    MVT VT) const override;
00338 
00339     /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
00340     /// vector.  If it is invalid, don't add anything to Ops. If hasMemory is
00341     /// true it means one of the asm constraint of the inline asm instruction
00342     /// being processed is 'm'.
00343     void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint,
00344                                       std::vector<SDValue> &Ops,
00345                                       SelectionDAG &DAG) const override;
00346 
00347     const ARMSubtarget* getSubtarget() const {
00348       return Subtarget;
00349     }
00350 
00351     /// getRegClassFor - Return the register class that should be used for the
00352     /// specified value type.
00353     const TargetRegisterClass *getRegClassFor(MVT VT) const override;
00354 
00355     /// getMaximalGlobalOffset - Returns the maximal possible offset which can
00356     /// be used for loads / stores from the global.
00357     unsigned getMaximalGlobalOffset() const override;
00358 
00359     /// Returns true if a cast between SrcAS and DestAS is a noop.
00360     bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override {
00361       // Addrspacecasts are always noops.
00362       return true;
00363     }
00364 
00365     /// createFastISel - This method returns a target specific FastISel object,
00366     /// or null if the target does not support "fast" ISel.
00367     FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
00368                              const TargetLibraryInfo *libInfo) const override;
00369 
00370     Sched::Preference getSchedulingPreference(SDNode *N) const override;
00371 
00372     bool
00373     isShuffleMaskLegal(const SmallVectorImpl<int> &M, EVT VT) const override;
00374     bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
00375 
00376     /// isFPImmLegal - Returns true if the target can instruction select the
00377     /// specified FP immediate natively. If false, the legalizer will
00378     /// materialize the FP immediate as a load from a constant pool.
00379     bool isFPImmLegal(const APFloat &Imm, EVT VT) const override;
00380 
00381     bool getTgtMemIntrinsic(IntrinsicInfo &Info,
00382                             const CallInst &I,
00383                             unsigned Intrinsic) const override;
00384 
00385     /// \brief Returns true if it is beneficial to convert a load of a constant
00386     /// to just the constant itself.
00387     bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
00388                                            Type *Ty) const override;
00389 
00390     /// \brief Returns true if an argument of type Ty needs to be passed in a
00391     /// contiguous block of registers in calling convention CallConv.
00392     bool functionArgumentNeedsConsecutiveRegisters(
00393         Type *Ty, CallingConv::ID CallConv, bool isVarArg) const override;
00394 
00395     bool hasLoadLinkedStoreConditional() const override;
00396     Value *emitLoadLinked(IRBuilder<> &Builder, Value *Addr,
00397                           AtomicOrdering Ord) const override;
00398     Value *emitStoreConditional(IRBuilder<> &Builder, Value *Val,
00399                                 Value *Addr, AtomicOrdering Ord) const override;
00400 
00401     void emitLeadingFence(IRBuilder<> &Builder, AtomicOrdering Ord,
00402                           bool IsStore, bool IsLoad) const override;
00403     void emitTrailingFence(IRBuilder<> &Builder, AtomicOrdering Ord,
00404                            bool IsStore, bool IsLoad) const override;
00405 
00406     bool shouldExpandAtomicLoadInIR(LoadInst *LI) const override;
00407     bool shouldExpandAtomicStoreInIR(StoreInst *SI) const override;
00408     bool shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const override;
00409 
00410     bool useLoadStackGuardNode() const override;
00411 
00412   protected:
00413     std::pair<const TargetRegisterClass*, uint8_t>
00414     findRepresentativeClass(MVT VT) const override;
00415 
00416   private:
00417     /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
00418     /// make the right decision when generating code for different targets.
00419     const ARMSubtarget *Subtarget;
00420 
00421     const TargetRegisterInfo *RegInfo;
00422 
00423     const InstrItineraryData *Itins;
00424 
00425     /// ARMPCLabelIndex - Keep track of the number of ARM PC labels created.
00426     ///
00427     unsigned ARMPCLabelIndex;
00428 
00429     void addTypeForNEON(MVT VT, MVT PromotedLdStVT, MVT PromotedBitwiseVT);
00430     void addDRTypeForNEON(MVT VT);
00431     void addQRTypeForNEON(MVT VT);
00432     std::pair<SDValue, SDValue> getARMXALUOOp(SDValue Op, SelectionDAG &DAG, SDValue &ARMcc) const;
00433 
00434     typedef SmallVector<std::pair<unsigned, SDValue>, 8> RegsToPassVector;
00435     void PassF64ArgInRegs(SDLoc dl, SelectionDAG &DAG,
00436                           SDValue Chain, SDValue &Arg,
00437                           RegsToPassVector &RegsToPass,
00438                           CCValAssign &VA, CCValAssign &NextVA,
00439                           SDValue &StackPtr,
00440                           SmallVectorImpl<SDValue> &MemOpChains,
00441                           ISD::ArgFlagsTy Flags) const;
00442     SDValue GetF64FormalArgument(CCValAssign &VA, CCValAssign &NextVA,
00443                                  SDValue &Root, SelectionDAG &DAG,
00444                                  SDLoc dl) const;
00445 
00446     CallingConv::ID getEffectiveCallingConv(CallingConv::ID CC,
00447                                             bool isVarArg) const;
00448     CCAssignFn *CCAssignFnForNode(CallingConv::ID CC, bool Return,
00449                                   bool isVarArg) const;
00450     SDValue LowerMemOpCallTo(SDValue Chain, SDValue StackPtr, SDValue Arg,
00451                              SDLoc dl, SelectionDAG &DAG,
00452                              const CCValAssign &VA,
00453                              ISD::ArgFlagsTy Flags) const;
00454     SDValue LowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const;
00455     SDValue LowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const;
00456     SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG,
00457                                     const ARMSubtarget *Subtarget) const;
00458     SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
00459     SDValue LowerGlobalAddressDarwin(SDValue Op, SelectionDAG &DAG) const;
00460     SDValue LowerGlobalAddressELF(SDValue Op, SelectionDAG &DAG) const;
00461     SDValue LowerGlobalAddressWindows(SDValue Op, SelectionDAG &DAG) const;
00462     SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
00463     SDValue LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA,
00464                                             SelectionDAG &DAG) const;
00465     SDValue LowerToTLSExecModels(GlobalAddressSDNode *GA,
00466                                  SelectionDAG &DAG,
00467                                  TLSModel::Model model) const;
00468     SDValue LowerGLOBAL_OFFSET_TABLE(SDValue Op, SelectionDAG &DAG) const;
00469     SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const;
00470     SDValue LowerXALUO(SDValue Op, SelectionDAG &DAG) const;
00471     SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
00472     SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
00473     SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG) const;
00474     SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const;
00475     SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
00476     SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
00477     SDValue LowerShiftRightParts(SDValue Op, SelectionDAG &DAG) const;
00478     SDValue LowerShiftLeftParts(SDValue Op, SelectionDAG &DAG) const;
00479     SDValue LowerFLT_ROUNDS_(SDValue Op, SelectionDAG &DAG) const;
00480     SDValue LowerConstantFP(SDValue Op, SelectionDAG &DAG,
00481                             const ARMSubtarget *ST) const;
00482     SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
00483                               const ARMSubtarget *ST) const;
00484     SDValue LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const;
00485     SDValue LowerDivRem(SDValue Op, SelectionDAG &DAG) const;
00486     SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
00487     SDValue LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const;
00488     SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) const;
00489     SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG) const;
00490     SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
00491 
00492     unsigned getRegisterByName(const char* RegName, EVT VT) const override;
00493 
00494     /// isFMAFasterThanFMulAndFAdd - Return true if an FMA operation is faster
00495     /// than a pair of fmul and fadd instructions. fmuladd intrinsics will be
00496     /// expanded to FMAs when this method returns true, otherwise fmuladd is
00497     /// expanded to fmul + fadd.
00498     ///
00499     /// ARM supports both fused and unfused multiply-add operations; we already
00500     /// lower a pair of fmul and fadd to the latter so it's not clear that there
00501     /// would be a gain or that the gain would be worthwhile enough to risk
00502     /// correctness bugs.
00503     bool isFMAFasterThanFMulAndFAdd(EVT VT) const override { return false; }
00504 
00505     SDValue ReconstructShuffle(SDValue Op, SelectionDAG &DAG) const;
00506 
00507     SDValue LowerCallResult(SDValue Chain, SDValue InFlag,
00508                             CallingConv::ID CallConv, bool isVarArg,
00509                             const SmallVectorImpl<ISD::InputArg> &Ins,
00510                             SDLoc dl, SelectionDAG &DAG,
00511                             SmallVectorImpl<SDValue> &InVals,
00512                             bool isThisReturn, SDValue ThisVal) const;
00513 
00514     SDValue
00515       LowerFormalArguments(SDValue Chain,
00516                            CallingConv::ID CallConv, bool isVarArg,
00517                            const SmallVectorImpl<ISD::InputArg> &Ins,
00518                            SDLoc dl, SelectionDAG &DAG,
00519                            SmallVectorImpl<SDValue> &InVals) const override;
00520 
00521     int StoreByValRegs(CCState &CCInfo, SelectionDAG &DAG,
00522                        SDLoc dl, SDValue &Chain,
00523                        const Value *OrigArg,
00524                        unsigned InRegsParamRecordIdx,
00525                        unsigned OffsetFromOrigArg,
00526                        unsigned ArgOffset,
00527                        unsigned ArgSize,
00528                        bool ForceMutable,
00529                        unsigned ByValStoreOffset,
00530                        unsigned TotalArgRegsSaveSize) const;
00531 
00532     void VarArgStyleRegisters(CCState &CCInfo, SelectionDAG &DAG,
00533                               SDLoc dl, SDValue &Chain,
00534                               unsigned ArgOffset,
00535                               unsigned TotalArgRegsSaveSize,
00536                               bool ForceMutable = false) const;
00537 
00538     void computeRegArea(CCState &CCInfo, MachineFunction &MF,
00539                         unsigned InRegsParamRecordIdx,
00540                         unsigned ArgSize,
00541                         unsigned &ArgRegsSize,
00542                         unsigned &ArgRegsSaveSize) const;
00543 
00544     SDValue
00545       LowerCall(TargetLowering::CallLoweringInfo &CLI,
00546                 SmallVectorImpl<SDValue> &InVals) const override;
00547 
00548     /// HandleByVal - Target-specific cleanup for ByVal support.
00549     void HandleByVal(CCState *, unsigned &, unsigned) const override;
00550 
00551     /// IsEligibleForTailCallOptimization - Check whether the call is eligible
00552     /// for tail call optimization. Targets which want to do tail call
00553     /// optimization should implement this function.
00554     bool IsEligibleForTailCallOptimization(SDValue Callee,
00555                                            CallingConv::ID CalleeCC,
00556                                            bool isVarArg,
00557                                            bool isCalleeStructRet,
00558                                            bool isCallerStructRet,
00559                                     const SmallVectorImpl<ISD::OutputArg> &Outs,
00560                                     const SmallVectorImpl<SDValue> &OutVals,
00561                                     const SmallVectorImpl<ISD::InputArg> &Ins,
00562                                            SelectionDAG& DAG) const;
00563 
00564     bool CanLowerReturn(CallingConv::ID CallConv,
00565                         MachineFunction &MF, bool isVarArg,
00566                         const SmallVectorImpl<ISD::OutputArg> &Outs,
00567                         LLVMContext &Context) const override;
00568 
00569     SDValue
00570       LowerReturn(SDValue Chain,
00571                   CallingConv::ID CallConv, bool isVarArg,
00572                   const SmallVectorImpl<ISD::OutputArg> &Outs,
00573                   const SmallVectorImpl<SDValue> &OutVals,
00574                   SDLoc dl, SelectionDAG &DAG) const override;
00575 
00576     bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;
00577 
00578     bool mayBeEmittedAsTailCall(CallInst *CI) const override;
00579 
00580     SDValue getCMOV(SDLoc dl, EVT VT, SDValue FalseVal, SDValue TrueVal,
00581                     SDValue ARMcc, SDValue CCR, SDValue Cmp,
00582                     SelectionDAG &DAG) const;
00583     SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC,
00584                       SDValue &ARMcc, SelectionDAG &DAG, SDLoc dl) const;
00585     SDValue getVFPCmp(SDValue LHS, SDValue RHS,
00586                       SelectionDAG &DAG, SDLoc dl) const;
00587     SDValue duplicateCmp(SDValue Cmp, SelectionDAG &DAG) const;
00588 
00589     SDValue OptimizeVFPBrcond(SDValue Op, SelectionDAG &DAG) const;
00590 
00591     void SetupEntryBlockForSjLj(MachineInstr *MI,
00592                                 MachineBasicBlock *MBB,
00593                                 MachineBasicBlock *DispatchBB, int FI) const;
00594 
00595     MachineBasicBlock *EmitSjLjDispatchBlock(MachineInstr *MI,
00596                                              MachineBasicBlock *MBB) const;
00597 
00598     bool RemapAddSubWithFlags(MachineInstr *MI, MachineBasicBlock *BB) const;
00599 
00600     MachineBasicBlock *EmitStructByval(MachineInstr *MI,
00601                                        MachineBasicBlock *MBB) const;
00602 
00603     MachineBasicBlock *EmitLowered__chkstk(MachineInstr *MI,
00604                                            MachineBasicBlock *MBB) const;
00605   };
00606 
00607   enum NEONModImmType {
00608     VMOVModImm,
00609     VMVNModImm,
00610     OtherModImm
00611   };
00612 
00613   namespace ARM {
00614     FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
00615                              const TargetLibraryInfo *libInfo);
00616   }
00617 }
00618 
00619 #endif  // ARMISELLOWERING_H