LLVM 20.0.0git
|
#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 Value * | getRuntimeLoopRemainder (const DataLayout &DL, IRBuilderBase &B, Value *Len, Value *OpSize, unsigned OpSizeVal) |
static Value * | getRuntimeLoopBytes (const DataLayout &DL, IRBuilderBase &B, Value *Len, Value *OpSize, unsigned OpSizeVal, Value *RTLoopRemainder=nullptr) |
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) |
#define DEBUG_TYPE "lower-mem-intrinsics" |
Definition at line 20 of file LowerMemIntrinsics.cpp.
|
static |
Definition at line 867 of file LowerMemIntrinsics.cpp.
References llvm::MemTransferBase< BaseCL >::getRawSource(), llvm::ScalarEvolution::getSCEV(), llvm::CmpInst::ICMP_NE, and llvm::ScalarEvolution::isKnownPredicateAt().
Referenced by llvm::expandMemCpyAsLoop().
|
static |
Definition at line 655 of file LowerMemIntrinsics.cpp.
References llvm::PHINode::addIncoming(), llvm::alignDown(), llvm::commonAlignment(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateAlignedLoad(), llvm::IRBuilderBase::CreateAlignedStore(), llvm::IRBuilderBase::CreateCondBr(), llvm::IRBuilderBase::CreateICmpEQ(), llvm::IRBuilderBase::CreateICmpULT(), llvm::IRBuilderBase::CreateInBoundsGEP(), llvm::IRBuilderBase::CreatePHI(), llvm::IRBuilderBase::CreateSub(), DL, llvm::Instruction::eraseFromParent(), F, llvm::BasicBlock::getContext(), llvm::BasicBlock::getFirstNonPHI(), llvm::Type::getInt8Ty(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::TargetTransformInfo::getMemcpyLoopLoweringType(), llvm::TargetTransformInfo::getMemcpyLoopResidualLoweringType(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getParent(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::ConstantInt::getZExtValue(), llvm::ConstantInt::isZero(), llvm::IRBuilderBase::SetInsertPoint(), llvm::Value::setName(), llvm::BasicBlock::splitBasicBlock(), llvm::SplitBlockAndInsertIfThenElse(), and tryInsertCastToCommonAddrSpace().
Referenced by llvm::expandMemMoveAsLoop().
|
static |
Definition at line 401 of file LowerMemIntrinsics.cpp.
References llvm::PHINode::addIncoming(), llvm::commonAlignment(), llvm::BranchInst::Create(), llvm::BasicBlock::Create(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateAlignedLoad(), llvm::IRBuilderBase::CreateAlignedStore(), llvm::IRBuilderBase::CreateCondBr(), llvm::IRBuilderBase::CreateICmpEQ(), llvm::IRBuilderBase::CreateICmpULT(), llvm::IRBuilderBase::CreateInBoundsGEP(), llvm::IRBuilderBase::CreatePHI(), llvm::IRBuilderBase::CreateSub(), llvm::IRBuilderBase::CreateUnreachable(), DL, llvm::Instruction::eraseFromParent(), F, llvm::BasicBlock::getContext(), llvm::Type::getInt8Ty(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::TargetTransformInfo::getMemcpyLoopLoweringType(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getParent(), getRuntimeLoopBytes(), getRuntimeLoopRemainder(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::Value::setName(), llvm::SplitBlockAndInsertIfThenElse(), and tryInsertCastToCommonAddrSpace().
Referenced by llvm::expandMemMoveAsLoop().
|
static |
Definition at line 827 of file LowerMemIntrinsics.cpp.
References llvm::PHINode::addIncoming(), llvm::commonAlignment(), llvm::BasicBlock::Create(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateAlignedStore(), llvm::IRBuilderBase::CreateCondBr(), llvm::IRBuilderBase::CreateICmpEQ(), llvm::IRBuilderBase::CreateICmpULT(), llvm::IRBuilderBase::CreateInBoundsGEP(), llvm::IRBuilderBase::CreatePHI(), DL, llvm::Instruction::eraseFromParent(), F, llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getParent(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), SetValue(), and llvm::BasicBlock::splitBasicBlock().
Referenced by llvm::expandMemSetAsLoop(), and llvm::expandMemSetPatternAsLoop().
|
static |
Definition at line 171 of file LowerMemIntrinsics.cpp.
References B, DL, and getRuntimeLoopRemainder().
Referenced by createMemMoveLoopUnknownSize().
|
static |
Definition at line 158 of file LowerMemIntrinsics.cpp.
References B, and llvm::isPowerOf2_32().
Referenced by createMemMoveLoopUnknownSize(), and getRuntimeLoopBytes().
|
static |
Definition at line 356 of file LowerMemIntrinsics.cpp.
References B, llvm::Value::getType(), llvm::TargetTransformInfo::isValidAddrSpaceCast(), and llvm_unreachable.
Referenced by createMemMoveLoopKnownSize(), and createMemMoveLoopUnknownSize().