xref: /aosp_15_r20/external/llvm/lib/Target/Hexagon/HexagonISelLowering.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- HexagonISelLowering.h - Hexagon DAG Lowering Interface --*- C++ -*-===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file defines the interfaces that Hexagon uses to lower LLVM code into a
11*9880d681SAndroid Build Coastguard Worker // selection DAG.
12*9880d681SAndroid Build Coastguard Worker //
13*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
14*9880d681SAndroid Build Coastguard Worker 
15*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONISELLOWERING_H
16*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_HEXAGON_HEXAGONISELLOWERING_H
17*9880d681SAndroid Build Coastguard Worker 
18*9880d681SAndroid Build Coastguard Worker #include "Hexagon.h"
19*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/CallingConvLower.h"
20*9880d681SAndroid Build Coastguard Worker #include "llvm/IR/CallingConv.h"
21*9880d681SAndroid Build Coastguard Worker #include "llvm/Target/TargetLowering.h"
22*9880d681SAndroid Build Coastguard Worker 
23*9880d681SAndroid Build Coastguard Worker namespace llvm {
24*9880d681SAndroid Build Coastguard Worker 
25*9880d681SAndroid Build Coastguard Worker // Return true when the given node fits in a positive half word.
26*9880d681SAndroid Build Coastguard Worker bool isPositiveHalfWord(SDNode *N);
27*9880d681SAndroid Build Coastguard Worker 
28*9880d681SAndroid Build Coastguard Worker   namespace HexagonISD {
29*9880d681SAndroid Build Coastguard Worker     enum NodeType : unsigned {
30*9880d681SAndroid Build Coastguard Worker       OP_BEGIN = ISD::BUILTIN_OP_END,
31*9880d681SAndroid Build Coastguard Worker 
32*9880d681SAndroid Build Coastguard Worker       CONST32 = OP_BEGIN,
33*9880d681SAndroid Build Coastguard Worker       CONST32_GP,  // For marking data present in GP.
34*9880d681SAndroid Build Coastguard Worker       FCONST32,
35*9880d681SAndroid Build Coastguard Worker       ALLOCA,
36*9880d681SAndroid Build Coastguard Worker       ARGEXTEND,
37*9880d681SAndroid Build Coastguard Worker 
38*9880d681SAndroid Build Coastguard Worker       AT_GOT,      // Index in GOT.
39*9880d681SAndroid Build Coastguard Worker       AT_PCREL,    // Offset relative to PC.
40*9880d681SAndroid Build Coastguard Worker 
41*9880d681SAndroid Build Coastguard Worker       CALLv3,      // A V3+ call instruction.
42*9880d681SAndroid Build Coastguard Worker       CALLv3nr,    // A V3+ call instruction that doesn't return.
43*9880d681SAndroid Build Coastguard Worker       CALLR,
44*9880d681SAndroid Build Coastguard Worker 
45*9880d681SAndroid Build Coastguard Worker       RET_FLAG,    // Return with a flag operand.
46*9880d681SAndroid Build Coastguard Worker       BARRIER,     // Memory barrier.
47*9880d681SAndroid Build Coastguard Worker       JT,          // Jump table.
48*9880d681SAndroid Build Coastguard Worker       CP,          // Constant pool.
49*9880d681SAndroid Build Coastguard Worker 
50*9880d681SAndroid Build Coastguard Worker       POPCOUNT,
51*9880d681SAndroid Build Coastguard Worker       COMBINE,
52*9880d681SAndroid Build Coastguard Worker       PACKHL,
53*9880d681SAndroid Build Coastguard Worker       VSPLATB,
54*9880d681SAndroid Build Coastguard Worker       VSPLATH,
55*9880d681SAndroid Build Coastguard Worker       SHUFFEB,
56*9880d681SAndroid Build Coastguard Worker       SHUFFEH,
57*9880d681SAndroid Build Coastguard Worker       SHUFFOB,
58*9880d681SAndroid Build Coastguard Worker       SHUFFOH,
59*9880d681SAndroid Build Coastguard Worker       VSXTBH,
60*9880d681SAndroid Build Coastguard Worker       VSXTBW,
61*9880d681SAndroid Build Coastguard Worker       VSRAW,
62*9880d681SAndroid Build Coastguard Worker       VSRAH,
63*9880d681SAndroid Build Coastguard Worker       VSRLW,
64*9880d681SAndroid Build Coastguard Worker       VSRLH,
65*9880d681SAndroid Build Coastguard Worker       VSHLW,
66*9880d681SAndroid Build Coastguard Worker       VSHLH,
67*9880d681SAndroid Build Coastguard Worker       VCMPBEQ,
68*9880d681SAndroid Build Coastguard Worker       VCMPBGT,
69*9880d681SAndroid Build Coastguard Worker       VCMPBGTU,
70*9880d681SAndroid Build Coastguard Worker       VCMPHEQ,
71*9880d681SAndroid Build Coastguard Worker       VCMPHGT,
72*9880d681SAndroid Build Coastguard Worker       VCMPHGTU,
73*9880d681SAndroid Build Coastguard Worker       VCMPWEQ,
74*9880d681SAndroid Build Coastguard Worker       VCMPWGT,
75*9880d681SAndroid Build Coastguard Worker       VCMPWGTU,
76*9880d681SAndroid Build Coastguard Worker 
77*9880d681SAndroid Build Coastguard Worker       INSERT,
78*9880d681SAndroid Build Coastguard Worker       INSERTRP,
79*9880d681SAndroid Build Coastguard Worker       EXTRACTU,
80*9880d681SAndroid Build Coastguard Worker       EXTRACTURP,
81*9880d681SAndroid Build Coastguard Worker       VCOMBINE,
82*9880d681SAndroid Build Coastguard Worker       TC_RETURN,
83*9880d681SAndroid Build Coastguard Worker       EH_RETURN,
84*9880d681SAndroid Build Coastguard Worker       DCFETCH,
85*9880d681SAndroid Build Coastguard Worker 
86*9880d681SAndroid Build Coastguard Worker       OP_END
87*9880d681SAndroid Build Coastguard Worker     };
88*9880d681SAndroid Build Coastguard Worker   }
89*9880d681SAndroid Build Coastguard Worker 
90*9880d681SAndroid Build Coastguard Worker   class HexagonSubtarget;
91*9880d681SAndroid Build Coastguard Worker 
92*9880d681SAndroid Build Coastguard Worker   class HexagonTargetLowering : public TargetLowering {
93*9880d681SAndroid Build Coastguard Worker     int VarArgsFrameOffset;   // Frame offset to start of varargs area.
94*9880d681SAndroid Build Coastguard Worker 
95*9880d681SAndroid Build Coastguard Worker     bool CanReturnSmallStruct(const Function* CalleeFn, unsigned& RetSize)
96*9880d681SAndroid Build Coastguard Worker         const;
97*9880d681SAndroid Build Coastguard Worker     void promoteLdStType(MVT VT, MVT PromotedLdStVT);
98*9880d681SAndroid Build Coastguard Worker     const HexagonTargetMachine &HTM;
99*9880d681SAndroid Build Coastguard Worker     const HexagonSubtarget &Subtarget;
100*9880d681SAndroid Build Coastguard Worker 
101*9880d681SAndroid Build Coastguard Worker   public:
102*9880d681SAndroid Build Coastguard Worker     explicit HexagonTargetLowering(const TargetMachine &TM,
103*9880d681SAndroid Build Coastguard Worker                                    const HexagonSubtarget &ST);
104*9880d681SAndroid Build Coastguard Worker 
105*9880d681SAndroid Build Coastguard Worker     /// IsEligibleForTailCallOptimization - Check whether the call is eligible
106*9880d681SAndroid Build Coastguard Worker     /// for tail call optimization. Targets which want to do tail call
107*9880d681SAndroid Build Coastguard Worker     /// optimization should implement this function.
108*9880d681SAndroid Build Coastguard Worker     bool IsEligibleForTailCallOptimization(SDValue Callee,
109*9880d681SAndroid Build Coastguard Worker         CallingConv::ID CalleeCC, bool isVarArg, bool isCalleeStructRet,
110*9880d681SAndroid Build Coastguard Worker         bool isCallerStructRet, const SmallVectorImpl<ISD::OutputArg> &Outs,
111*9880d681SAndroid Build Coastguard Worker         const SmallVectorImpl<SDValue> &OutVals,
112*9880d681SAndroid Build Coastguard Worker         const SmallVectorImpl<ISD::InputArg> &Ins, SelectionDAG& DAG) const;
113*9880d681SAndroid Build Coastguard Worker 
114*9880d681SAndroid Build Coastguard Worker     bool isTruncateFree(Type *Ty1, Type *Ty2) const override;
115*9880d681SAndroid Build Coastguard Worker     bool isTruncateFree(EVT VT1, EVT VT2) const override;
116*9880d681SAndroid Build Coastguard Worker 
117*9880d681SAndroid Build Coastguard Worker     bool allowTruncateForTailCall(Type *Ty1, Type *Ty2) const override;
118*9880d681SAndroid Build Coastguard Worker 
119*9880d681SAndroid Build Coastguard Worker     // Should we expand the build vector with shuffles?
120*9880d681SAndroid Build Coastguard Worker     bool shouldExpandBuildVectorWithShuffles(EVT VT,
121*9880d681SAndroid Build Coastguard Worker         unsigned DefinedValues) const override;
122*9880d681SAndroid Build Coastguard Worker 
123*9880d681SAndroid Build Coastguard Worker     SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
124*9880d681SAndroid Build Coastguard Worker     const char *getTargetNodeName(unsigned Opcode) const override;
125*9880d681SAndroid Build Coastguard Worker     SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const;
126*9880d681SAndroid Build Coastguard Worker     SDValue LowerEXTRACT_VECTOR(SDValue Op, SelectionDAG &DAG) const;
127*9880d681SAndroid Build Coastguard Worker     SDValue LowerINSERT_VECTOR(SDValue Op, SelectionDAG &DAG) const;
128*9880d681SAndroid Build Coastguard Worker     SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
129*9880d681SAndroid Build Coastguard Worker     SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
130*9880d681SAndroid Build Coastguard Worker     SDValue LowerINLINEASM(SDValue Op, SelectionDAG &DAG) const;
131*9880d681SAndroid Build Coastguard Worker     SDValue LowerPREFETCH(SDValue Op, SelectionDAG &DAG) const;
132*9880d681SAndroid Build Coastguard Worker     SDValue LowerEH_LABEL(SDValue Op, SelectionDAG &DAG) const;
133*9880d681SAndroid Build Coastguard Worker     SDValue LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) const;
134*9880d681SAndroid Build Coastguard Worker     SDValue
135*9880d681SAndroid Build Coastguard Worker     LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
136*9880d681SAndroid Build Coastguard Worker                          const SmallVectorImpl<ISD::InputArg> &Ins,
137*9880d681SAndroid Build Coastguard Worker                          const SDLoc &dl, SelectionDAG &DAG,
138*9880d681SAndroid Build Coastguard Worker                          SmallVectorImpl<SDValue> &InVals) const override;
139*9880d681SAndroid Build Coastguard Worker     SDValue LowerGLOBALADDRESS(SDValue Op, SelectionDAG &DAG) const;
140*9880d681SAndroid Build Coastguard Worker     SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
141*9880d681SAndroid Build Coastguard Worker     SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
142*9880d681SAndroid Build Coastguard Worker     SDValue LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA,
143*9880d681SAndroid Build Coastguard Worker         SelectionDAG &DAG) const;
144*9880d681SAndroid Build Coastguard Worker     SDValue LowerToTLSInitialExecModel(GlobalAddressSDNode *GA,
145*9880d681SAndroid Build Coastguard Worker         SelectionDAG &DAG) const;
146*9880d681SAndroid Build Coastguard Worker     SDValue LowerToTLSLocalExecModel(GlobalAddressSDNode *GA,
147*9880d681SAndroid Build Coastguard Worker         SelectionDAG &DAG) const;
148*9880d681SAndroid Build Coastguard Worker     SDValue GetDynamicTLSAddr(SelectionDAG &DAG, SDValue Chain,
149*9880d681SAndroid Build Coastguard Worker         GlobalAddressSDNode *GA, SDValue *InFlag, EVT PtrVT,
150*9880d681SAndroid Build Coastguard Worker         unsigned ReturnReg, unsigned char OperandFlags) const;
151*9880d681SAndroid Build Coastguard Worker     SDValue LowerGLOBAL_OFFSET_TABLE(SDValue Op, SelectionDAG &DAG) const;
152*9880d681SAndroid Build Coastguard Worker 
153*9880d681SAndroid Build Coastguard Worker     SDValue LowerCall(TargetLowering::CallLoweringInfo &CLI,
154*9880d681SAndroid Build Coastguard Worker         SmallVectorImpl<SDValue> &InVals) const override;
155*9880d681SAndroid Build Coastguard Worker     SDValue LowerCallResult(SDValue Chain, SDValue InFlag,
156*9880d681SAndroid Build Coastguard Worker                             CallingConv::ID CallConv, bool isVarArg,
157*9880d681SAndroid Build Coastguard Worker                             const SmallVectorImpl<ISD::InputArg> &Ins,
158*9880d681SAndroid Build Coastguard Worker                             const SDLoc &dl, SelectionDAG &DAG,
159*9880d681SAndroid Build Coastguard Worker                             SmallVectorImpl<SDValue> &InVals,
160*9880d681SAndroid Build Coastguard Worker                             const SmallVectorImpl<SDValue> &OutVals,
161*9880d681SAndroid Build Coastguard Worker                             SDValue Callee) const;
162*9880d681SAndroid Build Coastguard Worker 
163*9880d681SAndroid Build Coastguard Worker     SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
164*9880d681SAndroid Build Coastguard Worker     SDValue LowerVSELECT(SDValue Op, SelectionDAG &DAG) const;
165*9880d681SAndroid Build Coastguard Worker     SDValue LowerCTPOP(SDValue Op, SelectionDAG &DAG) const;
166*9880d681SAndroid Build Coastguard Worker     SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
167*9880d681SAndroid Build Coastguard Worker     SDValue LowerATOMIC_FENCE(SDValue Op, SelectionDAG& DAG) const;
168*9880d681SAndroid Build Coastguard Worker     SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
169*9880d681SAndroid Build Coastguard Worker     SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
170*9880d681SAndroid Build Coastguard Worker 
171*9880d681SAndroid Build Coastguard Worker     SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
172*9880d681SAndroid Build Coastguard Worker                         const SmallVectorImpl<ISD::OutputArg> &Outs,
173*9880d681SAndroid Build Coastguard Worker                         const SmallVectorImpl<SDValue> &OutVals,
174*9880d681SAndroid Build Coastguard Worker                         const SDLoc &dl, SelectionDAG &DAG) const override;
175*9880d681SAndroid Build Coastguard Worker 
176*9880d681SAndroid Build Coastguard Worker     bool mayBeEmittedAsTailCall(CallInst *CI) const override;
177*9880d681SAndroid Build Coastguard Worker     MachineBasicBlock *
178*9880d681SAndroid Build Coastguard Worker     EmitInstrWithCustomInserter(MachineInstr &MI,
179*9880d681SAndroid Build Coastguard Worker                                 MachineBasicBlock *BB) const override;
180*9880d681SAndroid Build Coastguard Worker 
181*9880d681SAndroid Build Coastguard Worker     /// If a physical register, this returns the register that receives the
182*9880d681SAndroid Build Coastguard Worker     /// exception address on entry to an EH pad.
183*9880d681SAndroid Build Coastguard Worker     unsigned
getExceptionPointerRegister(const Constant * PersonalityFn)184*9880d681SAndroid Build Coastguard Worker     getExceptionPointerRegister(const Constant *PersonalityFn) const override {
185*9880d681SAndroid Build Coastguard Worker       return Hexagon::R0;
186*9880d681SAndroid Build Coastguard Worker     }
187*9880d681SAndroid Build Coastguard Worker 
188*9880d681SAndroid Build Coastguard Worker     /// If a physical register, this returns the register that receives the
189*9880d681SAndroid Build Coastguard Worker     /// exception typeid on entry to a landing pad.
190*9880d681SAndroid Build Coastguard Worker     unsigned
getExceptionSelectorRegister(const Constant * PersonalityFn)191*9880d681SAndroid Build Coastguard Worker     getExceptionSelectorRegister(const Constant *PersonalityFn) const override {
192*9880d681SAndroid Build Coastguard Worker       return Hexagon::R1;
193*9880d681SAndroid Build Coastguard Worker     }
194*9880d681SAndroid Build Coastguard Worker 
195*9880d681SAndroid Build Coastguard Worker     SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const;
196*9880d681SAndroid Build Coastguard Worker     SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
197*9880d681SAndroid Build Coastguard Worker     SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
getSetCCResultType(const DataLayout &,LLVMContext & C,EVT VT)198*9880d681SAndroid Build Coastguard Worker     EVT getSetCCResultType(const DataLayout &, LLVMContext &C,
199*9880d681SAndroid Build Coastguard Worker                            EVT VT) const override {
200*9880d681SAndroid Build Coastguard Worker       if (!VT.isVector())
201*9880d681SAndroid Build Coastguard Worker         return MVT::i1;
202*9880d681SAndroid Build Coastguard Worker       else
203*9880d681SAndroid Build Coastguard Worker         return EVT::getVectorVT(C, MVT::i1, VT.getVectorNumElements());
204*9880d681SAndroid Build Coastguard Worker     }
205*9880d681SAndroid Build Coastguard Worker 
206*9880d681SAndroid Build Coastguard Worker     bool getPostIndexedAddressParts(SDNode *N, SDNode *Op,
207*9880d681SAndroid Build Coastguard Worker                                     SDValue &Base, SDValue &Offset,
208*9880d681SAndroid Build Coastguard Worker                                     ISD::MemIndexedMode &AM,
209*9880d681SAndroid Build Coastguard Worker                                     SelectionDAG &DAG) const override;
210*9880d681SAndroid Build Coastguard Worker 
211*9880d681SAndroid Build Coastguard Worker     ConstraintType getConstraintType(StringRef Constraint) const override;
212*9880d681SAndroid Build Coastguard Worker 
213*9880d681SAndroid Build Coastguard Worker     std::pair<unsigned, const TargetRegisterClass *>
214*9880d681SAndroid Build Coastguard Worker     getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
215*9880d681SAndroid Build Coastguard Worker                                  StringRef Constraint, MVT VT) const override;
216*9880d681SAndroid Build Coastguard Worker 
217*9880d681SAndroid Build Coastguard Worker     unsigned
getInlineAsmMemConstraint(StringRef ConstraintCode)218*9880d681SAndroid Build Coastguard Worker     getInlineAsmMemConstraint(StringRef ConstraintCode) const override {
219*9880d681SAndroid Build Coastguard Worker       if (ConstraintCode == "o")
220*9880d681SAndroid Build Coastguard Worker         return InlineAsm::Constraint_o;
221*9880d681SAndroid Build Coastguard Worker       return TargetLowering::getInlineAsmMemConstraint(ConstraintCode);
222*9880d681SAndroid Build Coastguard Worker     }
223*9880d681SAndroid Build Coastguard Worker 
224*9880d681SAndroid Build Coastguard Worker     // Intrinsics
225*9880d681SAndroid Build Coastguard Worker     SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
226*9880d681SAndroid Build Coastguard Worker     SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
227*9880d681SAndroid Build Coastguard Worker     /// isLegalAddressingMode - Return true if the addressing mode represented
228*9880d681SAndroid Build Coastguard Worker     /// by AM is legal for this target, for a load/store of the specified type.
229*9880d681SAndroid Build Coastguard Worker     /// The type may be VoidTy, in which case only return true if the addressing
230*9880d681SAndroid Build Coastguard Worker     /// mode is legal for a load/store of any legal type.
231*9880d681SAndroid Build Coastguard Worker     /// TODO: Handle pre/postinc as well.
232*9880d681SAndroid Build Coastguard Worker     bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM,
233*9880d681SAndroid Build Coastguard Worker                                Type *Ty, unsigned AS) const override;
234*9880d681SAndroid Build Coastguard Worker     /// Return true if folding a constant offset with the given GlobalAddress
235*9880d681SAndroid Build Coastguard Worker     /// is legal.  It is frequently not legal in PIC relocation models.
236*9880d681SAndroid Build Coastguard Worker     bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
237*9880d681SAndroid Build Coastguard Worker 
238*9880d681SAndroid Build Coastguard Worker     bool isFPImmLegal(const APFloat &Imm, EVT VT) const override;
239*9880d681SAndroid Build Coastguard Worker 
240*9880d681SAndroid Build Coastguard Worker     /// isLegalICmpImmediate - Return true if the specified immediate is legal
241*9880d681SAndroid Build Coastguard Worker     /// icmp immediate, that is the target has icmp instructions which can
242*9880d681SAndroid Build Coastguard Worker     /// compare a register against the immediate without having to materialize
243*9880d681SAndroid Build Coastguard Worker     /// the immediate into a register.
244*9880d681SAndroid Build Coastguard Worker     bool isLegalICmpImmediate(int64_t Imm) const override;
245*9880d681SAndroid Build Coastguard Worker 
246*9880d681SAndroid Build Coastguard Worker     bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
247*9880d681SAndroid Build Coastguard Worker         unsigned Align, bool *Fast) const override;
248*9880d681SAndroid Build Coastguard Worker 
249*9880d681SAndroid Build Coastguard Worker     /// Returns relocation base for the given PIC jumptable.
250*9880d681SAndroid Build Coastguard Worker     SDValue getPICJumpTableRelocBase(SDValue Table, SelectionDAG &DAG)
251*9880d681SAndroid Build Coastguard Worker                                      const override;
252*9880d681SAndroid Build Coastguard Worker 
253*9880d681SAndroid Build Coastguard Worker     // Handling of atomic RMW instructions.
254*9880d681SAndroid Build Coastguard Worker     Value *emitLoadLinked(IRBuilder<> &Builder, Value *Addr,
255*9880d681SAndroid Build Coastguard Worker         AtomicOrdering Ord) const override;
256*9880d681SAndroid Build Coastguard Worker     Value *emitStoreConditional(IRBuilder<> &Builder, Value *Val,
257*9880d681SAndroid Build Coastguard Worker         Value *Addr, AtomicOrdering Ord) const override;
258*9880d681SAndroid Build Coastguard Worker     AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const override;
259*9880d681SAndroid Build Coastguard Worker     bool shouldExpandAtomicStoreInIR(StoreInst *SI) const override;
260*9880d681SAndroid Build Coastguard Worker     bool shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const override;
261*9880d681SAndroid Build Coastguard Worker 
262*9880d681SAndroid Build Coastguard Worker     AtomicExpansionKind
shouldExpandAtomicRMWInIR(AtomicRMWInst * AI)263*9880d681SAndroid Build Coastguard Worker     shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const override {
264*9880d681SAndroid Build Coastguard Worker       return AtomicExpansionKind::LLSC;
265*9880d681SAndroid Build Coastguard Worker     }
266*9880d681SAndroid Build Coastguard Worker 
267*9880d681SAndroid Build Coastguard Worker   protected:
268*9880d681SAndroid Build Coastguard Worker     std::pair<const TargetRegisterClass*, uint8_t>
269*9880d681SAndroid Build Coastguard Worker     findRepresentativeClass(const TargetRegisterInfo *TRI, MVT VT)
270*9880d681SAndroid Build Coastguard Worker         const override;
271*9880d681SAndroid Build Coastguard Worker   };
272*9880d681SAndroid Build Coastguard Worker } // end namespace llvm
273*9880d681SAndroid Build Coastguard Worker 
274*9880d681SAndroid Build Coastguard Worker #endif    // Hexagon_ISELLOWERING_H
275