Tracks "special" instructions and answers precedence queries efficiently.

Synopsis

Declared in <llvm/Analysis/InstructionPrecedenceTracking.h>

class InstructionPrecedenceTracking;

Description

Defines some instructions as special (e.g. having implicit control flow, or writing memory, or having another interesting property) and then efficiently answers queries of the types: 1. Are there any special instructions in the block of interest? 2. Return first of the special instructions in the given block; 3. Check if the given instruction is preceeded by the first special instruction in the same block. The class provides caching that allows to answer these queries quickly. The user must make sure that the cached data is invalidated properly whenever a content of some tracked block is changed.

Member Functions

Name

Description

clear

Invalidates all information from this tracking.

insertInstructionTo

Updates caches for an instruction about to be inserted into a block.

removeInstruction

Notifies this tracking that we are going to remove the instruction Inst It makes all necessary updates to internal caches to keep them consistent.

removeUsersOf

Updates caches before replacing all uses of an instruction.

Protected Member Functions

Name

Description

~InstructionPrecedenceTracking [destructor] [virtual]

Destroys this instruction precedence tracking.

getFirstSpecialInstruction

Returns the topmost special instruction from the block BB. Returns nullptr if there is no special instructions in the block.

hasSpecialInstructions

Returns true iff at least one instruction from the basic block BB is special.

isPreceededBySpecialInstruction

Returns true iff the first special instruction of Insn's block exists and dominates Insn.

isSpecialInstruction [virtual]

Returns whether Insn is considered special and needs to be tracked.

Derived Classes

Name

Description

ImplicitControlFlowTracking

Tracks instructions with implicit control flow within basic blocks.

MemoryWriteTracking

Tracks instructions that may write to memory within basic blocks.

Created with MrDocs