NVPTXISelLowering.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. //===-- NVPTXISelLowering.h - NVPTX DAG Lowering Interface ------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines the interfaces that NVPTX uses to lower LLVM code into a
  10. // selection DAG.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXISELLOWERING_H
  14. #define LLVM_LIB_TARGET_NVPTX_NVPTXISELLOWERING_H
  15. #include "NVPTX.h"
  16. #include "llvm/CodeGen/SelectionDAG.h"
  17. #include "llvm/CodeGen/TargetLowering.h"
  18. namespace llvm {
  19. namespace NVPTXISD {
  20. enum NodeType : unsigned {
  21. // Start the numbering from where ISD NodeType finishes.
  22. FIRST_NUMBER = ISD::BUILTIN_OP_END,
  23. Wrapper,
  24. CALL,
  25. RET_FLAG,
  26. LOAD_PARAM,
  27. DeclareParam,
  28. DeclareScalarParam,
  29. DeclareRetParam,
  30. DeclareRet,
  31. DeclareScalarRet,
  32. PrintCall,
  33. PrintConvergentCall,
  34. PrintCallUni,
  35. PrintConvergentCallUni,
  36. CallArgBegin,
  37. CallArg,
  38. LastCallArg,
  39. CallArgEnd,
  40. CallVoid,
  41. CallVal,
  42. CallSymbol,
  43. Prototype,
  44. MoveParam,
  45. PseudoUseParam,
  46. RETURN,
  47. CallSeqBegin,
  48. CallSeqEnd,
  49. CallPrototype,
  50. ProxyReg,
  51. FUN_SHFL_CLAMP,
  52. FUN_SHFR_CLAMP,
  53. MUL_WIDE_SIGNED,
  54. MUL_WIDE_UNSIGNED,
  55. IMAD,
  56. SETP_F16X2,
  57. Dummy,
  58. LoadV2 = ISD::FIRST_TARGET_MEMORY_OPCODE,
  59. LoadV4,
  60. LDGV2, // LDG.v2
  61. LDGV4, // LDG.v4
  62. LDUV2, // LDU.v2
  63. LDUV4, // LDU.v4
  64. StoreV2,
  65. StoreV4,
  66. LoadParam,
  67. LoadParamV2,
  68. LoadParamV4,
  69. StoreParam,
  70. StoreParamV2,
  71. StoreParamV4,
  72. StoreParamS32, // to sext and store a <32bit value, not used currently
  73. StoreParamU32, // to zext and store a <32bit value, not used currently
  74. StoreRetval,
  75. StoreRetvalV2,
  76. StoreRetvalV4,
  77. // Texture intrinsics
  78. Tex1DFloatS32,
  79. Tex1DFloatFloat,
  80. Tex1DFloatFloatLevel,
  81. Tex1DFloatFloatGrad,
  82. Tex1DS32S32,
  83. Tex1DS32Float,
  84. Tex1DS32FloatLevel,
  85. Tex1DS32FloatGrad,
  86. Tex1DU32S32,
  87. Tex1DU32Float,
  88. Tex1DU32FloatLevel,
  89. Tex1DU32FloatGrad,
  90. Tex1DArrayFloatS32,
  91. Tex1DArrayFloatFloat,
  92. Tex1DArrayFloatFloatLevel,
  93. Tex1DArrayFloatFloatGrad,
  94. Tex1DArrayS32S32,
  95. Tex1DArrayS32Float,
  96. Tex1DArrayS32FloatLevel,
  97. Tex1DArrayS32FloatGrad,
  98. Tex1DArrayU32S32,
  99. Tex1DArrayU32Float,
  100. Tex1DArrayU32FloatLevel,
  101. Tex1DArrayU32FloatGrad,
  102. Tex2DFloatS32,
  103. Tex2DFloatFloat,
  104. Tex2DFloatFloatLevel,
  105. Tex2DFloatFloatGrad,
  106. Tex2DS32S32,
  107. Tex2DS32Float,
  108. Tex2DS32FloatLevel,
  109. Tex2DS32FloatGrad,
  110. Tex2DU32S32,
  111. Tex2DU32Float,
  112. Tex2DU32FloatLevel,
  113. Tex2DU32FloatGrad,
  114. Tex2DArrayFloatS32,
  115. Tex2DArrayFloatFloat,
  116. Tex2DArrayFloatFloatLevel,
  117. Tex2DArrayFloatFloatGrad,
  118. Tex2DArrayS32S32,
  119. Tex2DArrayS32Float,
  120. Tex2DArrayS32FloatLevel,
  121. Tex2DArrayS32FloatGrad,
  122. Tex2DArrayU32S32,
  123. Tex2DArrayU32Float,
  124. Tex2DArrayU32FloatLevel,
  125. Tex2DArrayU32FloatGrad,
  126. Tex3DFloatS32,
  127. Tex3DFloatFloat,
  128. Tex3DFloatFloatLevel,
  129. Tex3DFloatFloatGrad,
  130. Tex3DS32S32,
  131. Tex3DS32Float,
  132. Tex3DS32FloatLevel,
  133. Tex3DS32FloatGrad,
  134. Tex3DU32S32,
  135. Tex3DU32Float,
  136. Tex3DU32FloatLevel,
  137. Tex3DU32FloatGrad,
  138. TexCubeFloatFloat,
  139. TexCubeFloatFloatLevel,
  140. TexCubeS32Float,
  141. TexCubeS32FloatLevel,
  142. TexCubeU32Float,
  143. TexCubeU32FloatLevel,
  144. TexCubeArrayFloatFloat,
  145. TexCubeArrayFloatFloatLevel,
  146. TexCubeArrayS32Float,
  147. TexCubeArrayS32FloatLevel,
  148. TexCubeArrayU32Float,
  149. TexCubeArrayU32FloatLevel,
  150. Tld4R2DFloatFloat,
  151. Tld4G2DFloatFloat,
  152. Tld4B2DFloatFloat,
  153. Tld4A2DFloatFloat,
  154. Tld4R2DS64Float,
  155. Tld4G2DS64Float,
  156. Tld4B2DS64Float,
  157. Tld4A2DS64Float,
  158. Tld4R2DU64Float,
  159. Tld4G2DU64Float,
  160. Tld4B2DU64Float,
  161. Tld4A2DU64Float,
  162. TexUnified1DFloatS32,
  163. TexUnified1DFloatFloat,
  164. TexUnified1DFloatFloatLevel,
  165. TexUnified1DFloatFloatGrad,
  166. TexUnified1DS32S32,
  167. TexUnified1DS32Float,
  168. TexUnified1DS32FloatLevel,
  169. TexUnified1DS32FloatGrad,
  170. TexUnified1DU32S32,
  171. TexUnified1DU32Float,
  172. TexUnified1DU32FloatLevel,
  173. TexUnified1DU32FloatGrad,
  174. TexUnified1DArrayFloatS32,
  175. TexUnified1DArrayFloatFloat,
  176. TexUnified1DArrayFloatFloatLevel,
  177. TexUnified1DArrayFloatFloatGrad,
  178. TexUnified1DArrayS32S32,
  179. TexUnified1DArrayS32Float,
  180. TexUnified1DArrayS32FloatLevel,
  181. TexUnified1DArrayS32FloatGrad,
  182. TexUnified1DArrayU32S32,
  183. TexUnified1DArrayU32Float,
  184. TexUnified1DArrayU32FloatLevel,
  185. TexUnified1DArrayU32FloatGrad,
  186. TexUnified2DFloatS32,
  187. TexUnified2DFloatFloat,
  188. TexUnified2DFloatFloatLevel,
  189. TexUnified2DFloatFloatGrad,
  190. TexUnified2DS32S32,
  191. TexUnified2DS32Float,
  192. TexUnified2DS32FloatLevel,
  193. TexUnified2DS32FloatGrad,
  194. TexUnified2DU32S32,
  195. TexUnified2DU32Float,
  196. TexUnified2DU32FloatLevel,
  197. TexUnified2DU32FloatGrad,
  198. TexUnified2DArrayFloatS32,
  199. TexUnified2DArrayFloatFloat,
  200. TexUnified2DArrayFloatFloatLevel,
  201. TexUnified2DArrayFloatFloatGrad,
  202. TexUnified2DArrayS32S32,
  203. TexUnified2DArrayS32Float,
  204. TexUnified2DArrayS32FloatLevel,
  205. TexUnified2DArrayS32FloatGrad,
  206. TexUnified2DArrayU32S32,
  207. TexUnified2DArrayU32Float,
  208. TexUnified2DArrayU32FloatLevel,
  209. TexUnified2DArrayU32FloatGrad,
  210. TexUnified3DFloatS32,
  211. TexUnified3DFloatFloat,
  212. TexUnified3DFloatFloatLevel,
  213. TexUnified3DFloatFloatGrad,
  214. TexUnified3DS32S32,
  215. TexUnified3DS32Float,
  216. TexUnified3DS32FloatLevel,
  217. TexUnified3DS32FloatGrad,
  218. TexUnified3DU32S32,
  219. TexUnified3DU32Float,
  220. TexUnified3DU32FloatLevel,
  221. TexUnified3DU32FloatGrad,
  222. TexUnifiedCubeFloatFloat,
  223. TexUnifiedCubeFloatFloatLevel,
  224. TexUnifiedCubeS32Float,
  225. TexUnifiedCubeS32FloatLevel,
  226. TexUnifiedCubeU32Float,
  227. TexUnifiedCubeU32FloatLevel,
  228. TexUnifiedCubeArrayFloatFloat,
  229. TexUnifiedCubeArrayFloatFloatLevel,
  230. TexUnifiedCubeArrayS32Float,
  231. TexUnifiedCubeArrayS32FloatLevel,
  232. TexUnifiedCubeArrayU32Float,
  233. TexUnifiedCubeArrayU32FloatLevel,
  234. Tld4UnifiedR2DFloatFloat,
  235. Tld4UnifiedG2DFloatFloat,
  236. Tld4UnifiedB2DFloatFloat,
  237. Tld4UnifiedA2DFloatFloat,
  238. Tld4UnifiedR2DS64Float,
  239. Tld4UnifiedG2DS64Float,
  240. Tld4UnifiedB2DS64Float,
  241. Tld4UnifiedA2DS64Float,
  242. Tld4UnifiedR2DU64Float,
  243. Tld4UnifiedG2DU64Float,
  244. Tld4UnifiedB2DU64Float,
  245. Tld4UnifiedA2DU64Float,
  246. // Surface intrinsics
  247. Suld1DI8Clamp,
  248. Suld1DI16Clamp,
  249. Suld1DI32Clamp,
  250. Suld1DI64Clamp,
  251. Suld1DV2I8Clamp,
  252. Suld1DV2I16Clamp,
  253. Suld1DV2I32Clamp,
  254. Suld1DV2I64Clamp,
  255. Suld1DV4I8Clamp,
  256. Suld1DV4I16Clamp,
  257. Suld1DV4I32Clamp,
  258. Suld1DArrayI8Clamp,
  259. Suld1DArrayI16Clamp,
  260. Suld1DArrayI32Clamp,
  261. Suld1DArrayI64Clamp,
  262. Suld1DArrayV2I8Clamp,
  263. Suld1DArrayV2I16Clamp,
  264. Suld1DArrayV2I32Clamp,
  265. Suld1DArrayV2I64Clamp,
  266. Suld1DArrayV4I8Clamp,
  267. Suld1DArrayV4I16Clamp,
  268. Suld1DArrayV4I32Clamp,
  269. Suld2DI8Clamp,
  270. Suld2DI16Clamp,
  271. Suld2DI32Clamp,
  272. Suld2DI64Clamp,
  273. Suld2DV2I8Clamp,
  274. Suld2DV2I16Clamp,
  275. Suld2DV2I32Clamp,
  276. Suld2DV2I64Clamp,
  277. Suld2DV4I8Clamp,
  278. Suld2DV4I16Clamp,
  279. Suld2DV4I32Clamp,
  280. Suld2DArrayI8Clamp,
  281. Suld2DArrayI16Clamp,
  282. Suld2DArrayI32Clamp,
  283. Suld2DArrayI64Clamp,
  284. Suld2DArrayV2I8Clamp,
  285. Suld2DArrayV2I16Clamp,
  286. Suld2DArrayV2I32Clamp,
  287. Suld2DArrayV2I64Clamp,
  288. Suld2DArrayV4I8Clamp,
  289. Suld2DArrayV4I16Clamp,
  290. Suld2DArrayV4I32Clamp,
  291. Suld3DI8Clamp,
  292. Suld3DI16Clamp,
  293. Suld3DI32Clamp,
  294. Suld3DI64Clamp,
  295. Suld3DV2I8Clamp,
  296. Suld3DV2I16Clamp,
  297. Suld3DV2I32Clamp,
  298. Suld3DV2I64Clamp,
  299. Suld3DV4I8Clamp,
  300. Suld3DV4I16Clamp,
  301. Suld3DV4I32Clamp,
  302. Suld1DI8Trap,
  303. Suld1DI16Trap,
  304. Suld1DI32Trap,
  305. Suld1DI64Trap,
  306. Suld1DV2I8Trap,
  307. Suld1DV2I16Trap,
  308. Suld1DV2I32Trap,
  309. Suld1DV2I64Trap,
  310. Suld1DV4I8Trap,
  311. Suld1DV4I16Trap,
  312. Suld1DV4I32Trap,
  313. Suld1DArrayI8Trap,
  314. Suld1DArrayI16Trap,
  315. Suld1DArrayI32Trap,
  316. Suld1DArrayI64Trap,
  317. Suld1DArrayV2I8Trap,
  318. Suld1DArrayV2I16Trap,
  319. Suld1DArrayV2I32Trap,
  320. Suld1DArrayV2I64Trap,
  321. Suld1DArrayV4I8Trap,
  322. Suld1DArrayV4I16Trap,
  323. Suld1DArrayV4I32Trap,
  324. Suld2DI8Trap,
  325. Suld2DI16Trap,
  326. Suld2DI32Trap,
  327. Suld2DI64Trap,
  328. Suld2DV2I8Trap,
  329. Suld2DV2I16Trap,
  330. Suld2DV2I32Trap,
  331. Suld2DV2I64Trap,
  332. Suld2DV4I8Trap,
  333. Suld2DV4I16Trap,
  334. Suld2DV4I32Trap,
  335. Suld2DArrayI8Trap,
  336. Suld2DArrayI16Trap,
  337. Suld2DArrayI32Trap,
  338. Suld2DArrayI64Trap,
  339. Suld2DArrayV2I8Trap,
  340. Suld2DArrayV2I16Trap,
  341. Suld2DArrayV2I32Trap,
  342. Suld2DArrayV2I64Trap,
  343. Suld2DArrayV4I8Trap,
  344. Suld2DArrayV4I16Trap,
  345. Suld2DArrayV4I32Trap,
  346. Suld3DI8Trap,
  347. Suld3DI16Trap,
  348. Suld3DI32Trap,
  349. Suld3DI64Trap,
  350. Suld3DV2I8Trap,
  351. Suld3DV2I16Trap,
  352. Suld3DV2I32Trap,
  353. Suld3DV2I64Trap,
  354. Suld3DV4I8Trap,
  355. Suld3DV4I16Trap,
  356. Suld3DV4I32Trap,
  357. Suld1DI8Zero,
  358. Suld1DI16Zero,
  359. Suld1DI32Zero,
  360. Suld1DI64Zero,
  361. Suld1DV2I8Zero,
  362. Suld1DV2I16Zero,
  363. Suld1DV2I32Zero,
  364. Suld1DV2I64Zero,
  365. Suld1DV4I8Zero,
  366. Suld1DV4I16Zero,
  367. Suld1DV4I32Zero,
  368. Suld1DArrayI8Zero,
  369. Suld1DArrayI16Zero,
  370. Suld1DArrayI32Zero,
  371. Suld1DArrayI64Zero,
  372. Suld1DArrayV2I8Zero,
  373. Suld1DArrayV2I16Zero,
  374. Suld1DArrayV2I32Zero,
  375. Suld1DArrayV2I64Zero,
  376. Suld1DArrayV4I8Zero,
  377. Suld1DArrayV4I16Zero,
  378. Suld1DArrayV4I32Zero,
  379. Suld2DI8Zero,
  380. Suld2DI16Zero,
  381. Suld2DI32Zero,
  382. Suld2DI64Zero,
  383. Suld2DV2I8Zero,
  384. Suld2DV2I16Zero,
  385. Suld2DV2I32Zero,
  386. Suld2DV2I64Zero,
  387. Suld2DV4I8Zero,
  388. Suld2DV4I16Zero,
  389. Suld2DV4I32Zero,
  390. Suld2DArrayI8Zero,
  391. Suld2DArrayI16Zero,
  392. Suld2DArrayI32Zero,
  393. Suld2DArrayI64Zero,
  394. Suld2DArrayV2I8Zero,
  395. Suld2DArrayV2I16Zero,
  396. Suld2DArrayV2I32Zero,
  397. Suld2DArrayV2I64Zero,
  398. Suld2DArrayV4I8Zero,
  399. Suld2DArrayV4I16Zero,
  400. Suld2DArrayV4I32Zero,
  401. Suld3DI8Zero,
  402. Suld3DI16Zero,
  403. Suld3DI32Zero,
  404. Suld3DI64Zero,
  405. Suld3DV2I8Zero,
  406. Suld3DV2I16Zero,
  407. Suld3DV2I32Zero,
  408. Suld3DV2I64Zero,
  409. Suld3DV4I8Zero,
  410. Suld3DV4I16Zero,
  411. Suld3DV4I32Zero
  412. };
  413. }
  414. class NVPTXSubtarget;
  415. //===--------------------------------------------------------------------===//
  416. // TargetLowering Implementation
  417. //===--------------------------------------------------------------------===//
  418. class NVPTXTargetLowering : public TargetLowering {
  419. public:
  420. explicit NVPTXTargetLowering(const NVPTXTargetMachine &TM,
  421. const NVPTXSubtarget &STI);
  422. SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
  423. SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
  424. const char *getTargetNodeName(unsigned Opcode) const override;
  425. bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallInst &I,
  426. MachineFunction &MF,
  427. unsigned Intrinsic) const override;
  428. /// isLegalAddressingMode - Return true if the addressing mode represented
  429. /// by AM is legal for this target, for a load/store of the specified type
  430. /// Used to guide target specific optimizations, like loop strength
  431. /// reduction (LoopStrengthReduce.cpp) and memory optimization for
  432. /// address mode (CodeGenPrepare.cpp)
  433. bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty,
  434. unsigned AS,
  435. Instruction *I = nullptr) const override;
  436. bool isTruncateFree(Type *SrcTy, Type *DstTy) const override {
  437. // Truncating 64-bit to 32-bit is free in SASS.
  438. if (!SrcTy->isIntegerTy() || !DstTy->isIntegerTy())
  439. return false;
  440. return SrcTy->getPrimitiveSizeInBits() == 64 &&
  441. DstTy->getPrimitiveSizeInBits() == 32;
  442. }
  443. EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Ctx,
  444. EVT VT) const override {
  445. if (VT.isVector())
  446. return EVT::getVectorVT(Ctx, MVT::i1, VT.getVectorNumElements());
  447. return MVT::i1;
  448. }
  449. ConstraintType getConstraintType(StringRef Constraint) const override;
  450. std::pair<unsigned, const TargetRegisterClass *>
  451. getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
  452. StringRef Constraint, MVT VT) const override;
  453. SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
  454. bool isVarArg,
  455. const SmallVectorImpl<ISD::InputArg> &Ins,
  456. const SDLoc &dl, SelectionDAG &DAG,
  457. SmallVectorImpl<SDValue> &InVals) const override;
  458. SDValue LowerCall(CallLoweringInfo &CLI,
  459. SmallVectorImpl<SDValue> &InVals) const override;
  460. std::string getPrototype(const DataLayout &DL, Type *, const ArgListTy &,
  461. const SmallVectorImpl<ISD::OutputArg> &,
  462. MaybeAlign retAlignment, const CallBase &CB,
  463. unsigned UniqueCallSite) const;
  464. SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
  465. const SmallVectorImpl<ISD::OutputArg> &Outs,
  466. const SmallVectorImpl<SDValue> &OutVals, const SDLoc &dl,
  467. SelectionDAG &DAG) const override;
  468. void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint,
  469. std::vector<SDValue> &Ops,
  470. SelectionDAG &DAG) const override;
  471. const NVPTXTargetMachine *nvTM;
  472. // PTX always uses 32-bit shift amounts
  473. MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override {
  474. return MVT::i32;
  475. }
  476. TargetLoweringBase::LegalizeTypeAction
  477. getPreferredVectorAction(MVT VT) const override;
  478. // Get the degree of precision we want from 32-bit floating point division
  479. // operations.
  480. //
  481. // 0 - Use ptx div.approx
  482. // 1 - Use ptx.div.full (approximate, but less so than div.approx)
  483. // 2 - Use IEEE-compliant div instructions, if available.
  484. int getDivF32Level() const;
  485. // Get whether we should use a precise or approximate 32-bit floating point
  486. // sqrt instruction.
  487. bool usePrecSqrtF32() const;
  488. // Get whether we should use instructions that flush floating-point denormals
  489. // to sign-preserving zero.
  490. bool useF32FTZ(const MachineFunction &MF) const;
  491. SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled,
  492. int &ExtraSteps, bool &UseOneConst,
  493. bool Reciprocal) const override;
  494. unsigned combineRepeatedFPDivisors() const override { return 2; }
  495. bool allowFMA(MachineFunction &MF, CodeGenOpt::Level OptLevel) const;
  496. bool allowUnsafeFPMath(MachineFunction &MF) const;
  497. bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
  498. EVT) const override {
  499. return true;
  500. }
  501. bool enableAggressiveFMAFusion(EVT VT) const override { return true; }
  502. // The default is to transform llvm.ctlz(x, false) (where false indicates that
  503. // x == 0 is not undefined behavior) into a branch that checks whether x is 0
  504. // and avoids calling ctlz in that case. We have a dedicated ctlz
  505. // instruction, so we say that ctlz is cheap to speculate.
  506. bool isCheapToSpeculateCtlz() const override { return true; }
  507. private:
  508. const NVPTXSubtarget &STI; // cache the subtarget here
  509. SDValue getParamSymbol(SelectionDAG &DAG, int idx, EVT) const;
  510. SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
  511. SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const;
  512. SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
  513. SDValue LowerFROUND(SDValue Op, SelectionDAG &DAG) const;
  514. SDValue LowerFROUND32(SDValue Op, SelectionDAG &DAG) const;
  515. SDValue LowerFROUND64(SDValue Op, SelectionDAG &DAG) const;
  516. SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG) const;
  517. SDValue LowerLOADi1(SDValue Op, SelectionDAG &DAG) const;
  518. SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG) const;
  519. SDValue LowerSTOREi1(SDValue Op, SelectionDAG &DAG) const;
  520. SDValue LowerSTOREVector(SDValue Op, SelectionDAG &DAG) const;
  521. SDValue LowerShiftRightParts(SDValue Op, SelectionDAG &DAG) const;
  522. SDValue LowerShiftLeftParts(SDValue Op, SelectionDAG &DAG) const;
  523. SDValue LowerSelect(SDValue Op, SelectionDAG &DAG) const;
  524. void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
  525. SelectionDAG &DAG) const override;
  526. SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
  527. Align getArgumentAlignment(SDValue Callee, const CallBase *CB, Type *Ty,
  528. unsigned Idx, const DataLayout &DL) const;
  529. };
  530. } // namespace llvm
  531. #endif