LLVM 20.0.0git
|
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 | |
InstructionWorklist & | operator= (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) |
Instruction * | popDeferred () |
void | reserve (size_t Size) |
void | remove (Instruction *I) |
Remove I from the worklist if it exists. | |
Instruction * | removeOne () |
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 | handleUseCountDecrement (Value *V) |
Should be called after decrementing the use-count on V. | |
void | zap () |
Check that the worklist is empty and nuke the backing store for the map. | |
InstructionWorklist - This is the worklist management logic for InstCombine and other simplification passes.
Definition at line 25 of file InstructionWorklist.h.
|
default |
|
default |
|
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, N >::insert(), and LLVM_DEBUG.
Referenced by addValue(), combineInstructionsOverFunction(), handleUseCountDecrement(), llvm::InstCombiner::InsertNewInstBefore(), llvm::InstCombinerImpl::tryToSinkInstruction(), llvm::InstCombinerImpl::visitAllocSite(), and llvm::InstCombinerImpl::visitCallInst().
|
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.
Referenced by llvm::InstCombinerImpl::visitExtractElementInst().
|
inline |
Should be called after decrementing the use-count on V.
Definition at line 112 of file InstructionWorklist.h.
Referenced by llvm::InstCombiner::replaceOperand(), and llvm::InstCombiner::replaceUse().
|
inline |
Definition at line 39 of file InstructionWorklist.h.
References llvm::SetVector< T, Vector, Set, N >::empty(), and llvm::SmallVectorBase< Size_T >::empty().
Referenced by llvm::InstCombinerImpl::run().
|
default |
|
inline |
Definition at line 73 of file InstructionWorklist.h.
References llvm::SetVector< T, Vector, Set, N >::empty(), and llvm::SetVector< T, Vector, Set, N >::pop_back_val().
Referenced by llvm::InstCombinerImpl::run().
|
inline |
Push the instruction onto the worklist stack.
Instructions that have been added first will be visited last.
Definition at line 58 of file InstructionWorklist.h.
References assert(), llvm::dbgs(), I, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::InstCombiner::addToWorklist(), llvm::InstCombinerImpl::matchBSwapOrBitReverse(), llvm::InstCombinerImpl::prepareWorklist(), pushUsersToWorkList(), pushValue(), llvm::InstCombinerImpl::run(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), llvm::InstCombinerImpl::simplifyDivRemOfSelectWithZeroOp(), llvm::InstCombinerImpl::visitBranchInst(), and llvm::InstCombinerImpl::visitStoreInst().
|
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.
Referenced by llvm::InstCombiner::replaceInstUsesWith(), llvm::InstCombinerImpl::run(), and llvm::InstCombinerImpl::visitAdd().
|
inline |
Definition at line 68 of file InstructionWorklist.h.
Referenced by llvm::InstCombinerImpl::visitCallInst().
|
inline |
Remove I from the worklist if it exists.
Definition at line 85 of file InstructionWorklist.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), I, and llvm::SetVector< T, Vector, Set, N >::remove().
|
inline |
Definition at line 96 of file InstructionWorklist.h.
References llvm::SmallVectorBase< Size_T >::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), I, and llvm::SmallVectorImpl< T >::pop_back_val().
Referenced by llvm::InstCombinerImpl::run().
|
inline |
Definition at line 79 of file InstructionWorklist.h.
References llvm::SmallVectorImpl< T >::reserve(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::reserve(), and Size.
Referenced by llvm::InstCombinerImpl::prepareWorklist().
|
inline |
Check that the worklist is empty and nuke the backing store for the map.
Definition at line 123 of file InstructionWorklist.h.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), and llvm::SetVector< T, Vector, Set, N >::empty().
Referenced by llvm::InstCombinerImpl::run().