LLVM 20.0.0git
Macros | Functions
LowerMemIntrinsics.cpp File Reference
#include "llvm/Transforms/Utils/LowerMemIntrinsics.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include <optional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "lower-mem-intrinsics"
 

Functions

static ValuegetRuntimeLoopCount (const DataLayout &DL, IRBuilderBase &B, Value *Len, Value *OpSize, unsigned OpSizeVal)
 
static ValuegetRuntimeLoopRemainder (const DataLayout &DL, IRBuilderBase &B, Value *Len, Value *OpSize, unsigned OpSizeVal)
 
static std::pair< Value *, Value * > tryInsertCastToCommonAddrSpace (IRBuilderBase &B, Value *Addr1, Value *Addr2, const TargetTransformInfo &TTI)
 
static void createMemMoveLoopUnknownSize (Instruction *InsertBefore, Value *SrcAddr, Value *DstAddr, Value *CopyLen, Align SrcAlign, Align DstAlign, bool SrcIsVolatile, bool DstIsVolatile, const TargetTransformInfo &TTI)
 
static void createMemMoveLoopKnownSize (Instruction *InsertBefore, Value *SrcAddr, Value *DstAddr, ConstantInt *CopyLen, Align SrcAlign, Align DstAlign, bool SrcIsVolatile, bool DstIsVolatile, const TargetTransformInfo &TTI)
 
static void createMemSetLoop (Instruction *InsertBefore, Value *DstAddr, Value *CopyLen, Value *SetValue, Align DstAlign, bool IsVolatile)
 
template<typename T >
static bool canOverlap (MemTransferBase< T > *Memcpy, ScalarEvolution *SE)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lower-mem-intrinsics"

Definition at line 20 of file LowerMemIntrinsics.cpp.

Function Documentation

◆ canOverlap()

template<typename T >
static bool canOverlap ( MemTransferBase< T > *  Memcpy,
ScalarEvolution SE 
)
static

◆ createMemMoveLoopKnownSize()

static void createMemMoveLoopKnownSize ( Instruction InsertBefore,
Value SrcAddr,
Value DstAddr,
ConstantInt CopyLen,
Align  SrcAlign,
Align  DstAlign,
bool  SrcIsVolatile,
bool  DstIsVolatile,
const TargetTransformInfo TTI 
)
static

◆ createMemMoveLoopUnknownSize()

static void createMemMoveLoopUnknownSize ( Instruction InsertBefore,
Value SrcAddr,
Value DstAddr,
Value CopyLen,
Align  SrcAlign,
Align  DstAlign,
bool  SrcIsVolatile,
bool  DstIsVolatile,
const TargetTransformInfo TTI 
)
static

◆ createMemSetLoop()

static void createMemSetLoop ( Instruction InsertBefore,
Value DstAddr,
Value CopyLen,
Value SetValue,
Align  DstAlign,
bool  IsVolatile 
)
static

◆ getRuntimeLoopCount()

static Value * getRuntimeLoopCount ( const DataLayout DL,
IRBuilderBase B,
Value Len,
Value OpSize,
unsigned  OpSizeVal 
)
static

Definition at line 159 of file LowerMemIntrinsics.cpp.

References B, llvm::isPowerOf2_32(), and llvm::Log2_32().

Referenced by createMemMoveLoopUnknownSize().

◆ getRuntimeLoopRemainder()

static Value * getRuntimeLoopRemainder ( const DataLayout DL,
IRBuilderBase B,
Value Len,
Value OpSize,
unsigned  OpSizeVal 
)
static

Definition at line 169 of file LowerMemIntrinsics.cpp.

References B, and llvm::isPowerOf2_32().

Referenced by createMemMoveLoopUnknownSize().

◆ tryInsertCastToCommonAddrSpace()

static std::pair< Value *, Value * > tryInsertCastToCommonAddrSpace ( IRBuilderBase B,
Value Addr1,
Value Addr2,
const TargetTransformInfo TTI 
)
static