LLVM  14.0.0git
llvm::InstructionPrecedenceTracking Class Referenceabstract

#include "llvm/Analysis/InstructionPrecedenceTracking.h"

Inheritance diagram for llvm::InstructionPrecedenceTracking:
[legend]

## Public Member Functions

void insertInstructionTo (const Instruction *Inst, const BasicBlock *BB)
Notifies this tracking that we are going to insert a new instruction Inst to the basic block BB. More...

void removeInstruction (const Instruction *Inst)
Notifies this tracking that we are going to remove the instruction Inst It makes all necessary updates to internal caches to keep them consistent. More...

void removeUsersOf (const Instruction *Inst)
Notifies this tracking that we are going to replace all uses of Inst. More...

void clear ()
Invalidates all information from this tracking. More...

## Protected Member Functions

const InstructiongetFirstSpecialInstruction (const BasicBlock *BB)
Returns the topmost special instruction from the block BB. More...

bool hasSpecialInstructions (const BasicBlock *BB)
Returns true iff at least one instruction from the basic block BB is special. More...

bool isPreceededBySpecialInstruction (const Instruction *Insn)
Returns true iff the first special instruction of Insn's block exists and dominates Insn. More...

virtual bool isSpecialInstruction (const Instruction *Insn) const =0
A predicate that defines whether or not the instruction Insn is considered special and needs to be tracked. More...

virtual ~InstructionPrecedenceTracking ()=default

## Detailed Description

Definition at line 30 of file InstructionPrecedenceTracking.h.

## ◆ ~InstructionPrecedenceTracking()

 virtual llvm::InstructionPrecedenceTracking::~InstructionPrecedenceTracking ( )
protectedvirtualdefault

## ◆ clear()

 void InstructionPrecedenceTracking::clear ( )

Invalidates all information from this tracking.

Definition at line 129 of file InstructionPrecedenceTracking.cpp.

Referenced by llvm::ICFLoopSafetyInfo::computeLoopSafetyInfo().

## ◆ getFirstSpecialInstruction()

 const Instruction * InstructionPrecedenceTracking::getFirstSpecialInstruction ( const BasicBlock * BB )
protected

Returns the topmost special instruction from the block BB.

Returns nullptr if there is no special instructions in the block.

Definition at line 39 of file InstructionPrecedenceTracking.cpp.

References assert(), BB, and ExpensiveAsserts.

## ◆ hasSpecialInstructions()

 bool InstructionPrecedenceTracking::hasSpecialInstructions ( const BasicBlock * BB )
protected

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

Definition at line 57 of file InstructionPrecedenceTracking.cpp.

References BB, and getFirstSpecialInstruction().

## ◆ insertInstructionTo()

 void InstructionPrecedenceTracking::insertInstructionTo ( const Instruction * Inst, const BasicBlock * BB )

Notifies this tracking that we are going to insert a new instruction Inst to the basic block BB.

It makes all necessary updates to internal caches to keep them consistent.

Definition at line 109 of file InstructionPrecedenceTracking.cpp.

References BB, and isSpecialInstruction().

Referenced by llvm::ICFLoopSafetyInfo::insertInstructionTo().

## ◆ isPreceededBySpecialInstruction()

 bool InstructionPrecedenceTracking::isPreceededBySpecialInstruction ( const Instruction * Insn )
protected

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

Definition at line 62 of file InstructionPrecedenceTracking.cpp.

References llvm::Instruction::comesBefore(), getFirstSpecialInstruction(), and Insn.

## ◆ isSpecialInstruction()

 virtual bool llvm::InstructionPrecedenceTracking::isSpecialInstruction ( const Instruction * Insn ) const
protectedpure virtual

A predicate that defines whether or not the instruction Insn is considered special and needs to be tracked.

Implementing this method in children classes allows to implement tracking of implicit control flow, memory writing instructions or any other kinds of instructions we might be interested in.

Implemented in llvm::MemoryWriteTracking, and llvm::ImplicitControlFlowTracking.

Referenced by insertInstructionTo().

## ◆ removeInstruction()

 void InstructionPrecedenceTracking::removeInstruction ( const Instruction * Inst )

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

Definition at line 115 of file InstructionPrecedenceTracking.cpp.

References assert(), BB, and llvm::Instruction::getParent().

Referenced by llvm::ICFLoopSafetyInfo::removeInstruction(), and removeUsersOf().

## ◆ removeUsersOf()

 void InstructionPrecedenceTracking::removeUsersOf ( const Instruction * Inst )

Notifies this tracking that we are going to replace all uses of Inst.

It makes all necessary updates to internal caches to keep them consistent. Should typically be called before a RAUW.

Definition at line 122 of file InstructionPrecedenceTracking.cpp.

References removeInstruction(), and llvm::Value::users().

The documentation for this class was generated from the following files: