blob: ac9aac88844554e124a3d0fbb7b08e3333afac87 [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001//===-- SIISelLowering.h - SI 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/// \file
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000011/// SI DAG Lowering interface definition
Tom Stellard75aadc22012-12-11 21:25:42 +000012//
13//===----------------------------------------------------------------------===//
14
Matt Arsenault6b6a2c32016-03-11 08:00:27 +000015#ifndef LLVM_LIB_TARGET_AMDGPU_SIISELLOWERING_H
16#define LLVM_LIB_TARGET_AMDGPU_SIISELLOWERING_H
Tom Stellard75aadc22012-12-11 21:25:42 +000017
18#include "AMDGPUISelLowering.h"
Matt Arsenault8623e8d2017-08-03 23:00:29 +000019#include "AMDGPUArgumentUsageInfo.h"
Tom Stellard75aadc22012-12-11 21:25:42 +000020#include "SIInstrInfo.h"
21
22namespace llvm {
23
Matt Arsenault6b6a2c32016-03-11 08:00:27 +000024class SITargetLowering final : public AMDGPUTargetLowering {
Tom Stellardc5a154d2018-06-28 23:47:12 +000025private:
Tom Stellard5bfbae52018-07-11 20:59:01 +000026 const GCNSubtarget *Subtarget;
Tom Stellardc5a154d2018-06-28 23:47:12 +000027
Matt Arsenault8f9dde92018-07-28 14:11:34 +000028public:
29 MVT getRegisterTypeForCallingConv(LLVMContext &Context,
30 CallingConv::ID CC,
31 EVT VT) const override;
32 unsigned getNumRegistersForCallingConv(LLVMContext &Context,
33 CallingConv::ID CC,
34 EVT VT) const override;
35
36 unsigned getVectorTypeBreakdownForCallingConv(
37 LLVMContext &Context, CallingConv::ID CC, EVT VT, EVT &IntermediateVT,
38 unsigned &NumIntermediates, MVT &RegisterVT) const override;
39
40private:
Matt Arsenaulte622dc32017-04-11 22:29:24 +000041 SDValue lowerKernArgParameterPtr(SelectionDAG &DAG, const SDLoc &SL,
42 SDValue Chain, uint64_t Offset) const;
Matt Arsenault9166ce82017-07-28 15:52:08 +000043 SDValue getImplicitArgPtr(SelectionDAG &DAG, const SDLoc &SL) const;
Matt Arsenaulte622dc32017-04-11 22:29:24 +000044 SDValue lowerKernargMemParameter(SelectionDAG &DAG, EVT VT, EVT MemVT,
45 const SDLoc &SL, SDValue Chain,
Matt Arsenault7b4826e2018-05-30 16:17:51 +000046 uint64_t Offset, unsigned Align, bool Signed,
Matt Arsenaulte622dc32017-04-11 22:29:24 +000047 const ISD::InputArg *Arg = nullptr) const;
48
Matt Arsenault2b1f9aa2017-05-17 21:56:25 +000049 SDValue lowerStackParameter(SelectionDAG &DAG, CCValAssign &VA,
50 const SDLoc &SL, SDValue Chain,
51 const ISD::InputArg &Arg) const;
Matt Arsenault8623e8d2017-08-03 23:00:29 +000052 SDValue getPreloadedValue(SelectionDAG &DAG,
53 const SIMachineFunctionInfo &MFI,
54 EVT VT,
55 AMDGPUFunctionArgInfo::PreloadedValue) const;
Matt Arsenault2b1f9aa2017-05-17 21:56:25 +000056
Tom Stellardbf3e6e52016-06-14 20:29:59 +000057 SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op,
58 SelectionDAG &DAG) const override;
Matt Arsenaultff6da2f2015-11-30 21:15:45 +000059 SDValue lowerImplicitZextParam(SelectionDAG &DAG, SDValue Op,
60 MVT VT, unsigned Offset) const;
Nicolai Haehnle7a9c03f2018-06-21 13:36:57 +000061 SDValue lowerImage(SDValue Op, const AMDGPU::ImageDimIntrinsicInfo *Intr,
62 SelectionDAG &DAG) const;
Matt Arsenaultff6da2f2015-11-30 21:15:45 +000063
Matt Arsenaulta5789bb2014-07-26 06:23:37 +000064 SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenaulta9dbdca2016-04-12 14:05:04 +000065 SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenaulta5789bb2014-07-26 06:23:37 +000066 SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenault90083d32018-06-07 09:54:49 +000067
68 SDValue widenLoad(LoadSDNode *Ld, DAGCombinerInfo &DCI) const;
Tom Stellard81d871d2013-11-13 23:36:50 +000069 SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
Tom Stellard0ec134f2014-02-04 17:18:40 +000070 SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenaulta1fe17c2016-07-19 23:16:53 +000071 SDValue lowerFastUnsafeFDIV(SDValue Op, SelectionDAG &DAG) const;
72 SDValue lowerFDIV_FAST(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenault4052a572016-12-22 03:05:41 +000073 SDValue LowerFDIV16(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenaulte9fa3b82014-07-15 20:18:31 +000074 SDValue LowerFDIV32(SDValue Op, SelectionDAG &DAG) const;
75 SDValue LowerFDIV64(SDValue Op, SelectionDAG &DAG) const;
76 SDValue LowerFDIV(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenaultf7c95e32014-10-03 23:54:41 +000077 SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG, bool Signed) const;
Tom Stellard81d871d2013-11-13 23:36:50 +000078 SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenaultad14ce82014-07-19 18:44:39 +000079 SDValue LowerTrig(SDValue Op, SelectionDAG &DAG) const;
Tom Stellard354a43c2016-04-01 18:27:37 +000080 SDValue LowerATOMIC_CMP_SWAP(SDValue Op, SelectionDAG &DAG) const;
Tom Stellardf8794352012-12-19 22:10:31 +000081 SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
Tom Stellard75aadc22012-12-11 21:25:42 +000082
Matt Arsenault1349a042018-05-22 06:32:10 +000083 SDValue adjustLoadValueType(unsigned Opcode, MemSDNode *M,
Tim Renouf366a49d2018-08-02 23:33:01 +000084 SelectionDAG &DAG, ArrayRef<SDValue> Ops,
Matt Arsenault1349a042018-05-22 06:32:10 +000085 bool IsIntrinsic = false) const;
86
Changpeng Fang44dfa1d2018-01-12 21:12:19 +000087 SDValue handleD16VData(SDValue VData, SelectionDAG &DAG) const;
88
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000089 /// Converts \p Op, which must be of floating point type, to the
Konstantin Zhuravlyovf86e4b72016-11-13 07:01:11 +000090 /// floating point type \p VT, by either extending or truncating it.
91 SDValue getFPExtOrFPTrunc(SelectionDAG &DAG,
92 SDValue Op,
93 const SDLoc &DL,
94 EVT VT) const;
95
Matt Arsenaulte622dc32017-04-11 22:29:24 +000096 SDValue convertArgType(
97 SelectionDAG &DAG, EVT VT, EVT MemVT, const SDLoc &SL, SDValue Val,
98 bool Signed, const ISD::InputArg *Arg = nullptr) const;
99
Adrian Prantl5f8f34e42018-05-01 15:54:18 +0000100 /// Custom lowering for ISD::FP_ROUND for MVT::f16.
Konstantin Zhuravlyovd709efb2016-11-17 04:28:37 +0000101 SDValue lowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const;
102
Konstantin Zhuravlyov4b3847e2017-04-06 23:02:33 +0000103 SDValue getSegmentAperture(unsigned AS, const SDLoc &DL,
104 SelectionDAG &DAG) const;
105
Matt Arsenault99c14522016-04-25 19:27:24 +0000106 SDValue lowerADDRSPACECAST(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenault3aef8092017-01-23 23:09:58 +0000107 SDValue lowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
108 SDValue lowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenault67a98152018-05-16 11:47:30 +0000109 SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenault0bb294b2016-06-17 22:27:03 +0000110 SDValue lowerTRAP(SDValue Op, SelectionDAG &DAG) const;
Tony Tye43259df2018-05-16 16:19:34 +0000111 SDValue lowerDEBUGTRAP(SDValue Op, SelectionDAG &DAG) const;
Matt Arsenault99c14522016-04-25 19:27:24 +0000112
Matt Arsenault68f05052017-12-04 22:18:27 +0000113 SDNode *adjustWritemask(MachineSDNode *&N, SelectionDAG &DAG) const;
Christian Konig8e06e2a2013-04-10 08:39:08 +0000114
Matt Arsenaulte6986632015-01-14 01:35:22 +0000115 SDValue performUCharToFloatCombine(SDNode *N,
116 DAGCombinerInfo &DCI) const;
Matt Arsenaultb2baffa2014-08-15 17:49:05 +0000117 SDValue performSHLPtrCombine(SDNode *N,
118 unsigned AS,
Matt Arsenaultfbe95332017-11-13 05:11:54 +0000119 EVT MemVT,
Matt Arsenaultb2baffa2014-08-15 17:49:05 +0000120 DAGCombinerInfo &DCI) const;
Matt Arsenaultfa5f7672016-09-14 15:19:03 +0000121
Matt Arsenaultd8b73d52016-12-22 03:44:42 +0000122 SDValue performMemSDNodeCombine(MemSDNode *N, DAGCombinerInfo &DCI) const;
123
Matt Arsenaultfa5f7672016-09-14 15:19:03 +0000124 SDValue splitBinaryBitConstantOp(DAGCombinerInfo &DCI, const SDLoc &SL,
125 unsigned Opc, SDValue LHS,
126 const ConstantSDNode *CRHS) const;
127
Matt Arsenaultd0101a22015-01-06 23:00:46 +0000128 SDValue performAndCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultf2290332015-01-06 23:00:39 +0000129 SDValue performOrCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultfa5f7672016-09-14 15:19:03 +0000130 SDValue performXorCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenault8edfaee2017-03-31 19:53:03 +0000131 SDValue performZeroExtendCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultf2290332015-01-06 23:00:39 +0000132 SDValue performClassCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultf2a167f2018-08-06 22:10:26 +0000133 SDValue getCanonicalConstantFP(SelectionDAG &DAG, const SDLoc &SL, EVT VT,
134 const APFloat &C) const;
Matt Arsenault9cd90712016-04-14 01:42:16 +0000135 SDValue performFCanonicalizeCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenault364a6742014-06-11 17:50:44 +0000136
Matt Arsenault2fdf2a12017-02-21 23:35:48 +0000137 SDValue performFPMed3ImmCombine(SelectionDAG &DAG, const SDLoc &SL,
138 SDValue Op0, SDValue Op1) const;
Matt Arsenault10268f92017-02-27 22:40:39 +0000139 SDValue performIntMed3ImmCombine(SelectionDAG &DAG, const SDLoc &SL,
140 SDValue Op0, SDValue Op1, bool Signed) const;
Matt Arsenaultf639c322016-01-28 20:53:42 +0000141 SDValue performMinMaxCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenault2fdf2a12017-02-21 23:35:48 +0000142 SDValue performFMed3Combine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenault1f17c662017-02-22 00:27:34 +0000143 SDValue performCvtPkRTZCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultbf5482e2017-05-11 17:26:25 +0000144 SDValue performExtractVectorEltCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenault8cbb4882017-09-20 21:01:24 +0000145 SDValue performBuildVectorCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultf639c322016-01-28 20:53:42 +0000146
Matt Arsenault46e6b7a2016-12-22 04:03:35 +0000147 unsigned getFusedOpcode(const SelectionDAG &DAG,
148 const SDNode *N0, const SDNode *N1) const;
Stanislav Mekhanoshine3eb42c2017-06-21 22:05:06 +0000149 SDValue performAddCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Stanislav Mekhanoshina8b26932017-06-21 22:30:01 +0000150 SDValue performAddCarrySubCarryCombine(SDNode *N, DAGCombinerInfo &DCI) const;
151 SDValue performSubCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultd8b73d52016-12-22 03:44:42 +0000152 SDValue performFAddCombine(SDNode *N, DAGCombinerInfo &DCI) const;
153 SDValue performFSubCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Farhana Aleenc370d7b2018-07-16 18:19:59 +0000154 SDValue performFMACombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenault6f6233d2015-01-06 23:00:41 +0000155 SDValue performSetCCCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultd8b73d52016-12-22 03:44:42 +0000156 SDValue performCvtF32UByteNCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Tom Stellard1b95fed2018-05-24 05:28:34 +0000157 SDValue performClampCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Stanislav Mekhanoshin1a1687f2018-06-27 15:33:33 +0000158 SDValue performRcpCombine(SDNode *N, DAGCombinerInfo &DCI) const;
Matt Arsenaultcc3c2b32014-11-14 20:08:52 +0000159
Tom Stellard70580f82015-07-20 14:28:41 +0000160 bool isLegalFlatAddressingMode(const AddrMode &AM) const;
Matt Arsenaultdc8f5cc2017-07-29 01:12:31 +0000161 bool isLegalGlobalAddressingMode(const AddrMode &AM) const;
Matt Arsenault711b3902015-08-07 20:18:34 +0000162 bool isLegalMUBUFAddressingMode(const AddrMode &AM) const;
Tom Stellardbc4497b2016-02-12 23:45:29 +0000163
Matt Arsenaultc5b641a2017-03-17 20:41:45 +0000164 unsigned isCFIntrinsic(const SDNode *Intr) const;
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +0000165
166 void createDebuggerPrologueStackObjects(MachineFunction &MF) const;
Konstantin Zhuravlyov08326b62016-10-20 18:12:38 +0000167
168 /// \returns True if fixup needs to be emitted for given global value \p GV,
169 /// false otherwise.
170 bool shouldEmitFixup(const GlobalValue *GV) const;
171
172 /// \returns True if GOT relocation needs to be emitted for given global value
173 /// \p GV, false otherwise.
174 bool shouldEmitGOTReloc(const GlobalValue *GV) const;
175
176 /// \returns True if PC-relative relocation needs to be emitted for given
177 /// global value \p GV, false otherwise.
178 bool shouldEmitPCReloc(const GlobalValue *GV) const;
179
Tom Stellard75aadc22012-12-11 21:25:42 +0000180public:
Tom Stellard5bfbae52018-07-11 20:59:01 +0000181 SITargetLowering(const TargetMachine &tm, const GCNSubtarget &STI);
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000182
Tom Stellard5bfbae52018-07-11 20:59:01 +0000183 const GCNSubtarget *getSubtarget() const;
Matt Arsenault5015a892014-08-15 17:17:07 +0000184
Tom Stellardb12f4de2018-05-22 19:37:55 +0000185 bool isFPExtFoldable(unsigned Opcode, EVT DestVT, EVT SrcVT) const override;
186
Zvi Rackover1b736822017-07-26 08:06:58 +0000187 bool isShuffleMaskLegal(ArrayRef<int> /*Mask*/, EVT /*VT*/) const override;
Matt Arsenault7dc01c92017-03-15 23:15:12 +0000188
Matt Arsenaulta9dbdca2016-04-12 14:05:04 +0000189 bool getTgtMemIntrinsic(IntrinsicInfo &, const CallInst &,
Matt Arsenault7d7adf42017-12-14 22:34:10 +0000190 MachineFunction &MF,
Matt Arsenaulta9dbdca2016-04-12 14:05:04 +0000191 unsigned IntrinsicID) const override;
192
Matt Arsenault7dc01c92017-03-15 23:15:12 +0000193 bool getAddrModeArguments(IntrinsicInst * /*I*/,
194 SmallVectorImpl<Value*> &/*Ops*/,
195 Type *&/*AccessTy*/) const override;
Matt Arsenaulte306a322014-10-21 16:25:08 +0000196
Mehdi Amini0cdec1e2015-07-09 02:09:40 +0000197 bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty,
Jonas Paulsson024e3192017-07-21 11:59:37 +0000198 unsigned AS,
199 Instruction *I = nullptr) const override;
Matt Arsenault5015a892014-08-15 17:17:07 +0000200
Nirav Dave4dcad5d2017-07-10 20:25:54 +0000201 bool canMergeStoresTo(unsigned AS, EVT MemVT,
202 const SelectionDAG &DAG) const override;
Nirav Daved20066c2017-05-24 15:59:09 +0000203
Matt Arsenault6f2a5262014-07-27 17:46:40 +0000204 bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AS,
205 unsigned Align,
206 bool *IsFast) const override;
Chandler Carruth9d010ff2014-07-03 00:23:43 +0000207
Matt Arsenault46645fa2014-07-28 17:49:26 +0000208 EVT getOptimalMemOpType(uint64_t Size, unsigned DstAlign,
209 unsigned SrcAlign, bool IsMemset,
210 bool ZeroMemset,
211 bool MemcpyStrSrc,
212 MachineFunction &MF) const override;
213
Tom Stellarda6f24c62015-12-15 20:55:55 +0000214 bool isMemOpUniform(const SDNode *N) const;
Alexander Timofeev18009562016-12-08 17:28:47 +0000215 bool isMemOpHasNoClobberedMemOperand(const SDNode *N) const;
Matt Arsenaultf9bfeaf2015-12-01 23:04:00 +0000216 bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override;
Matt Arsenaultd4da0ed2016-12-02 18:12:53 +0000217 bool isCheapAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override;
Matt Arsenaultf9bfeaf2015-12-01 23:04:00 +0000218
Chandler Carruth9d010ff2014-07-03 00:23:43 +0000219 TargetLoweringBase::LegalizeTypeAction
220 getPreferredVectorAction(EVT VT) const override;
Christian Konig2c8f6d52013-03-07 09:03:52 +0000221
Craig Topper5656db42014-04-29 07:57:24 +0000222 bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
223 Type *Ty) const override;
Matt Arsenaultd7bdcc42014-03-31 19:54:27 +0000224
Tom Stellard2e045bb2016-01-20 00:13:22 +0000225 bool isTypeDesirableForOp(unsigned Op, EVT VT) const override;
226
Tom Stellardb164a982016-06-25 01:59:16 +0000227 bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
228
Matt Arsenaultb62a4eb2017-08-01 19:54:18 +0000229 bool supportSplitCSR(MachineFunction *MF) const override;
230 void initializeSplitCSR(MachineBasicBlock *Entry) const override;
231 void insertCopiesSplitCSR(
232 MachineBasicBlock *Entry,
233 const SmallVectorImpl<MachineBasicBlock *> &Exits) const override;
234
Christian Konig2c8f6d52013-03-07 09:03:52 +0000235 SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
236 bool isVarArg,
237 const SmallVectorImpl<ISD::InputArg> &Ins,
Benjamin Kramerbdc49562016-06-12 15:39:02 +0000238 const SDLoc &DL, SelectionDAG &DAG,
Craig Topper5656db42014-04-29 07:57:24 +0000239 SmallVectorImpl<SDValue> &InVals) const override;
Christian Konig2c8f6d52013-03-07 09:03:52 +0000240
Matt Arsenault2b1f9aa2017-05-17 21:56:25 +0000241 bool CanLowerReturn(CallingConv::ID CallConv,
242 MachineFunction &MF, bool isVarArg,
243 const SmallVectorImpl<ISD::OutputArg> &Outs,
244 LLVMContext &Context) const override;
245
246 SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
Marek Olsak8a0f3352016-01-13 17:23:04 +0000247 const SmallVectorImpl<ISD::OutputArg> &Outs,
Benjamin Kramerbdc49562016-06-12 15:39:02 +0000248 const SmallVectorImpl<SDValue> &OutVals, const SDLoc &DL,
249 SelectionDAG &DAG) const override;
Marek Olsak8a0f3352016-01-13 17:23:04 +0000250
Matt Arsenault8623e8d2017-08-03 23:00:29 +0000251 void passSpecialInputs(
252 CallLoweringInfo &CLI,
253 const SIMachineFunctionInfo &Info,
254 SmallVectorImpl<std::pair<unsigned, SDValue>> &RegsToPass,
255 SmallVectorImpl<SDValue> &MemOpChains,
256 SDValue Chain,
257 SDValue StackPtr) const;
258
Matt Arsenaultb62a4eb2017-08-01 19:54:18 +0000259 SDValue LowerCallResult(SDValue Chain, SDValue InFlag,
260 CallingConv::ID CallConv, bool isVarArg,
261 const SmallVectorImpl<ISD::InputArg> &Ins,
262 const SDLoc &DL, SelectionDAG &DAG,
263 SmallVectorImpl<SDValue> &InVals, bool isThisReturn,
264 SDValue ThisVal) const;
Matt Arsenault71bcbd42017-08-11 20:42:08 +0000265
266 bool mayBeEmittedAsTailCall(const CallInst *) const override;
267
268 bool isEligibleForTailCallOptimization(
269 SDValue Callee, CallingConv::ID CalleeCC, bool isVarArg,
270 const SmallVectorImpl<ISD::OutputArg> &Outs,
271 const SmallVectorImpl<SDValue> &OutVals,
272 const SmallVectorImpl<ISD::InputArg> &Ins, SelectionDAG &DAG) const;
273
Matt Arsenaultb62a4eb2017-08-01 19:54:18 +0000274 SDValue LowerCall(CallLoweringInfo &CLI,
275 SmallVectorImpl<SDValue> &InVals) const override;
276
Matt Arsenault9a10cea2016-01-26 04:29:24 +0000277 unsigned getRegisterByName(const char* RegName, EVT VT,
278 SelectionDAG &DAG) const override;
279
Matt Arsenault786724a2016-07-12 21:41:32 +0000280 MachineBasicBlock *splitKillBlock(MachineInstr &MI,
281 MachineBasicBlock *BB) const;
282
Duncan P. N. Exon Smithe4f5e4f2016-06-30 22:52:52 +0000283 MachineBasicBlock *
284 EmitInstrWithCustomInserter(MachineInstr &MI,
285 MachineBasicBlock *BB) const override;
Matt Arsenaulte11d8ac2017-10-13 21:10:22 +0000286
287 bool hasBitPreservingFPLogic(EVT VT) const override;
Matt Arsenault423bf3f2015-01-29 19:34:32 +0000288 bool enableAggressiveFMAFusion(EVT VT) const override;
Mehdi Amini44ede332015-07-09 02:09:04 +0000289 EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context,
290 EVT VT) const override;
Mehdi Aminieaabc512015-07-09 15:12:23 +0000291 MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override;
Craig Topper5656db42014-04-29 07:57:24 +0000292 bool isFMAFasterThanFMulAndFAdd(EVT VT) const override;
Matt Arsenault02dc7e12018-06-15 15:15:46 +0000293 SDValue splitUnaryVectorOp(SDValue Op, SelectionDAG &DAG) const;
294 SDValue splitBinaryVectorOp(SDValue Op, SelectionDAG &DAG) const;
Craig Topper5656db42014-04-29 07:57:24 +0000295 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
Matt Arsenault02dc7e12018-06-15 15:15:46 +0000296
Matt Arsenault3aef8092017-01-23 23:09:58 +0000297 void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
298 SelectionDAG &DAG) const override;
299
Craig Topper5656db42014-04-29 07:57:24 +0000300 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
301 SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const override;
Duncan P. N. Exon Smithe4f5e4f2016-06-30 22:52:52 +0000302 void AdjustInstrPostInstrSelection(MachineInstr &MI,
Craig Topper5656db42014-04-29 07:57:24 +0000303 SDNode *Node) const override;
Christian Konigf82901a2013-02-26 17:52:23 +0000304
Matt Arsenault0d0d6c22017-04-12 21:58:23 +0000305 SDNode *legalizeTargetIndependentNode(SDNode *Node, SelectionDAG &DAG) const;
Matt Arsenault485defe2014-11-05 19:01:17 +0000306
Benjamin Kramerbdc49562016-06-12 15:39:02 +0000307 MachineSDNode *wrapAddr64Rsrc(SelectionDAG &DAG, const SDLoc &DL,
308 SDValue Ptr) const;
309 MachineSDNode *buildRSRC(SelectionDAG &DAG, const SDLoc &DL, SDValue Ptr,
310 uint32_t RsrcDword1, uint64_t RsrcDword2And3) const;
Benjamin Kramer9bfb6272015-07-05 19:29:18 +0000311 std::pair<unsigned, const TargetRegisterClass *>
312 getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
313 StringRef Constraint, MVT VT) const override;
Tom Stellardb3c3bda2015-12-10 02:12:53 +0000314 ConstraintType getConstraintType(StringRef Constraint) const override;
Benjamin Kramerbdc49562016-06-12 15:39:02 +0000315 SDValue copyToM0(SelectionDAG &DAG, SDValue Chain, const SDLoc &DL,
316 SDValue V) const;
Matt Arsenault1cc47f82017-07-18 16:44:56 +0000317
318 void finalizeLowering(MachineFunction &MF) const override;
Matt Arsenault45b98182017-11-15 00:45:43 +0000319
320 void computeKnownBitsForFrameIndex(const SDValue Op,
321 KnownBits &Known,
322 const APInt &DemandedElts,
323 const SelectionDAG &DAG,
324 unsigned Depth = 0) const override;
Tom Stellard264c1712018-06-13 15:06:37 +0000325
326 bool isSDNodeSourceOfDivergence(const SDNode *N,
327 FunctionLoweringInfo *FLI, DivergenceAnalysis *DA) const override;
Matt Arsenaultf8768bf2018-08-06 21:38:27 +0000328
329 bool isCanonicalized(SelectionDAG &DAG, SDValue Op,
330 unsigned MaxDepth = 5) const;
331 bool denormalsEnabledForType(EVT VT) const;
Tom Stellard75aadc22012-12-11 21:25:42 +0000332};
333
334} // End namespace llvm
335
Benjamin Kramera7c40ef2014-08-13 16:26:38 +0000336#endif