llvm::SCEVExpander::hoistIVInc

Hoist IncV and its required subexpressions before InsertPos.

Synopsis

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

bool
hoistIVInc(
    Instruction* IncV,
    Instruction* InsertPos,
    bool RecomputePoisonFlags = false);

Description

If RecomputePoisonFlags is set, drops all poison-generating flags from instructions being hoisted and tries to re-infer them in the new location. It should be used when we are going to introduce a new use in the new position that didn't exist before, and may trigger new UB in case of poison.

Return Value

True if the increment was successfully hoisted.

Parameters

NameDescription
IncVInduction-variable increment to hoist.
InsertPosInstruction before which IncV is hoisted.
RecomputePoisonFlagsWhether to drop and re-infer poison flags.