Insert an llvm.assume before an instruction to salvage its derived knowledge.

Synopsis

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

bool
salvageKnowledge(
    Instruction* I,
    AssumptionCache* AC = nullptr,
    DominatorTree* DT = nullptr);

Description

Calls BuildAssumeFromInst and if the resulting llvm.assume is valid insert if before I. This is usually what need to be done to salvage the knowledge contained in the instruction I. The AssumptionCache must be provided if it is available or the cache may become silently be invalid. The DominatorTree can optionally be provided to enable cross‐block reasoning. This returns if a change was made.

Return Value

True if an assume was inserted.

Parameters

Name

Description

I

Instruction whose knowledge should be salvaged.

AC

Optional assumption cache to update; provide it when available.

DT

Optional dominator tree enabling cross‐block reasoning.

Created with MrDocs