Conditionally replace uses dominated by an edge with another value.

Synopsis

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

unsigned int
replaceDominatedUsesWithIf(
    Value* From,
    Value* To,
    DominatorTree& DT,
    BasicBlockEdge const& Edge,
    function_ref<bool(xref:llvm/Use.adoc[Use const&, Value const*)>] ShouldReplace);

Description

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

Return Value

Number of replacements made.

Parameters

Name

Description

From

Value whose dominated uses may be replaced.

To

Replacement value for selected uses.

DT

Dominator tree used to test edge dominance.

Edge

Edge that must dominate a use for it to be considered.

ShouldReplace

Predicate that selects which dominated uses to replace.

Created with MrDocs