xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchISelLowering.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
181ad6265SDimitry Andric //=- LoongArchISelLowering.h - LoongArch DAG Lowering Interface -*- C++ -*-===//
281ad6265SDimitry Andric //
381ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
481ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
581ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
681ad6265SDimitry Andric //
781ad6265SDimitry Andric //===----------------------------------------------------------------------===//
881ad6265SDimitry Andric //
981ad6265SDimitry Andric // This file defines the interfaces that LoongArch uses to lower LLVM code into
1081ad6265SDimitry Andric // a selection DAG.
1181ad6265SDimitry Andric //
1281ad6265SDimitry Andric //===----------------------------------------------------------------------===//
1381ad6265SDimitry Andric 
1481ad6265SDimitry Andric #ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHISELLOWERING_H
1581ad6265SDimitry Andric #define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHISELLOWERING_H
1681ad6265SDimitry Andric 
1781ad6265SDimitry Andric #include "LoongArch.h"
1881ad6265SDimitry Andric #include "llvm/CodeGen/CallingConvLower.h"
1981ad6265SDimitry Andric #include "llvm/CodeGen/SelectionDAG.h"
2081ad6265SDimitry Andric #include "llvm/CodeGen/TargetLowering.h"
2181ad6265SDimitry Andric 
2281ad6265SDimitry Andric namespace llvm {
2381ad6265SDimitry Andric class LoongArchSubtarget;
2481ad6265SDimitry Andric namespace LoongArchISD {
2581ad6265SDimitry Andric enum NodeType : unsigned {
2681ad6265SDimitry Andric   FIRST_NUMBER = ISD::BUILTIN_OP_END,
2781ad6265SDimitry Andric 
2881ad6265SDimitry Andric   // TODO: add more LoongArchISDs
29753f127fSDimitry Andric   CALL,
301db9f3b2SDimitry Andric   CALL_MEDIUM,
311db9f3b2SDimitry Andric   CALL_LARGE,
3281ad6265SDimitry Andric   RET,
33bdd1243dSDimitry Andric   TAIL,
341db9f3b2SDimitry Andric   TAIL_MEDIUM,
351db9f3b2SDimitry Andric   TAIL_LARGE,
36bdd1243dSDimitry Andric 
3781ad6265SDimitry Andric   // 32-bit shifts, directly matching the semantics of the named LoongArch
3881ad6265SDimitry Andric   // instructions.
3981ad6265SDimitry Andric   SLL_W,
4081ad6265SDimitry Andric   SRA_W,
4181ad6265SDimitry Andric   SRL_W,
4281ad6265SDimitry Andric 
43bdd1243dSDimitry Andric   ROTL_W,
44bdd1243dSDimitry Andric   ROTR_W,
45bdd1243dSDimitry Andric 
46*0fca6ea1SDimitry Andric   // unsigned 32-bit integer division
47*0fca6ea1SDimitry Andric   DIV_WU,
48*0fca6ea1SDimitry Andric   MOD_WU,
49*0fca6ea1SDimitry Andric 
50753f127fSDimitry Andric   // FPR<->GPR transfer operations
51753f127fSDimitry Andric   MOVGR2FR_W_LA64,
52753f127fSDimitry Andric   MOVFR2GR_S_LA64,
53bdd1243dSDimitry Andric   MOVFCSR2GR,
54bdd1243dSDimitry Andric   MOVGR2FCSR,
55753f127fSDimitry Andric 
56753f127fSDimitry Andric   FTINT,
57753f127fSDimitry Andric 
58bdd1243dSDimitry Andric   // Bit counting operations
59bdd1243dSDimitry Andric   CLZ_W,
60bdd1243dSDimitry Andric   CTZ_W,
61bdd1243dSDimitry Andric 
62753f127fSDimitry Andric   BSTRINS,
6381ad6265SDimitry Andric   BSTRPICK,
6481ad6265SDimitry Andric 
65bdd1243dSDimitry Andric   // Byte-swapping and bit-reversal
66bdd1243dSDimitry Andric   REVB_2H,
67bdd1243dSDimitry Andric   REVB_2W,
68bdd1243dSDimitry Andric   BITREV_4B,
69bdd1243dSDimitry Andric   BITREV_W,
70bdd1243dSDimitry Andric 
71bdd1243dSDimitry Andric   // Intrinsic operations start ============================================
72bdd1243dSDimitry Andric   BREAK,
73bdd1243dSDimitry Andric   CACOP_D,
74bdd1243dSDimitry Andric   CACOP_W,
75bdd1243dSDimitry Andric   DBAR,
76bdd1243dSDimitry Andric   IBAR,
77bdd1243dSDimitry Andric   SYSCALL,
78bdd1243dSDimitry Andric 
79bdd1243dSDimitry Andric   // CRC check operations
80bdd1243dSDimitry Andric   CRC_W_B_W,
81bdd1243dSDimitry Andric   CRC_W_H_W,
82bdd1243dSDimitry Andric   CRC_W_W_W,
83bdd1243dSDimitry Andric   CRC_W_D_W,
84bdd1243dSDimitry Andric   CRCC_W_B_W,
85bdd1243dSDimitry Andric   CRCC_W_H_W,
86bdd1243dSDimitry Andric   CRCC_W_W_W,
87bdd1243dSDimitry Andric   CRCC_W_D_W,
88bdd1243dSDimitry Andric 
89bdd1243dSDimitry Andric   CSRRD,
9006c3fb27SDimitry Andric 
9106c3fb27SDimitry Andric   // Write new value to CSR and return old value.
9206c3fb27SDimitry Andric   // Operand 0: A chain pointer.
9306c3fb27SDimitry Andric   // Operand 1: The new value to write.
9406c3fb27SDimitry Andric   // Operand 2: The address of the required CSR.
9506c3fb27SDimitry Andric   // Result 0: The old value of the CSR.
9606c3fb27SDimitry Andric   // Result 1: The new chain pointer.
97bdd1243dSDimitry Andric   CSRWR,
9806c3fb27SDimitry Andric 
9906c3fb27SDimitry Andric   // Similar to CSRWR but with a write mask.
10006c3fb27SDimitry Andric   // Operand 0: A chain pointer.
10106c3fb27SDimitry Andric   // Operand 1: The new value to write.
10206c3fb27SDimitry Andric   // Operand 2: The write mask.
10306c3fb27SDimitry Andric   // Operand 3: The address of the required CSR.
10406c3fb27SDimitry Andric   // Result 0: The old value of the CSR.
10506c3fb27SDimitry Andric   // Result 1: The new chain pointer.
106bdd1243dSDimitry Andric   CSRXCHG,
107bdd1243dSDimitry Andric 
108bdd1243dSDimitry Andric   // IOCSR access operations
109bdd1243dSDimitry Andric   IOCSRRD_B,
110bdd1243dSDimitry Andric   IOCSRRD_W,
111bdd1243dSDimitry Andric   IOCSRRD_H,
112bdd1243dSDimitry Andric   IOCSRRD_D,
113bdd1243dSDimitry Andric   IOCSRWR_B,
114bdd1243dSDimitry Andric   IOCSRWR_H,
115bdd1243dSDimitry Andric   IOCSRWR_W,
116bdd1243dSDimitry Andric   IOCSRWR_D,
117bdd1243dSDimitry Andric 
118bdd1243dSDimitry Andric   // Read CPU configuration information operation
119bdd1243dSDimitry Andric   CPUCFG,
1205f757f3fSDimitry Andric 
1215f757f3fSDimitry Andric   // Vector Shuffle
1225f757f3fSDimitry Andric   VREPLVE,
123*0fca6ea1SDimitry Andric   VSHUF,
124*0fca6ea1SDimitry Andric   VPICKEV,
125*0fca6ea1SDimitry Andric   VPICKOD,
126*0fca6ea1SDimitry Andric   VPACKEV,
127*0fca6ea1SDimitry Andric   VPACKOD,
128*0fca6ea1SDimitry Andric   VILVL,
129*0fca6ea1SDimitry Andric   VILVH,
130*0fca6ea1SDimitry Andric   VSHUF4I,
131*0fca6ea1SDimitry Andric   VREPLVEI,
132*0fca6ea1SDimitry Andric   XVPERMI,
1335f757f3fSDimitry Andric 
1345f757f3fSDimitry Andric   // Extended vector element extraction
1355f757f3fSDimitry Andric   VPICK_SEXT_ELT,
1365f757f3fSDimitry Andric   VPICK_ZEXT_ELT,
1375f757f3fSDimitry Andric 
1385f757f3fSDimitry Andric   // Vector comparisons
1395f757f3fSDimitry Andric   VALL_ZERO,
1405f757f3fSDimitry Andric   VANY_ZERO,
1415f757f3fSDimitry Andric   VALL_NONZERO,
1425f757f3fSDimitry Andric   VANY_NONZERO,
1435f757f3fSDimitry Andric 
144bdd1243dSDimitry Andric   // Intrinsic operations end =============================================
14581ad6265SDimitry Andric };
146972a253aSDimitry Andric } // end namespace LoongArchISD
14781ad6265SDimitry Andric 
14881ad6265SDimitry Andric class LoongArchTargetLowering : public TargetLowering {
14981ad6265SDimitry Andric   const LoongArchSubtarget &Subtarget;
15081ad6265SDimitry Andric 
15181ad6265SDimitry Andric public:
15281ad6265SDimitry Andric   explicit LoongArchTargetLowering(const TargetMachine &TM,
15381ad6265SDimitry Andric                                    const LoongArchSubtarget &STI);
15481ad6265SDimitry Andric 
15581ad6265SDimitry Andric   const LoongArchSubtarget &getSubtarget() const { return Subtarget; }
15681ad6265SDimitry Andric 
157bdd1243dSDimitry Andric   bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
158bdd1243dSDimitry Andric 
15981ad6265SDimitry Andric   // Provide custom lowering hooks for some operations.
16081ad6265SDimitry Andric   SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
16181ad6265SDimitry Andric   void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
16281ad6265SDimitry Andric                           SelectionDAG &DAG) const override;
16381ad6265SDimitry Andric 
16481ad6265SDimitry Andric   SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
16581ad6265SDimitry Andric 
16681ad6265SDimitry Andric   // This method returns the name of a target specific DAG node.
16781ad6265SDimitry Andric   const char *getTargetNodeName(unsigned Opcode) const override;
16881ad6265SDimitry Andric 
16981ad6265SDimitry Andric   // Lower incoming arguments, copy physregs into vregs.
17081ad6265SDimitry Andric   SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
17181ad6265SDimitry Andric                                bool IsVarArg,
17281ad6265SDimitry Andric                                const SmallVectorImpl<ISD::InputArg> &Ins,
17381ad6265SDimitry Andric                                const SDLoc &DL, SelectionDAG &DAG,
17481ad6265SDimitry Andric                                SmallVectorImpl<SDValue> &InVals) const override;
17581ad6265SDimitry Andric   bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
17681ad6265SDimitry Andric                       bool IsVarArg,
17781ad6265SDimitry Andric                       const SmallVectorImpl<ISD::OutputArg> &Outs,
17881ad6265SDimitry Andric                       LLVMContext &Context) const override;
17981ad6265SDimitry Andric   SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
18081ad6265SDimitry Andric                       const SmallVectorImpl<ISD::OutputArg> &Outs,
18181ad6265SDimitry Andric                       const SmallVectorImpl<SDValue> &OutVals, const SDLoc &DL,
18281ad6265SDimitry Andric                       SelectionDAG &DAG) const override;
183753f127fSDimitry Andric   SDValue LowerCall(TargetLowering::CallLoweringInfo &CLI,
184753f127fSDimitry Andric                     SmallVectorImpl<SDValue> &InVals) const override;
185bdd1243dSDimitry Andric   bool isCheapToSpeculateCttz(Type *Ty) const override;
186bdd1243dSDimitry Andric   bool isCheapToSpeculateCtlz(Type *Ty) const override;
187bdd1243dSDimitry Andric   bool hasAndNot(SDValue Y) const override;
188bdd1243dSDimitry Andric   TargetLowering::AtomicExpansionKind
189bdd1243dSDimitry Andric   shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const override;
190bdd1243dSDimitry Andric 
191bdd1243dSDimitry Andric   Value *emitMaskedAtomicRMWIntrinsic(IRBuilderBase &Builder, AtomicRMWInst *AI,
192bdd1243dSDimitry Andric                                       Value *AlignedAddr, Value *Incr,
193bdd1243dSDimitry Andric                                       Value *Mask, Value *ShiftAmt,
194bdd1243dSDimitry Andric                                       AtomicOrdering Ord) const override;
195bdd1243dSDimitry Andric 
196bdd1243dSDimitry Andric   EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context,
197bdd1243dSDimitry Andric                          EVT VT) const override;
198bdd1243dSDimitry Andric   TargetLowering::AtomicExpansionKind
199bdd1243dSDimitry Andric   shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *CI) const override;
200bdd1243dSDimitry Andric   Value *emitMaskedAtomicCmpXchgIntrinsic(IRBuilderBase &Builder,
201bdd1243dSDimitry Andric                                           AtomicCmpXchgInst *CI,
202bdd1243dSDimitry Andric                                           Value *AlignedAddr, Value *CmpVal,
203bdd1243dSDimitry Andric                                           Value *NewVal, Value *Mask,
204bdd1243dSDimitry Andric                                           AtomicOrdering Ord) const override;
205bdd1243dSDimitry Andric 
206bdd1243dSDimitry Andric   bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I,
207bdd1243dSDimitry Andric                           MachineFunction &MF,
208bdd1243dSDimitry Andric                           unsigned Intrinsic) const override;
209bdd1243dSDimitry Andric 
210bdd1243dSDimitry Andric   bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
211bdd1243dSDimitry Andric                                   EVT VT) const override;
212bdd1243dSDimitry Andric 
213bdd1243dSDimitry Andric   Register
214bdd1243dSDimitry Andric   getExceptionPointerRegister(const Constant *PersonalityFn) const override;
215bdd1243dSDimitry Andric 
216bdd1243dSDimitry Andric   Register
217bdd1243dSDimitry Andric   getExceptionSelectorRegister(const Constant *PersonalityFn) const override;
218bdd1243dSDimitry Andric 
219bdd1243dSDimitry Andric   ISD::NodeType getExtendForAtomicOps() const override {
220bdd1243dSDimitry Andric     return ISD::SIGN_EXTEND;
221bdd1243dSDimitry Andric   }
222bdd1243dSDimitry Andric 
223439352acSDimitry Andric   ISD::NodeType getExtendForAtomicCmpSwapArg() const override;
224439352acSDimitry Andric 
225bdd1243dSDimitry Andric   Register getRegisterByName(const char *RegName, LLT VT,
226bdd1243dSDimitry Andric                              const MachineFunction &MF) const override;
227bdd1243dSDimitry Andric   bool mayBeEmittedAsTailCall(const CallInst *CI) const override;
228bdd1243dSDimitry Andric 
229bdd1243dSDimitry Andric   bool decomposeMulByConstant(LLVMContext &Context, EVT VT,
230bdd1243dSDimitry Andric                               SDValue C) const override;
23181ad6265SDimitry Andric 
23206c3fb27SDimitry Andric   bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;
23306c3fb27SDimitry Andric 
23406c3fb27SDimitry Andric   bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty,
23506c3fb27SDimitry Andric                              unsigned AS,
23606c3fb27SDimitry Andric                              Instruction *I = nullptr) const override;
23706c3fb27SDimitry Andric 
23806c3fb27SDimitry Andric   bool isLegalICmpImmediate(int64_t Imm) const override;
23906c3fb27SDimitry Andric   bool isLegalAddImmediate(int64_t Imm) const override;
24006c3fb27SDimitry Andric   bool isZExtFree(SDValue Val, EVT VT2) const override;
24106c3fb27SDimitry Andric   bool isSExtCheaperThanZExt(EVT SrcVT, EVT DstVT) const override;
242*0fca6ea1SDimitry Andric   bool signExtendConstant(const ConstantInt *CI) const override;
24306c3fb27SDimitry Andric 
24406c3fb27SDimitry Andric   bool hasAndNotCompare(SDValue Y) const override;
24506c3fb27SDimitry Andric 
24606c3fb27SDimitry Andric   bool convertSelectOfConstantsToMath(EVT VT) const override { return true; }
24706c3fb27SDimitry Andric 
24806c3fb27SDimitry Andric   bool allowsMisalignedMemoryAccesses(
24906c3fb27SDimitry Andric       EVT VT, unsigned AddrSpace = 0, Align Alignment = Align(1),
25006c3fb27SDimitry Andric       MachineMemOperand::Flags Flags = MachineMemOperand::MONone,
25106c3fb27SDimitry Andric       unsigned *Fast = nullptr) const override;
25206c3fb27SDimitry Andric 
2535f757f3fSDimitry Andric   bool isShuffleMaskLegal(ArrayRef<int> Mask, EVT VT) const override {
2545f757f3fSDimitry Andric     return false;
2555f757f3fSDimitry Andric   }
256*0fca6ea1SDimitry Andric   bool shouldConsiderGEPOffsetSplit() const override { return true; }
257*0fca6ea1SDimitry Andric   bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const override;
258*0fca6ea1SDimitry Andric   bool shouldExtendTypeInLibCall(EVT Type) const override;
2595f757f3fSDimitry Andric 
26081ad6265SDimitry Andric private:
26181ad6265SDimitry Andric   /// Target-specific function used to lower LoongArch calling conventions.
262bdd1243dSDimitry Andric   typedef bool LoongArchCCAssignFn(const DataLayout &DL, LoongArchABI::ABI ABI,
263bdd1243dSDimitry Andric                                    unsigned ValNo, MVT ValVT,
26481ad6265SDimitry Andric                                    CCValAssign::LocInfo LocInfo,
265bdd1243dSDimitry Andric                                    ISD::ArgFlagsTy ArgFlags, CCState &State,
266bdd1243dSDimitry Andric                                    bool IsFixed, bool IsReg, Type *OrigTy);
26781ad6265SDimitry Andric 
268bdd1243dSDimitry Andric   void analyzeInputArgs(MachineFunction &MF, CCState &CCInfo,
269bdd1243dSDimitry Andric                         const SmallVectorImpl<ISD::InputArg> &Ins, bool IsRet,
27081ad6265SDimitry Andric                         LoongArchCCAssignFn Fn) const;
271bdd1243dSDimitry Andric   void analyzeOutputArgs(MachineFunction &MF, CCState &CCInfo,
27281ad6265SDimitry Andric                          const SmallVectorImpl<ISD::OutputArg> &Outs,
273bdd1243dSDimitry Andric                          bool IsRet, CallLoweringInfo *CLI,
27481ad6265SDimitry Andric                          LoongArchCCAssignFn Fn) const;
27581ad6265SDimitry Andric 
276bdd1243dSDimitry Andric   template <class NodeTy>
2771db9f3b2SDimitry Andric   SDValue getAddr(NodeTy *N, SelectionDAG &DAG, CodeModel::Model M,
2781db9f3b2SDimitry Andric                   bool IsLocal = true) const;
279bdd1243dSDimitry Andric   SDValue getStaticTLSAddr(GlobalAddressSDNode *N, SelectionDAG &DAG,
280*0fca6ea1SDimitry Andric                            unsigned Opc, bool UseGOT, bool Large = false) const;
281bdd1243dSDimitry Andric   SDValue getDynamicTLSAddr(GlobalAddressSDNode *N, SelectionDAG &DAG,
28206c3fb27SDimitry Andric                             unsigned Opc, bool Large = false) const;
283*0fca6ea1SDimitry Andric   SDValue getTLSDescAddr(GlobalAddressSDNode *N, SelectionDAG &DAG,
284*0fca6ea1SDimitry Andric                          unsigned Opc, bool Large = false) const;
285753f127fSDimitry Andric   SDValue lowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
286bdd1243dSDimitry Andric   SDValue lowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
287bdd1243dSDimitry Andric   SDValue lowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
288bdd1243dSDimitry Andric   SDValue lowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
28981ad6265SDimitry Andric   SDValue lowerShiftLeftParts(SDValue Op, SelectionDAG &DAG) const;
29081ad6265SDimitry Andric   SDValue lowerShiftRightParts(SDValue Op, SelectionDAG &DAG, bool IsSRA) const;
291753f127fSDimitry Andric 
292753f127fSDimitry Andric   MachineBasicBlock *
293753f127fSDimitry Andric   EmitInstrWithCustomInserter(MachineInstr &MI,
294753f127fSDimitry Andric                               MachineBasicBlock *BB) const override;
2955f757f3fSDimitry Andric   SDValue lowerATOMIC_FENCE(SDValue Op, SelectionDAG &DAG) const;
296753f127fSDimitry Andric   SDValue lowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
297bdd1243dSDimitry Andric   SDValue lowerEH_DWARF_CFA(SDValue Op, SelectionDAG &DAG) const;
298753f127fSDimitry Andric   SDValue lowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const;
299753f127fSDimitry Andric   SDValue lowerBITCAST(SDValue Op, SelectionDAG &DAG) const;
300753f127fSDimitry Andric   SDValue lowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
301bdd1243dSDimitry Andric   SDValue lowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
302bdd1243dSDimitry Andric   SDValue lowerVASTART(SDValue Op, SelectionDAG &DAG) const;
303bdd1243dSDimitry Andric   SDValue lowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
304bdd1243dSDimitry Andric   SDValue lowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
305bdd1243dSDimitry Andric   SDValue lowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
306bdd1243dSDimitry Andric   SDValue lowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
307bdd1243dSDimitry Andric   SDValue lowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
308bdd1243dSDimitry Andric   SDValue lowerWRITE_REGISTER(SDValue Op, SelectionDAG &DAG) const;
309647cbc5dSDimitry Andric   SDValue lowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
3105f757f3fSDimitry Andric   SDValue lowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
3115f757f3fSDimitry Andric   SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
3125f757f3fSDimitry Andric   SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const;
313753f127fSDimitry Andric 
314753f127fSDimitry Andric   bool isFPImmLegal(const APFloat &Imm, EVT VT,
315753f127fSDimitry Andric                     bool ForCodeSize) const override;
316753f127fSDimitry Andric 
317bdd1243dSDimitry Andric   bool shouldInsertFencesForAtomic(const Instruction *I) const override;
318bdd1243dSDimitry Andric 
319bdd1243dSDimitry Andric   ConstraintType getConstraintType(StringRef Constraint) const override;
320bdd1243dSDimitry Andric 
3215f757f3fSDimitry Andric   InlineAsm::ConstraintCode
3225f757f3fSDimitry Andric   getInlineAsmMemConstraint(StringRef ConstraintCode) const override;
323bdd1243dSDimitry Andric 
324bdd1243dSDimitry Andric   std::pair<unsigned, const TargetRegisterClass *>
325bdd1243dSDimitry Andric   getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
326bdd1243dSDimitry Andric                                StringRef Constraint, MVT VT) const override;
327bdd1243dSDimitry Andric 
3285f757f3fSDimitry Andric   void LowerAsmOperandForConstraint(SDValue Op, StringRef Constraint,
329bdd1243dSDimitry Andric                                     std::vector<SDValue> &Ops,
330bdd1243dSDimitry Andric                                     SelectionDAG &DAG) const override;
331bdd1243dSDimitry Andric 
332bdd1243dSDimitry Andric   bool isEligibleForTailCallOptimization(
333bdd1243dSDimitry Andric       CCState &CCInfo, CallLoweringInfo &CLI, MachineFunction &MF,
334bdd1243dSDimitry Andric       const SmallVectorImpl<CCValAssign> &ArgLocs) const;
33581ad6265SDimitry Andric };
33681ad6265SDimitry Andric 
33781ad6265SDimitry Andric } // end namespace llvm
33881ad6265SDimitry Andric 
33981ad6265SDimitry Andric #endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHISELLOWERING_H
340