LLVM 17.0.0git
Public Member Functions | List of all members
llvm::InstructionWorklist Class Reference

InstructionWorklist - This is the worklist management logic for InstCombine and other simplification passes. More...

#include "llvm/Transforms/Utils/InstructionWorklist.h"

Public Member Functions

 InstructionWorklist ()=default
 
 InstructionWorklist (InstructionWorklist &&)=default
 
InstructionWorklistoperator= (InstructionWorklist &&)=default
 
bool isEmpty () const
 
void add (Instruction *I)
 Add instruction to the worklist.
 
void addValue (Value *V)
 Add value to the worklist if it is an instruction.
 
void push (Instruction *I)
 Push the instruction onto the worklist stack.
 
void pushValue (Value *V)
 
InstructionpopDeferred ()
 
void reserve (size_t Size)
 
void remove (Instruction *I)
 Remove I from the worklist if it exists.
 
InstructionremoveOne ()
 
void pushUsersToWorkList (Instruction &I)
 When an instruction is simplified, add all users of the instruction to the work lists because they might get more simplified now.
 
void zap ()
 Check that the worklist is empty and nuke the backing store for the map.
 

Detailed Description

InstructionWorklist - This is the worklist management logic for InstCombine and other simplification passes.

Definition at line 25 of file InstructionWorklist.h.

Constructor & Destructor Documentation

◆ InstructionWorklist() [1/2]

llvm::InstructionWorklist::InstructionWorklist ( )
default

◆ InstructionWorklist() [2/2]

llvm::InstructionWorklist::InstructionWorklist ( InstructionWorklist &&  )
default

Member Function Documentation

◆ add()

void llvm::InstructionWorklist::add ( Instruction I)
inline

Add instruction to the worklist.

Instructions will be visited in the order they are added. You likely want to use this method.

Definition at line 44 of file InstructionWorklist.h.

References llvm::dbgs(), I, llvm::SetVector< T, Vector, Set >::insert(), and LLVM_DEBUG.

Referenced by addValue(), combineInstructionsOverFunction(), and llvm::InstCombiner::InsertNewInstBefore().

◆ addValue()

void llvm::InstructionWorklist::addValue ( Value V)
inline

Add value to the worklist if it is an instruction.

Instructions will be visited in the order they are added.

Definition at line 51 of file InstructionWorklist.h.

References add(), and I.

Referenced by llvm::InstCombiner::replaceOperand(), and llvm::InstCombiner::replaceUse().

◆ isEmpty()

bool llvm::InstructionWorklist::isEmpty ( ) const
inline

◆ operator=()

InstructionWorklist & llvm::InstructionWorklist::operator= ( InstructionWorklist &&  )
default

◆ popDeferred()

Instruction * llvm::InstructionWorklist::popDeferred ( )
inline

◆ push()

void llvm::InstructionWorklist::push ( Instruction I)
inline

◆ pushUsersToWorkList()

void llvm::InstructionWorklist::pushUsersToWorkList ( Instruction I)
inline

When an instruction is simplified, add all users of the instruction to the work lists because they might get more simplified now.

Definition at line 106 of file InstructionWorklist.h.

References I, and push().

Referenced by llvm::InstCombiner::replaceInstUsesWith(), and llvm::InstCombinerImpl::run().

◆ pushValue()

void llvm::InstructionWorklist::pushValue ( Value V)
inline

Definition at line 68 of file InstructionWorklist.h.

References I, and push().

Referenced by llvm::InstCombinerImpl::visitCallInst().

◆ remove()

void llvm::InstructionWorklist::remove ( Instruction I)
inline

◆ removeOne()

Instruction * llvm::InstructionWorklist::removeOne ( )
inline

◆ reserve()

void llvm::InstructionWorklist::reserve ( size_t  Size)
inline

◆ zap()

void llvm::InstructionWorklist::zap ( )
inline

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