Home | History | Annotate | Download | only in Utils
      1 //===- llvm/Transforms/Utils/LowerMemintrinsics.h ---------------*- 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 // Lower memset, memcpy, memmov intrinsics to loops (e.g. for targets without
     11 // library support).
     12 //
     13 //===----------------------------------------------------------------------===//
     14 
     15 #ifndef LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
     16 #define LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
     17 
     18 namespace llvm {
     19 
     20 class Instruction;
     21 class MemCpyInst;
     22 class MemMoveInst;
     23 class MemSetInst;
     24 class Value;
     25 
     26 /// Emit a loop implementing the semantics of llvm.memcpy with the equivalent
     27 /// arguments at \p InsertBefore.
     28 void createMemCpyLoop(Instruction *InsertBefore,
     29                       Value *SrcAddr, Value *DstAddr, Value *CopyLen,
     30                       unsigned SrcAlign, unsigned DestAlign,
     31                       bool SrcIsVolatile, bool DstIsVolatile);
     32 
     33 /// Expand \p MemCpy as a loop. \p MemCpy is not deleted.
     34 void expandMemCpyAsLoop(MemCpyInst *MemCpy);
     35 
     36 /// Expand \p MemMove as a loop. \p MemMove is not deleted.
     37 void expandMemMoveAsLoop(MemMoveInst *MemMove);
     38 
     39 /// Expand \p MemSet as a loop. \p MemSet is not deleted.
     40 void expandMemSetAsLoop(MemSetInst *MemSet);
     41 
     42 } // End llvm namespace
     43 
     44 #endif
     45