[ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.
[llvm-core.git] / include / llvm / Transforms / Utils / LowerMemIntrinsics.h
blob8e9d7b522c78b282ffa5c73036bf7e3221083a49
1 //===- llvm/Transforms/Utils/LowerMemIntrinsics.h ---------------*- 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 // Lower memset, memcpy, memmov intrinsics to loops (e.g. for targets without
10 // library support).
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
15 #define LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
17 namespace llvm {
19 class ConstantInt;
20 class Instruction;
21 class MemCpyInst;
22 class MemMoveInst;
23 class MemSetInst;
24 class TargetTransformInfo;
25 class Value;
27 /// Emit a loop implementing the semantics of llvm.memcpy where the size is not
28 /// a compile-time constant. Loop will be insterted at \p InsertBefore.
29 void createMemCpyLoopUnknownSize(Instruction *InsertBefore, Value *SrcAddr,
30 Value *DstAddr, Value *CopyLen,
31 unsigned SrcAlign, unsigned DestAlign,
32 bool SrcIsVolatile, bool DstIsVolatile,
33 const TargetTransformInfo &TTI);
35 /// Emit a loop implementing the semantics of an llvm.memcpy whose size is a
36 /// compile time constant. Loop is inserted at \p InsertBefore.
37 void createMemCpyLoopKnownSize(Instruction *InsertBefore, Value *SrcAddr,
38 Value *DstAddr, ConstantInt *CopyLen,
39 unsigned SrcAlign, unsigned DestAlign,
40 bool SrcIsVolatile, bool DstIsVolatile,
41 const TargetTransformInfo &TTI);
44 /// Expand \p MemCpy as a loop. \p MemCpy is not deleted.
45 void expandMemCpyAsLoop(MemCpyInst *MemCpy, const TargetTransformInfo &TTI);
47 /// Expand \p MemMove as a loop. \p MemMove is not deleted.
48 void expandMemMoveAsLoop(MemMoveInst *MemMove);
50 /// Expand \p MemSet as a loop. \p MemSet is not deleted.
51 void expandMemSetAsLoop(MemSetInst *MemSet);
53 } // End llvm namespace
55 #endif