llvm::copyRangeMetadata

Copy range metadata onto a replacement load.

Synopsis

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

void
copyRangeMetadata(
    DataLayout const& DL,
    LoadInst const& OldLI,
    MDNode* N,
    LoadInst& NewLI);

Description

Copy a range metadata node to a new load instruction.

This handles mapping it to nonnull metadata if the new load is a pointer load instead of an integer load and the range doesn't cover null.

Parameters

NameDescription
DLData layout used when remapping range metadata.
OldLIOriginal load that carried the metadata.
NRange metadata node to copy or remap.
NewLIReplacement load that receives the metadata.