Conditionally replace uses dominated by a block's end with another value.

Synopsis

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

unsigned int
replaceDominatedUsesWithIf(
    Value* From,
    Value* To,
    DominatorTree& DT,
    BasicBlock const* BB,
    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 end of the given BasicBlock 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 block dominance.

BB

Block whose end must dominate a use for it to be considered.

ShouldReplace

Predicate that selects which dominated uses to replace.

Created with MrDocs