LegalizerHelper.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //== llvm/CodeGen/GlobalISel/LegalizerHelper.h ---------------- -*- C++ -*-==//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. /// \file A pass to convert the target-illegal operations created by IR -> MIR
  15. /// translation into ones the target expects to be able to select. This may
  16. /// occur in multiple phases, for example G_ADD <2 x i8> -> G_ADD <2 x i16> ->
  17. /// G_ADD <4 x i16>.
  18. ///
  19. /// The LegalizerHelper class is where most of the work happens, and is
  20. /// designed to be callable from other passes that find themselves with an
  21. /// illegal instruction.
  22. //
  23. //===----------------------------------------------------------------------===//
  24. #ifndef LLVM_CODEGEN_GLOBALISEL_LEGALIZERHELPER_H
  25. #define LLVM_CODEGEN_GLOBALISEL_LEGALIZERHELPER_H
  26. #include "llvm/CodeGen/GlobalISel/CallLowering.h"
  27. #include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
  28. #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
  29. #include "llvm/CodeGen/LowLevelType.h"
  30. #include "llvm/CodeGen/MachineFunctionPass.h"
  31. #include "llvm/CodeGen/RuntimeLibcalls.h"
  32. namespace llvm {
  33. // Forward declarations.
  34. class LegalizerInfo;
  35. class MachineRegisterInfo;
  36. class GISelChangeObserver;
  37. class LostDebugLocObserver;
  38. class TargetLowering;
  39. class LegalizerHelper {
  40. public:
  41. /// Expose MIRBuilder so clients can set their own RecordInsertInstruction
  42. /// functions
  43. MachineIRBuilder &MIRBuilder;
  44. /// To keep track of changes made by the LegalizerHelper.
  45. GISelChangeObserver &Observer;
  46. private:
  47. MachineRegisterInfo &MRI;
  48. const LegalizerInfo &LI;
  49. const TargetLowering &TLI;
  50. public:
  51. enum LegalizeResult {
  52. /// Instruction was already legal and no change was made to the
  53. /// MachineFunction.
  54. AlreadyLegal,
  55. /// Instruction has been legalized and the MachineFunction changed.
  56. Legalized,
  57. /// Some kind of error has occurred and we could not legalize this
  58. /// instruction.
  59. UnableToLegalize,
  60. };
  61. /// Expose LegalizerInfo so the clients can re-use.
  62. const LegalizerInfo &getLegalizerInfo() const { return LI; }
  63. const TargetLowering &getTargetLowering() const { return TLI; }
  64. LegalizerHelper(MachineFunction &MF, GISelChangeObserver &Observer,
  65. MachineIRBuilder &B);
  66. LegalizerHelper(MachineFunction &MF, const LegalizerInfo &LI,
  67. GISelChangeObserver &Observer, MachineIRBuilder &B);
  68. /// Replace \p MI by a sequence of legal instructions that can implement the
  69. /// same operation. Note that this means \p MI may be deleted, so any iterator
  70. /// steps should be performed before calling this function. \p Helper should
  71. /// be initialized to the MachineFunction containing \p MI.
  72. ///
  73. /// Considered as an opaque blob, the legal code will use and define the same
  74. /// registers as \p MI.
  75. LegalizeResult legalizeInstrStep(MachineInstr &MI,
  76. LostDebugLocObserver &LocObserver);
  77. /// Legalize an instruction by emiting a runtime library call instead.
  78. LegalizeResult libcall(MachineInstr &MI, LostDebugLocObserver &LocObserver);
  79. /// Legalize an instruction by reducing the width of the underlying scalar
  80. /// type.
  81. LegalizeResult narrowScalar(MachineInstr &MI, unsigned TypeIdx, LLT NarrowTy);
  82. /// Legalize an instruction by performing the operation on a wider scalar type
  83. /// (for example a 16-bit addition can be safely performed at 32-bits
  84. /// precision, ignoring the unused bits).
  85. LegalizeResult widenScalar(MachineInstr &MI, unsigned TypeIdx, LLT WideTy);
  86. /// Legalize an instruction by replacing the value type
  87. LegalizeResult bitcast(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  88. /// Legalize an instruction by splitting it into simpler parts, hopefully
  89. /// understood by the target.
  90. LegalizeResult lower(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  91. /// Legalize a vector instruction by splitting into multiple components, each
  92. /// acting on the same scalar type as the original but with fewer elements.
  93. LegalizeResult fewerElementsVector(MachineInstr &MI, unsigned TypeIdx,
  94. LLT NarrowTy);
  95. /// Legalize a vector instruction by increasing the number of vector elements
  96. /// involved and ignoring the added elements later.
  97. LegalizeResult moreElementsVector(MachineInstr &MI, unsigned TypeIdx,
  98. LLT MoreTy);
  99. /// Cast the given value to an LLT::scalar with an equivalent size. Returns
  100. /// the register to use if an instruction was inserted. Returns the original
  101. /// register if no coercion was necessary.
  102. //
  103. // This may also fail and return Register() if there is no legal way to cast.
  104. Register coerceToScalar(Register Val);
  105. /// Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  106. /// Use by extending the operand's type to \p WideTy using the specified \p
  107. /// ExtOpcode for the extension instruction, and replacing the vreg of the
  108. /// operand in place.
  109. void widenScalarSrc(MachineInstr &MI, LLT WideTy, unsigned OpIdx,
  110. unsigned ExtOpcode);
  111. /// Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  112. /// Use by truncating the operand's type to \p NarrowTy using G_TRUNC, and
  113. /// replacing the vreg of the operand in place.
  114. void narrowScalarSrc(MachineInstr &MI, LLT NarrowTy, unsigned OpIdx);
  115. /// Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  116. /// Def by extending the operand's type to \p WideTy and truncating it back
  117. /// with the \p TruncOpcode, and replacing the vreg of the operand in place.
  118. void widenScalarDst(MachineInstr &MI, LLT WideTy, unsigned OpIdx = 0,
  119. unsigned TruncOpcode = TargetOpcode::G_TRUNC);
  120. // Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  121. // Def by truncating the operand's type to \p NarrowTy, replacing in place and
  122. // extending back with \p ExtOpcode.
  123. void narrowScalarDst(MachineInstr &MI, LLT NarrowTy, unsigned OpIdx,
  124. unsigned ExtOpcode);
  125. /// Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  126. /// Def by performing it with additional vector elements and extracting the
  127. /// result elements, and replacing the vreg of the operand in place.
  128. void moreElementsVectorDst(MachineInstr &MI, LLT MoreTy, unsigned OpIdx);
  129. /// Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  130. /// Use by producing a vector with undefined high elements, extracting the
  131. /// original vector type, and replacing the vreg of the operand in place.
  132. void moreElementsVectorSrc(MachineInstr &MI, LLT MoreTy, unsigned OpIdx);
  133. /// Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  134. /// use by inserting a G_BITCAST to \p CastTy
  135. void bitcastSrc(MachineInstr &MI, LLT CastTy, unsigned OpIdx);
  136. /// Legalize a single operand \p OpIdx of the machine instruction \p MI as a
  137. /// def by inserting a G_BITCAST from \p CastTy
  138. void bitcastDst(MachineInstr &MI, LLT CastTy, unsigned OpIdx);
  139. /// Widen \p OrigReg to \p WideTy by merging to a wider type, padding with
  140. /// G_IMPLICIT_DEF, and producing dead results.
  141. Register widenWithUnmerge(LLT WideTy, Register OrigReg);
  142. private:
  143. LegalizeResult
  144. widenScalarMergeValues(MachineInstr &MI, unsigned TypeIdx, LLT WideTy);
  145. LegalizeResult
  146. widenScalarUnmergeValues(MachineInstr &MI, unsigned TypeIdx, LLT WideTy);
  147. LegalizeResult
  148. widenScalarExtract(MachineInstr &MI, unsigned TypeIdx, LLT WideTy);
  149. LegalizeResult
  150. widenScalarInsert(MachineInstr &MI, unsigned TypeIdx, LLT WideTy);
  151. LegalizeResult widenScalarAddSubOverflow(MachineInstr &MI, unsigned TypeIdx,
  152. LLT WideTy);
  153. LegalizeResult widenScalarAddSubShlSat(MachineInstr &MI, unsigned TypeIdx,
  154. LLT WideTy);
  155. LegalizeResult widenScalarMulo(MachineInstr &MI, unsigned TypeIdx,
  156. LLT WideTy);
  157. /// Helper function to split a wide generic register into bitwise blocks with
  158. /// the given Type (which implies the number of blocks needed). The generic
  159. /// registers created are appended to Ops, starting at bit 0 of Reg.
  160. void extractParts(Register Reg, LLT Ty, int NumParts,
  161. SmallVectorImpl<Register> &VRegs);
  162. /// Version which handles irregular splits.
  163. bool extractParts(Register Reg, LLT RegTy, LLT MainTy,
  164. LLT &LeftoverTy,
  165. SmallVectorImpl<Register> &VRegs,
  166. SmallVectorImpl<Register> &LeftoverVRegs);
  167. /// Version which handles irregular sub-vector splits.
  168. void extractVectorParts(Register Reg, unsigned NumElst,
  169. SmallVectorImpl<Register> &VRegs);
  170. /// Helper function to build a wide generic register \p DstReg of type \p
  171. /// RegTy from smaller parts. This will produce a G_MERGE_VALUES,
  172. /// G_BUILD_VECTOR, G_CONCAT_VECTORS, or sequence of G_INSERT as appropriate
  173. /// for the types.
  174. ///
  175. /// \p PartRegs must be registers of type \p PartTy.
  176. ///
  177. /// If \p ResultTy does not evenly break into \p PartTy sized pieces, the
  178. /// remainder must be specified with \p LeftoverRegs of type \p LeftoverTy.
  179. void insertParts(Register DstReg, LLT ResultTy,
  180. LLT PartTy, ArrayRef<Register> PartRegs,
  181. LLT LeftoverTy = LLT(), ArrayRef<Register> LeftoverRegs = {});
  182. /// Merge \p PartRegs with different types into \p DstReg.
  183. void mergeMixedSubvectors(Register DstReg, ArrayRef<Register> PartRegs);
  184. void appendVectorElts(SmallVectorImpl<Register> &Elts, Register Reg);
  185. /// Unmerge \p SrcReg into smaller sized values, and append them to \p
  186. /// Parts. The elements of \p Parts will be the greatest common divisor type
  187. /// of \p DstTy, \p NarrowTy and the type of \p SrcReg. This will compute and
  188. /// return the GCD type.
  189. LLT extractGCDType(SmallVectorImpl<Register> &Parts, LLT DstTy,
  190. LLT NarrowTy, Register SrcReg);
  191. /// Unmerge \p SrcReg into \p GCDTy typed registers. This will append all of
  192. /// the unpacked registers to \p Parts. This version is if the common unmerge
  193. /// type is already known.
  194. void extractGCDType(SmallVectorImpl<Register> &Parts, LLT GCDTy,
  195. Register SrcReg);
  196. /// Produce a merge of values in \p VRegs to define \p DstReg. Perform a merge
  197. /// from the least common multiple type, and convert as appropriate to \p
  198. /// DstReg.
  199. ///
  200. /// \p VRegs should each have type \p GCDTy. This type should be greatest
  201. /// common divisor type of \p DstReg, \p NarrowTy, and an undetermined source
  202. /// type.
  203. ///
  204. /// \p NarrowTy is the desired result merge source type. If the source value
  205. /// needs to be widened to evenly cover \p DstReg, inserts high bits
  206. /// corresponding to the extension opcode \p PadStrategy.
  207. ///
  208. /// \p VRegs will be cleared, and the the result \p NarrowTy register pieces
  209. /// will replace it. Returns The complete LCMTy that \p VRegs will cover when
  210. /// merged.
  211. LLT buildLCMMergePieces(LLT DstTy, LLT NarrowTy, LLT GCDTy,
  212. SmallVectorImpl<Register> &VRegs,
  213. unsigned PadStrategy = TargetOpcode::G_ANYEXT);
  214. /// Merge the values in \p RemergeRegs to an \p LCMTy typed value. Extract the
  215. /// low bits into \p DstReg. This is intended to use the outputs from
  216. /// buildLCMMergePieces after processing.
  217. void buildWidenedRemergeToDst(Register DstReg, LLT LCMTy,
  218. ArrayRef<Register> RemergeRegs);
  219. /// Perform generic multiplication of values held in multiple registers.
  220. /// Generated instructions use only types NarrowTy and i1.
  221. /// Destination can be same or two times size of the source.
  222. void multiplyRegisters(SmallVectorImpl<Register> &DstRegs,
  223. ArrayRef<Register> Src1Regs,
  224. ArrayRef<Register> Src2Regs, LLT NarrowTy);
  225. void changeOpcode(MachineInstr &MI, unsigned NewOpcode);
  226. LegalizeResult tryNarrowPow2Reduction(MachineInstr &MI, Register SrcReg,
  227. LLT SrcTy, LLT NarrowTy,
  228. unsigned ScalarOpc);
  229. // Memcpy family legalization helpers.
  230. LegalizeResult lowerMemset(MachineInstr &MI, Register Dst, Register Val,
  231. uint64_t KnownLen, Align Alignment,
  232. bool IsVolatile);
  233. LegalizeResult lowerMemcpyInline(MachineInstr &MI, Register Dst, Register Src,
  234. uint64_t KnownLen, Align DstAlign,
  235. Align SrcAlign, bool IsVolatile);
  236. LegalizeResult lowerMemcpy(MachineInstr &MI, Register Dst, Register Src,
  237. uint64_t KnownLen, uint64_t Limit, Align DstAlign,
  238. Align SrcAlign, bool IsVolatile);
  239. LegalizeResult lowerMemmove(MachineInstr &MI, Register Dst, Register Src,
  240. uint64_t KnownLen, Align DstAlign, Align SrcAlign,
  241. bool IsVolatile);
  242. public:
  243. /// Return the alignment to use for a stack temporary object with the given
  244. /// type.
  245. Align getStackTemporaryAlignment(LLT Type, Align MinAlign = Align()) const;
  246. /// Create a stack temporary based on the size in bytes and the alignment
  247. MachineInstrBuilder createStackTemporary(TypeSize Bytes, Align Alignment,
  248. MachinePointerInfo &PtrInfo);
  249. /// Get a pointer to vector element \p Index located in memory for a vector of
  250. /// type \p VecTy starting at a base address of \p VecPtr. If \p Index is out
  251. /// of bounds the returned pointer is unspecified, but will be within the
  252. /// vector bounds.
  253. Register getVectorElementPointer(Register VecPtr, LLT VecTy, Register Index);
  254. /// Handles most opcodes. Split \p MI into same instruction on sub-vectors or
  255. /// scalars with \p NumElts elements (1 for scalar). Supports uneven splits:
  256. /// there can be leftover sub-vector with fewer then \p NumElts or a leftover
  257. /// scalar. To avoid this use moreElements first and set MI number of elements
  258. /// to multiple of \p NumElts. Non-vector operands that should be used on all
  259. /// sub-instructions without split are listed in \p NonVecOpIndices.
  260. LegalizeResult fewerElementsVectorMultiEltType(
  261. GenericMachineInstr &MI, unsigned NumElts,
  262. std::initializer_list<unsigned> NonVecOpIndices = {});
  263. LegalizeResult fewerElementsVectorPhi(GenericMachineInstr &MI,
  264. unsigned NumElts);
  265. LegalizeResult moreElementsVectorPhi(MachineInstr &MI, unsigned TypeIdx,
  266. LLT MoreTy);
  267. LegalizeResult moreElementsVectorShuffle(MachineInstr &MI, unsigned TypeIdx,
  268. LLT MoreTy);
  269. LegalizeResult fewerElementsVectorUnmergeValues(MachineInstr &MI,
  270. unsigned TypeIdx,
  271. LLT NarrowTy);
  272. LegalizeResult fewerElementsVectorMerge(MachineInstr &MI, unsigned TypeIdx,
  273. LLT NarrowTy);
  274. LegalizeResult fewerElementsVectorExtractInsertVectorElt(MachineInstr &MI,
  275. unsigned TypeIdx,
  276. LLT NarrowTy);
  277. LegalizeResult reduceLoadStoreWidth(GLoadStore &MI, unsigned TypeIdx,
  278. LLT NarrowTy);
  279. LegalizeResult fewerElementsVectorSextInReg(MachineInstr &MI, unsigned TypeIdx,
  280. LLT NarrowTy);
  281. LegalizeResult narrowScalarShiftByConstant(MachineInstr &MI, const APInt &Amt,
  282. LLT HalfTy, LLT ShiftAmtTy);
  283. LegalizeResult fewerElementsVectorReductions(MachineInstr &MI,
  284. unsigned TypeIdx, LLT NarrowTy);
  285. LegalizeResult fewerElementsVectorShuffle(MachineInstr &MI, unsigned TypeIdx,
  286. LLT NarrowTy);
  287. LegalizeResult narrowScalarShift(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  288. LegalizeResult narrowScalarAddSub(MachineInstr &MI, unsigned TypeIdx,
  289. LLT NarrowTy);
  290. LegalizeResult narrowScalarMul(MachineInstr &MI, LLT Ty);
  291. LegalizeResult narrowScalarFPTOI(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  292. LegalizeResult narrowScalarExtract(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  293. LegalizeResult narrowScalarInsert(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  294. LegalizeResult narrowScalarBasic(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  295. LegalizeResult narrowScalarExt(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  296. LegalizeResult narrowScalarSelect(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  297. LegalizeResult narrowScalarCTLZ(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  298. LegalizeResult narrowScalarCTTZ(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  299. LegalizeResult narrowScalarCTPOP(MachineInstr &MI, unsigned TypeIdx, LLT Ty);
  300. /// Perform Bitcast legalize action on G_EXTRACT_VECTOR_ELT.
  301. LegalizeResult bitcastExtractVectorElt(MachineInstr &MI, unsigned TypeIdx,
  302. LLT CastTy);
  303. /// Perform Bitcast legalize action on G_INSERT_VECTOR_ELT.
  304. LegalizeResult bitcastInsertVectorElt(MachineInstr &MI, unsigned TypeIdx,
  305. LLT CastTy);
  306. LegalizeResult lowerBitcast(MachineInstr &MI);
  307. LegalizeResult lowerLoad(GAnyLoad &MI);
  308. LegalizeResult lowerStore(GStore &MI);
  309. LegalizeResult lowerBitCount(MachineInstr &MI);
  310. LegalizeResult lowerFunnelShiftWithInverse(MachineInstr &MI);
  311. LegalizeResult lowerFunnelShiftAsShifts(MachineInstr &MI);
  312. LegalizeResult lowerFunnelShift(MachineInstr &MI);
  313. LegalizeResult lowerRotateWithReverseRotate(MachineInstr &MI);
  314. LegalizeResult lowerRotate(MachineInstr &MI);
  315. LegalizeResult lowerU64ToF32BitOps(MachineInstr &MI);
  316. LegalizeResult lowerUITOFP(MachineInstr &MI);
  317. LegalizeResult lowerSITOFP(MachineInstr &MI);
  318. LegalizeResult lowerFPTOUI(MachineInstr &MI);
  319. LegalizeResult lowerFPTOSI(MachineInstr &MI);
  320. LegalizeResult lowerFPTRUNC_F64_TO_F16(MachineInstr &MI);
  321. LegalizeResult lowerFPTRUNC(MachineInstr &MI);
  322. LegalizeResult lowerFPOWI(MachineInstr &MI);
  323. LegalizeResult lowerMinMax(MachineInstr &MI);
  324. LegalizeResult lowerFCopySign(MachineInstr &MI);
  325. LegalizeResult lowerFMinNumMaxNum(MachineInstr &MI);
  326. LegalizeResult lowerFMad(MachineInstr &MI);
  327. LegalizeResult lowerIntrinsicRound(MachineInstr &MI);
  328. LegalizeResult lowerFFloor(MachineInstr &MI);
  329. LegalizeResult lowerMergeValues(MachineInstr &MI);
  330. LegalizeResult lowerUnmergeValues(MachineInstr &MI);
  331. LegalizeResult lowerExtractInsertVectorElt(MachineInstr &MI);
  332. LegalizeResult lowerShuffleVector(MachineInstr &MI);
  333. LegalizeResult lowerDynStackAlloc(MachineInstr &MI);
  334. LegalizeResult lowerExtract(MachineInstr &MI);
  335. LegalizeResult lowerInsert(MachineInstr &MI);
  336. LegalizeResult lowerSADDO_SSUBO(MachineInstr &MI);
  337. LegalizeResult lowerAddSubSatToMinMax(MachineInstr &MI);
  338. LegalizeResult lowerAddSubSatToAddoSubo(MachineInstr &MI);
  339. LegalizeResult lowerShlSat(MachineInstr &MI);
  340. LegalizeResult lowerBswap(MachineInstr &MI);
  341. LegalizeResult lowerBitreverse(MachineInstr &MI);
  342. LegalizeResult lowerReadWriteRegister(MachineInstr &MI);
  343. LegalizeResult lowerSMULH_UMULH(MachineInstr &MI);
  344. LegalizeResult lowerSelect(MachineInstr &MI);
  345. LegalizeResult lowerDIVREM(MachineInstr &MI);
  346. LegalizeResult lowerAbsToAddXor(MachineInstr &MI);
  347. LegalizeResult lowerAbsToMaxNeg(MachineInstr &MI);
  348. LegalizeResult lowerVectorReduction(MachineInstr &MI);
  349. LegalizeResult lowerMemcpyInline(MachineInstr &MI);
  350. LegalizeResult lowerMemCpyFamily(MachineInstr &MI, unsigned MaxLen = 0);
  351. };
  352. /// Helper function that creates a libcall to the given \p Name using the given
  353. /// calling convention \p CC.
  354. LegalizerHelper::LegalizeResult
  355. createLibcall(MachineIRBuilder &MIRBuilder, const char *Name,
  356. const CallLowering::ArgInfo &Result,
  357. ArrayRef<CallLowering::ArgInfo> Args, CallingConv::ID CC);
  358. /// Helper function that creates the given libcall.
  359. LegalizerHelper::LegalizeResult
  360. createLibcall(MachineIRBuilder &MIRBuilder, RTLIB::Libcall Libcall,
  361. const CallLowering::ArgInfo &Result,
  362. ArrayRef<CallLowering::ArgInfo> Args);
  363. /// Create a libcall to memcpy et al.
  364. LegalizerHelper::LegalizeResult
  365. createMemLibcall(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI,
  366. MachineInstr &MI, LostDebugLocObserver &LocObserver);
  367. } // End namespace llvm.
  368. #endif
  369. #ifdef __GNUC__
  370. #pragma GCC diagnostic pop
  371. #endif