Emit a loop implementing llvm.memcpy when the size is a constant.

Synopsis

Declared in <llvm/Transforms/Utils/LowerMemIntrinsics.h>

void
createMemCpyLoopKnownSize(
    Instruction* InsertBefore,
    Value* SrcAddr,
    Value* DstAddr,
    ConstantInt* CopyLen,
    Align SrcAlign,
    Align DestAlign,
    bool SrcIsVolatile,
    bool DstIsVolatile,
    bool CanOverlap,
    TargetTransformInfo const& TTI,
    std::optional<uint32_t> AtomicCpySize = std::nullopt,
    std::optional<uint64_t> AverageTripCount = std::nullopt);

Description

The loop is inserted at InsertBefore.

Parameters

Name

Description

InsertBefore

Instruction before which the loop is inserted.

SrcAddr

Source address of the copy.

DstAddr

Destination address of the copy.

CopyLen

Constant number of bytes to copy.

SrcAlign

Alignment of the source.

DestAlign

Alignment of the destination.

SrcIsVolatile

Whether the source load is volatile.

DstIsVolatile

Whether the destination store is volatile.

CanOverlap

Whether source and destination may overlap.

TTI

Target info used to choose loop operand types.

AtomicCpySize

Optional atomic element size in bytes.

AverageTripCount

Optional expected loop trip count for profiling.

Created with MrDocs