LowerMemIntrinsics.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/Transforms/Utils/LowerMemIntrinsics.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. // Lower memset, memcpy, memmov intrinsics to loops (e.g. for targets without
  15. // library support).
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
  19. #define LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
  20. namespace llvm {
  21. class ConstantInt;
  22. class Instruction;
  23. class MemCpyInst;
  24. class MemMoveInst;
  25. class MemSetInst;
  26. class TargetTransformInfo;
  27. class Value;
  28. struct Align;
  29. /// Emit a loop implementing the semantics of llvm.memcpy where the size is not
  30. /// a compile-time constant. Loop will be insterted at \p InsertBefore.
  31. void createMemCpyLoopUnknownSize(Instruction *InsertBefore, Value *SrcAddr,
  32. Value *DstAddr, Value *CopyLen,
  33. Align SrcAlign, Align DestAlign,
  34. bool SrcIsVolatile, bool DstIsVolatile,
  35. const TargetTransformInfo &TTI);
  36. /// Emit a loop implementing the semantics of an llvm.memcpy whose size is a
  37. /// compile time constant. Loop is inserted at \p InsertBefore.
  38. void createMemCpyLoopKnownSize(Instruction *InsertBefore, Value *SrcAddr,
  39. Value *DstAddr, ConstantInt *CopyLen,
  40. Align SrcAlign, Align DestAlign,
  41. bool SrcIsVolatile, bool DstIsVolatile,
  42. const TargetTransformInfo &TTI);
  43. /// Expand \p MemCpy as a loop. \p MemCpy is not deleted.
  44. void expandMemCpyAsLoop(MemCpyInst *MemCpy, const TargetTransformInfo &TTI);
  45. /// Expand \p MemMove as a loop. \p MemMove is not deleted.
  46. void expandMemMoveAsLoop(MemMoveInst *MemMove);
  47. /// Expand \p MemSet as a loop. \p MemSet is not deleted.
  48. void expandMemSetAsLoop(MemSetInst *MemSet);
  49. } // End llvm namespace
  50. #endif
  51. #ifdef __GNUC__
  52. #pragma GCC diagnostic pop
  53. #endif