Extend the width of an IV to cover its widest uses.

Synopsis

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

PHINode*
createWideIV(
    WideIVInfo const& WI,
    LoopInfo* LI,
    ScalarEvolution* SE,
    SCEVExpander& Rewriter,
    DominatorTree* DT,
    SmallVectorImpl<WeakTrackingVH>& DeadInsts,
    unsigned int& NumElimExt,
    unsigned int& NumWidened,
    bool HasGuards,
    bool UsePostIncrementRanges);

Return Value

The wide induction‐variable PHI, or nullptr if widening failed.

Parameters

Name

Description

WI

Information about the narrow IV and its widest extend uses.

LI

Loop info for the function containing the IV.

SE

ScalarEvolution used to analyze and rewrite the IV.

Rewriter

SCEV expander used to materialize the wide IV.

DT

Dominator tree used while rewriting.

DeadInsts

Receives instructions that become dead and may be deleted.

NumElimExt

Incremented by the number of eliminated extend operations.

NumWidened

Incremented by the number of widened induction variables.

HasGuards

True if the module may contain llvm.experimental.guard.

UsePostIncrementRanges

Whether to use post‐increment IV ranges.

Created with MrDocs