Return true if assume I is valid to use at context instruction CxtI.

Synopsis

Declared in <llvm/Analysis/ValueTracking.h>

bool
isValidAssumeForContext(
    Instruction const* I,
    Instruction const* CxtI,
    DominatorTree const* DT = nullptr,
    bool AllowEphemerals = false);

Description

By default, ephemeral values of the assumption are treated as an invalid context, to prevent the assumption from being used to optimize away its argument. If the caller can ensure that this won't happen, it can call with AllowEphemerals set to true to get more valid assumptions.

Return Value

True if the assume may be used at CxtI.

Parameters

Name

Description

I

Assume intrinsic providing the knowledge.

CxtI

Context instruction where the assume would be used.

DT

Optional dominator tree for validity checks.

AllowEphemerals

Allow ephemeral values as a valid context.

Created with MrDocs