llvm::replaceDominatedUsesWithIf

Replace each use of 'From' with 'To' if that use is dominated by the end of the given BasicBlock and the callback ShouldReplace returns true. Returns the number of replacements made.

Synopsis

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

unsigned int
replaceDominatedUsesWithIf(
    Value* From,
    Value* To,
    DominatorTree& DT,
    BasicBlock const* BB,
    function_ref<bool(Use const&, Value const*)> ShouldReplace);

Parameters

NameDescription
FromLLVM Value Representation
ToLLVM Value Representation
DTConcrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
BBLLVM Basic Block Representation
ShouldReplaceAn efficient, type-erasing, non-owning reference to a callable. This is intended for use as the type of a function parameter that is not used after the function in question returns.