LLVM 22.0.0git
|
#include "llvm/Analysis/InstructionPrecedenceTracking.h"
Public Member Functions | |
LLVM_ABI 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 . | |
LLVM_ABI 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. | |
LLVM_ABI void | removeUsersOf (const Instruction *Inst) |
Notifies this tracking that we are going to replace all uses of Inst . | |
LLVM_ABI void | clear () |
Invalidates all information from this tracking. |
Protected Member Functions | |
LLVM_ABI const Instruction * | getFirstSpecialInstruction (const BasicBlock *BB) |
Returns the topmost special instruction from the block BB . | |
LLVM_ABI bool | hasSpecialInstructions (const BasicBlock *BB) |
Returns true iff at least one instruction from the basic block BB is special. | |
LLVM_ABI bool | isPreceededBySpecialInstruction (const Instruction *Insn) |
Returns true iff the first special instruction of Insn's block exists and dominates Insn . | |
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. | |
virtual | ~InstructionPrecedenceTracking ()=default |
Definition at line 31 of file InstructionPrecedenceTracking.h.
|
protectedvirtualdefault |
References LLVM_ABI.
void InstructionPrecedenceTracking::clear | ( | ) |
Invalidates all information from this tracking.
Definition at line 122 of file InstructionPrecedenceTracking.cpp.
|
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 ExpensiveAsserts, I, and isSpecialInstruction().
Referenced by llvm::ImplicitControlFlowTracking::getFirstICFI(), llvm::MemoryWriteTracking::getFirstMemoryWrite(), hasSpecialInstructions(), and isPreceededBySpecialInstruction().
|
protected |
Returns true iff at least one instruction from the basic block BB
is special.
Definition at line 63 of file InstructionPrecedenceTracking.cpp.
References getFirstSpecialInstruction().
Referenced by llvm::ImplicitControlFlowTracking::hasICF(), and llvm::MemoryWriteTracking::mayWriteToMemory().
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 101 of file InstructionPrecedenceTracking.cpp.
References isSpecialInstruction().
|
protected |
Returns true iff the first special instruction of Insn's
block exists and dominates Insn
.
Definition at line 68 of file InstructionPrecedenceTracking.cpp.
References llvm::Instruction::comesBefore(), getFirstSpecialInstruction(), and llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent().
Referenced by llvm::ImplicitControlFlowTracking::isDominatedByICFIFromSameBlock(), and llvm::MemoryWriteTracking::isDominatedByMemoryWriteFromSameBlock().
|
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::ImplicitControlFlowTracking, and llvm::MemoryWriteTracking.
Referenced by getFirstSpecialInstruction(), and insertInstructionTo().
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 107 of file InstructionPrecedenceTracking.cpp.
References assert(), and llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent().
Referenced by 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 115 of file InstructionPrecedenceTracking.cpp.
References llvm::dyn_cast(), removeInstruction(), and llvm::Value::users().