LLVM: llvm::InstCombiner Class Reference (original) (raw)

The core instruction combiner logic. More...

#include "[llvm/Transforms/InstCombine/InstCombiner.h](InstCombiner%5F8h%5Fsource.html)"

Public Member Functions
InstCombiner (InstructionWorklist &Worklist, BuilderTy &Builder, Function &F, AAResults *AA, AssumptionCache &AC, TargetLibraryInfo &TLI, TargetTransformInfo &TTI, DominatorTree &DT, OptimizationRemarkEmitter &ORE, BlockFrequencyInfo *BFI, BranchProbabilityInfo *BPI, ProfileSummaryInfo *PSI, const DataLayout &DL, ReversePostOrderTraversal< BasicBlock * > &RPOT)
virtual ~InstCombiner ()=default
Value * getFreelyInvertedImpl (Value *V, bool WillInvertAllUses, BuilderTy *Builder, bool &DoesConsume, unsigned Depth)
Return nonnull value if V is free to invert under the condition of WillInvertAllUses.
Value * getFreelyInverted (Value *V, bool WillInvertAllUses, BuilderTy *Builder, bool &DoesConsume)
Value * getFreelyInverted (Value *V, bool WillInvertAllUses, BuilderTy *Builder)
bool isFreeToInvert (Value *V, bool WillInvertAllUses, bool &DoesConsume)
Return true if the specified value is free to invert (apply ~ to).
bool isFreeToInvert (Value *V, bool WillInvertAllUses)
bool canFreelyInvertAllUsersOf (Instruction *V, Value *IgnoredUser)
Given i1 V, can every user of V be freely adapted if V is changed to !V ?
void addToWorklist (Instruction *I)
AssumptionCache & getAssumptionCache () const
TargetLibraryInfo & getTargetLibraryInfo () const
DominatorTree & getDominatorTree () const
const DataLayout & getDataLayout () const
const SimplifyQuery & getSimplifyQuery () const
OptimizationRemarkEmitter & getOptimizationRemarkEmitter () const
BlockFrequencyInfo * getBlockFrequencyInfo () const
ProfileSummaryInfo * getProfileSummaryInfo () const
std::optional< Instruction * > targetInstCombineIntrinsic (IntrinsicInst &II)
std::optional< Value * > targetSimplifyDemandedUseBitsIntrinsic (IntrinsicInst &II, APInt DemandedMask, KnownBits &Known, bool &KnownBitsComputed)
std::optional< Value * > targetSimplifyDemandedVectorEltsIntrinsic (IntrinsicInst &II, APInt DemandedElts, APInt &UndefElts, APInt &UndefElts2, APInt &UndefElts3, std::function< void(Instruction *, unsigned, APInt, APInt &)> SimplifyAndSetOp)
void computeBackEdges ()
bool isBackEdge (const BasicBlock *From, const BasicBlock *To)
Instruction * InsertNewInstBefore (Instruction *New, BasicBlock::iterator Old)
Inserts an instruction New before instruction Old.
Instruction * InsertNewInstWith (Instruction *New, BasicBlock::iterator Old)
Same as InsertNewInstBefore, but also sets the debug loc.
Instruction * replaceInstUsesWith (Instruction &I, Value *V)
A combiner-aware RAUW-like routine.
Instruction * replaceOperand (Instruction &I, unsigned OpNum, Value *V)
Replace operand of instruction and add old operand to the worklist.
void replaceUse (Use &U, Value *NewValue)
Replace use and add the previously used value to the worklist.
virtual Instruction * eraseInstFromFunction (Instruction &I)=0
Combiner aware instruction erasure.
void computeKnownBits (const Value *V, KnownBits &Known, const Instruction *CxtI, unsigned Depth=0) const
KnownBits computeKnownBits (const Value *V, const Instruction *CxtI, unsigned Depth=0) const
bool isKnownToBeAPowerOfTwo (const Value *V, bool OrZero=false, const Instruction *CxtI=nullptr, unsigned Depth=0)
bool MaskedValueIsZero (const Value *V, const APInt &Mask, const Instruction *CxtI=nullptr, unsigned Depth=0) const
unsigned ComputeNumSignBits (const Value *Op, const Instruction *CxtI=nullptr, unsigned Depth=0) const
unsigned ComputeMaxSignificantBits (const Value *Op, const Instruction *CxtI=nullptr, unsigned Depth=0) const
OverflowResult computeOverflowForUnsignedMul (const Value *LHS, const Value *RHS, const Instruction *CxtI, bool IsNSW=false) const
OverflowResult computeOverflowForSignedMul (const Value *LHS, const Value *RHS, const Instruction *CxtI) const
OverflowResult computeOverflowForUnsignedAdd (const WithCache< const Value * > &LHS, const WithCache< const Value * > &RHS, const Instruction *CxtI) const
OverflowResult computeOverflowForSignedAdd (const WithCache< const Value * > &LHS, const WithCache< const Value * > &RHS, const Instruction *CxtI) const
OverflowResult computeOverflowForUnsignedSub (const Value *LHS, const Value *RHS, const Instruction *CxtI) const
OverflowResult computeOverflowForSignedSub (const Value *LHS, const Value *RHS, const Instruction *CxtI) const
virtual bool SimplifyDemandedBits (Instruction *I, unsigned OpNo, const APInt &DemandedMask, KnownBits &Known, const SimplifyQuery &Q, unsigned Depth=0)=0
bool SimplifyDemandedBits (Instruction *I, unsigned OpNo, const APInt &DemandedMask, KnownBits &Known)
virtual Value * SimplifyDemandedVectorElts (Value *V, APInt DemandedElts, APInt &UndefElts, unsigned Depth=0, bool AllowMultipleUsers=false)=0
bool isValidAddrSpaceCast (unsigned FromAS, unsigned ToAS) const
Static Public Member Functions
static Value * peekThroughBitcast (Value *V, bool OneUseOnly=false)
Return the source operand of a potentially bitcasted value while optionally checking if it has one use.
static unsigned getComplexity (Value *V)
Assign a complexity or rank value to LLVM Values.
static bool isCanonicalPredicate (CmpPredicate Pred)
Predicate canonicalization reduces the number of patterns that need to be matched by other transforms.
static Constant * AddOne (Constant *C)
Add one to a Constant.
static Constant * SubOne (Constant *C)
Subtract one from a Constant.
static bool shouldAvoidAbsorbingNotIntoSelect (const SelectInst &SI)
static Constant * getSafeVectorConstantForBinop (BinaryOperator::BinaryOps Opcode, Constant *In, bool IsRHSConstant)
Some binary operators require special handling to avoid poison and undefined behavior.
Public Attributes
uint64_t MaxArraySizeForCombine = 0
Maximum size of array considered when transforming.
BuilderTy & Builder
Protected Attributes
InstructionWorklist & Worklist
A worklist of the instructions that need to be simplified.
Function & F
const bool MinimizeSize
AAResults * AA
AssumptionCache & AC
TargetLibraryInfo & TLI
DominatorTree & DT
const DataLayout & DL
SimplifyQuery SQ
OptimizationRemarkEmitter & ORE
BlockFrequencyInfo * BFI
BranchProbabilityInfo * BPI
ProfileSummaryInfo * PSI
DomConditionCache DC
ReversePostOrderTraversal< BasicBlock * > & RPOT
bool MadeIRChange = false
SmallDenseSet< std::pair< BasicBlock *, BasicBlock * >, 8 > DeadEdges
Edges that are known to never be taken.
SmallDenseMap< BasicBlock *, SmallVector< BasicBlock * >, 8 > PredOrder
Order of predecessors to canonicalize phi nodes towards.
SmallDenseSet< std::pair< const BasicBlock *, const BasicBlock * >, 8 > BackEdges
Backedges, used to avoid pushing instructions across backedges in cases where this may result in infinite combine loops.
bool ComputedBackEdges = false

The core instruction combiner logic.

This class provides both the logic to recursively visit instructions and combine them.

Definition at line 48 of file InstCombiner.h.

BuilderTy

llvm::InstCombiner::InstCombiner ( InstructionWorklist & Worklist, BuilderTy & Builder, Function & F, AAResults * AA, AssumptionCache & AC, TargetLibraryInfo & TLI, TargetTransformInfo & TTI, DominatorTree & DT, OptimizationRemarkEmitter & ORE, BlockFrequencyInfo * BFI, BranchProbabilityInfo * BPI, ProfileSummaryInfo * PSI, const DataLayout & DL, ReversePostOrderTraversal< BasicBlock * > & RPOT ) inline

Definition at line 103 of file InstCombiner.h.

References AA, AC, BFI, BPI, Builder, DC, DL, DT, F, MinimizeSize, ORE, PSI, RPOT, SQ, TLI, and Worklist.

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

~InstCombiner()

virtual llvm::InstCombiner::~InstCombiner ( ) virtualdefault

AddOne()

addToWorklist()

void llvm::InstCombiner::addToWorklist ( Instruction * I) inline

Definition at line 334 of file InstCombiner.h.

References I, and Worklist.

Referenced by llvm::InstCombinerImpl::addDeadEdge(), foldIsPowerOf2(), foldIsPowerOf2OrZero(), llvm::InstCombinerImpl::freelyInvertAllUsersOf(), getShiftedValue(), llvm::InstCombinerImpl::handleUnreachableFrom(), processUMulZExtIdiom(), replaceExtractElements(), rewriteGEPAsOffset(), llvm::X86TTIImpl::simplifyDemandedVectorEltsIntrinsic(), and llvm::InstCombinerImpl::visitBranchInst().

canFreelyInvertAllUsersOf()

Given i1 V, can every user of V be freely adapted if V is changed to !V ?

InstCombine's freelyInvertAllUsersOf() must be kept in sync with this fn. NOTE: for Instructions only!

See also: isFreeToInvert()

Definition at line 246 of file InstCombiner.h.

References assert(), llvm::cast(), I, llvm::MIPatternMatch::m_Not(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), shouldAvoidAbsorbingNotIntoSelect(), and llvm::Value::uses().

Referenced by canFreelyInvert(), llvm::InstCombinerImpl::canonicalizeICmpPredicate(), llvm::InstCombinerImpl::sinkNotIntoLogicalOp(), and llvm::InstCombinerImpl::sinkNotIntoOtherHandOfLogicalOp().

computeBackEdges()

void InstCombiner::computeBackEdges ( )

computeKnownBits() [1/2]

computeKnownBits() [2/2]

Definition at line 435 of file InstCombiner.h.

References llvm::computeKnownBits(), llvm::Depth, and SQ.

Referenced by canReplaceGEPIdxWithZero(), llvm::InstCombinerImpl::convertOrOfShiftsToFunnelShift(), foldCtpop(), foldCttzCtlz(), llvm::InstCombinerImpl::foldICmpAndConstConst(), foldICmpAndXX(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::InstCombinerImpl::foldICmpTruncConstant(), llvm::InstCombinerImpl::foldICmpWithZero(), isKnownExactCastIntToFP(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::simplifyRangeCheck(), simplifyShiftSelectingPackedElement(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitSDiv(), and llvm::InstCombinerImpl::visitSwitchInst().

ComputeMaxSignificantBits()

ComputeNumSignBits()

computeOverflowForSignedAdd()

computeOverflowForSignedMul()

computeOverflowForSignedSub()

computeOverflowForUnsignedAdd()

computeOverflowForUnsignedMul()

computeOverflowForUnsignedSub()

eraseInstFromFunction()

Combiner aware instruction erasure.

When dealing with an instruction that has side effects or produces a void value, we can't rely on DCE to delete the instruction. Instead, visit methods should return the value returned by this function.

Implemented in llvm::InstCombinerImpl.

References I.

Referenced by instCombineDMB(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::GCNTTIImpl::instCombineIntrinsic(), instCombineST1ScatterIndex(), instCombineSVEST1(), modifyIntrinsicCall(), simplifyAMDGCNImageIntrinsic(), simplifySVEIntrinsic(), and simplifyX86MaskedStore().

getAssumptionCache()

getBlockFrequencyInfo()

getComplexity()

unsigned llvm::InstCombiner::getComplexity ( Value * V) inlinestatic

Assign a complexity or rank value to LLVM Values.

This is used to reduce the amount of pattern matching needed for compares and commutative instructions. For example, if we have: icmp ugt X, Constant or xor (add X, Constant), cast Z

We do not have to consider the commuted variants of these patterns because canonicalization based on complexity guarantees the above ordering.

This routine maps IR values to various complexity ranks: 0 -> undef 1 -> Constants 2 -> Cast and (f)neg/not instructions 3 -> Other instructions and arguments

Definition at line 145 of file InstCombiner.h.

References llvm::isa(), llvm::PatternMatch::m_FNeg(), llvm::MIPatternMatch::m_Neg(), llvm::MIPatternMatch::m_Not(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().

Referenced by llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), llvm::InstCombinerImpl::visitFCmpInst(), and llvm::InstCombinerImpl::visitICmpInst().

getDataLayout()

Definition at line 339 of file InstCombiner.h.

References DL.

Referenced by canonicalizeGEPOfConstGEPI8(), canReplaceGEPIdxWithZero(), combineConstantOffsets(), combineLoadToOperationType(), EvaluateInDifferentTypeImpl(), foldLogicCastConstant(), foldVecExtTruncToExtElt(), foldVecTruncToExtElt(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::PPCTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), likeBitCastFromVector(), narrowUDivURem(), llvm::Negator::Negate(), optimizeIntegerToVectorInsertions(), optimizeVectorResizeWithIntegerBitCasts(), simplifyAllocaArraySize(), simplifyAMDGCNMemoryIntrinsicDemanded(), simplifyAssocCastAssoc(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), unpackLoadToAggregate(), and unpackStoreToAggregate().

getDominatorTree()

DominatorTree & llvm::InstCombiner::getDominatorTree ( ) const inline

getFreelyInverted() [1/2]

Value * llvm::InstCombiner::getFreelyInverted ( Value * V, bool WillInvertAllUses, BuilderTy * Builder ) inline

getFreelyInverted() [2/2]

Value * llvm::InstCombiner::getFreelyInverted ( Value * V, bool WillInvertAllUses, BuilderTy * Builder, bool & DoesConsume ) inline

Definition at line 211 of file InstCombiner.h.

References Builder, and getFreelyInvertedImpl().

Referenced by foldICmpAndXX(), llvm::InstCombinerImpl::foldICmpBitCast(), foldICmpOrXX(), foldICmpWithLowBitMaskedVal(), getFreelyInverted(), isFreeToInvert(), llvm::InstCombinerImpl::tryFoldInstWithCtpopWithNot(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitICmpInst(), and llvm::InstCombinerImpl::visitSub().

getFreelyInvertedImpl()

Return nonnull value if V is free to invert under the condition of WillInvertAllUses.

If Builder is nonnull, it will return a simplified ~V. If Builder is null, it will return an arbitrary nonnull value (not dereferenceable). If the inversion will consume instructions, DoesConsume will be set to true. Otherwise it will be false.

Definition at line 2852 of file InstructionCombining.cpp.

References A(), llvm::PHINode::addIncoming(), assert(), B(), Builder, llvm::CallingConv::C, llvm::cast(), Cond, llvm::Depth, llvm::dyn_cast(), llvm::SmallVectorImpl< T >::emplace_back(), getFreelyInvertedImpl(), llvm::getInverseMinMaxIntrinsic(), llvm::ConstantExpr::getNot(), I, II, IsSelect(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_ImmConstant(), llvm::PatternMatch::m_LogicalAnd(), llvm::PatternMatch::m_LogicalOr(), llvm::PatternMatch::m_MaxOrMin(), llvm::MIPatternMatch::m_Not(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_SExtLike(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::PatternMatch::match(), llvm::MaxAnalysisRecursionDepth, and shouldAvoidAbsorbingNotIntoSelect().

Referenced by getFreelyInverted(), and getFreelyInvertedImpl().

getOptimizationRemarkEmitter()

getProfileSummaryInfo()

getSafeVectorConstantForBinop()

Some binary operators require special handling to avoid poison and undefined behavior.

If a constant vector has undef elements, replace those undefs with identity constants if possible because those are always safe to execute. If no identity constant exists, replace undef with some other safe constant.

Definition at line 282 of file InstCombiner.h.

References assert(), llvm::CallingConv::C, llvm::cast(), llvm::ConstantVector::get(), llvm::ConstantExpr::getBinOpIdentity(), llvm::Constant::getNullValue(), llvm::isa(), and llvm_unreachable.

Referenced by llvm::InstCombinerImpl::foldSelectShuffle(), foldSelectShuffleWith1Binop(), and llvm::InstCombinerImpl::foldVectorBinop().

getSimplifyQuery()

Definition at line 340 of file InstCombiner.h.

References SQ.

Referenced by llvm::GCNTTIImpl::canSimplifyLegacyMulToMul(), llvm::InstCombinerImpl::computeKnownFPClass(), llvm::InstCombinerImpl::computeKnownFPClass(), foldCtpop(), foldCttzCtlz(), foldFCmpFSubIntoFCmp(), foldFPtoI(), foldICmpAndXX(), llvm::InstCombinerImpl::foldICmpEquality(), foldSelectBinOpIdentity(), llvm::InstCombinerImpl::foldSelectShuffle(), llvm::GCNTTIImpl::instCombineIntrinsic(), simplifyAndOrWithOpReplaced(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::InstCombinerImpl::visitFNeg(), llvm::InstCombinerImpl::visitFSub(), and llvm::InstCombinerImpl::visitPHINode().

getTargetLibraryInfo()

InsertNewInstBefore()

Inserts an instruction New before instruction Old.

Also adds the new instruction to the worklist and returns New so that it is suitable for use as the return from the visitation patterns.

Definition at line 370 of file InstCombiner.h.

References assert(), and Worklist.

Referenced by llvm::InstCombinerImpl::foldIntegerTypedPHI(), foldOperationIntoSelectOperand(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::foldPHIArgBinOpIntoPHI(), llvm::InstCombinerImpl::foldPHIArgExtractValueInstructionIntoPHI(), llvm::InstCombinerImpl::foldPHIArgGEPIntoPHI(), llvm::InstCombinerImpl::foldPHIArgInsertValueInstructionIntoPHI(), llvm::InstCombinerImpl::foldPHIArgLoadIntoPHI(), llvm::InstCombinerImpl::foldPHIArgOpIntoPHI(), llvm::InstCombinerImpl::foldPHIArgZextsIntoPHI(), foldSelectZeroOrFixedOp(), InsertNewInstWith(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), and replaceGEPIdxWithZero().

InsertNewInstWith()

isBackEdge()

isCanonicalPredicate()

Predicate canonicalization reduces the number of patterns that need to be matched by other transforms.

For example, we may swap the operands of a conditional branch or select to create a compare with a canonical (inverted) predicate which is then more likely to be matched with other values.

Definition at line 162 of file InstCombiner.h.

References llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_UGE, and llvm::CmpInst::ICMP_ULE.

Referenced by canonicalizeCmpWithConstant(), llvm::InstCombinerImpl::canonicalizeICmpPredicate(), and llvm::InstCombinerImpl::visitBranchInst().

isFreeToInvert() [1/2]

bool llvm::InstCombiner::isFreeToInvert ( Value * V, bool WillInvertAllUses ) inline

isFreeToInvert() [2/2]

bool llvm::InstCombiner::isFreeToInvert ( Value * V, bool WillInvertAllUses, bool & DoesConsume ) inline

isKnownToBeAPowerOfTwo()

Definition at line 445 of file InstCombiner.h.

References llvm::Depth, llvm::isKnownToBeAPowerOfTwo(), and SQ.

Referenced by foldCtpop(), llvm::InstCombinerImpl::foldICmpEquality(), llvm::InstCombinerImpl::foldIRemByPowerOfTwoToBitTest(), simplifyValueKnownNonZero(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitUDiv(), llvm::InstCombinerImpl::visitURem(), and llvm::InstCombinerImpl::visitXor().

isValidAddrSpaceCast()

MaskedValueIsZero()

Definition at line 452 of file InstCombiner.h.

References llvm::Depth, llvm::MaskedValueIsZero(), and SQ.

Referenced by canEvaluateShiftedShift(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitAShr(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitShl(), llvm::InstCombinerImpl::visitSRem(), llvm::InstCombinerImpl::visitTrunc(), llvm::InstCombinerImpl::visitXor(), and llvm::InstCombinerImpl::visitZExt().

peekThroughBitcast()

Value * llvm::InstCombiner::peekThroughBitcast ( Value * V, bool OneUseOnly = false ) inlinestatic

replaceInstUsesWith()

A combiner-aware RAUW-like routine.

This method is to be used when an instruction is found to be dead, replaceable with another preexisting expression. Here we add all uses of I to the worklist, replace all uses of I with the new value, then return I, so that the inst combiner will know that I was modified.

Definition at line 390 of file InstCombiner.h.

References llvm::dbgs(), llvm::PoisonValue::get(), I, llvm::isa(), LLVM_DEBUG, and Worklist.

Referenced by combineConstantOffsets(), llvm::InstCombinerImpl::commonCastTransforms(), llvm::InstCombinerImpl::commonIDivRemTransforms(), llvm::InstCombinerImpl::commonIDivTransforms(), convertFSqrtDivIntoFMul(), convertNvvmIntrinsicToLlvm(), llvm::InstCombinerImpl::foldAddWithConstant(), llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(), llvm::InstCombinerImpl::foldAllocaCmp(), llvm::InstCombinerImpl::foldBinopWithRecurrence(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), foldCtpop(), foldCttzCtlz(), llvm::InstCombinerImpl::foldDeadPhiWeb(), llvm::InstCombinerImpl::foldFCmpIntToFPConst(), foldFCmpWithFloorAndCeil(), llvm::InstCombinerImpl::foldFMulReassoc(), foldFPtoI(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpAddConstant(), llvm::InstCombinerImpl::foldICmpAndConstConst(), llvm::InstCombinerImpl::foldICmpAndShift(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::InstCombinerImpl::foldICmpBinOpWithConstantViaTruthTable(), llvm::InstCombinerImpl::foldICmpBitCast(), llvm::InstCombinerImpl::foldICmpCommutative(), llvm::InstCombinerImpl::foldICmpDivConstant(), llvm::InstCombinerImpl::foldICmpOrConstant(), llvm::InstCombinerImpl::foldICmpSelectConstant(), llvm::InstCombinerImpl::foldICmpShlConstConst(), llvm::InstCombinerImpl::foldICmpShrConstConst(), llvm::InstCombinerImpl::foldICmpUsingBoolRange(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::InstCombinerImpl::foldICmpWithClamp(), llvm::InstCombinerImpl::foldICmpWithConstant(), llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), llvm::InstCombinerImpl::foldICmpWithMinMax(), llvm::InstCombinerImpl::foldIntegerTypedPHI(), llvm::InstCombinerImpl::foldItoFPtoI(), llvm::InstCombinerImpl::foldMultiplicationOverflowCheck(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::foldPowiReassoc(), llvm::InstCombinerImpl::foldSelectOpOp(), llvm::InstCombinerImpl::foldSelectShuffle(), foldSelectZeroOrFixedOp(), llvm::InstCombinerImpl::FoldShiftByConstant(), llvm::InstCombinerImpl::foldVariableSignZeroExtensionOfVariableHighBitExtract(), llvm::InstCombinerImpl::foldVectorBinop(), llvm::InstCombinerImpl::freelyInvertAllUsersOf(), handleSpaceCheckIntrinsics(), llvm::InstCombinerImpl::handleUnreachableFrom(), instCombineConvertFromSVBool(), instCombineInStreamingMode(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), instCombineLD1GatherIndex(), instCombineMaxMinNM(), instCombinePTrue(), instCombineRDFFR(), instCombineSMECntsd(), instCombineSVECmpNE(), instCombineSVECntElts(), instCombineSVECondLast(), instCombineSVEDup(), instCombineSVEDupqLane(), instCombineSVEDupX(), instCombineSVEInsr(), instCombineSVELast(), instCombineSVELD1(), instCombineSVEPTest(), instCombineSVESDIV(), instCombineSVESel(), instCombineSVESrshl(), instCombineSVETBL(), instCombineSVEUnpack(), instCombineSVEUxt(), instCombineSVEUzp1(), instCombineSVEVectorBinOp(), instCombineSVEVectorFuseMulAddSub(), instCombineSVEZip(), instCombineWhilelo(), modifyIntrinsicCall(), processPhiNode(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), llvm::InstCombinerImpl::removeInstructionsBeforeUnreachable(), replaceExtractElements(), rewriteGEPAsOffset(), simplifyAllocaArraySize(), llvm::InstCombinerImpl::SimplifyDemandedInstructionBits(), simplifyIRemMulShl(), simplifySVEIntrinsic(), simplifySVEIntrinsicBinOp(), simplifyX86MaskedLoad(), llvm::InstCombinerImpl::sinkNotIntoLogicalOp(), llvm::InstCombinerImpl::sinkNotIntoOtherHandOfLogicalOp(), llvm::InstCombinerImpl::SliceUpIllegalIntegerPHI(), tryCombineFromSVBoolBinOp(), llvm::InstCombinerImpl::tryFoldInstWithCtpopWithNot(), unpackLoadToAggregate(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitAShr(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitExtractElementInst(), llvm::InstCombinerImpl::visitExtractValueInst(), llvm::InstCombinerImpl::visitFAdd(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::InstCombinerImpl::visitFDiv(), llvm::InstCombinerImpl::visitFMul(), llvm::InstCombinerImpl::visitFNeg(), llvm::InstCombinerImpl::visitFPTrunc(), llvm::InstCombinerImpl::visitFree(), llvm::InstCombinerImpl::visitFreeze(), llvm::InstCombinerImpl::visitFRem(), llvm::InstCombinerImpl::visitFSub(), llvm::InstCombinerImpl::visitGEPOfGEP(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitInsertValueInst(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitMul(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitPHINode(), llvm::InstCombinerImpl::visitPtrToAddr(), llvm::InstCombinerImpl::visitPtrToInt(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitShl(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSRem(), llvm::InstCombinerImpl::visitSub(), llvm::InstCombinerImpl::visitTrunc(), llvm::InstCombinerImpl::visitUDiv(), llvm::InstCombinerImpl::visitURem(), llvm::InstCombinerImpl::visitXor(), and llvm::InstCombinerImpl::visitZExt().

replaceOperand()

Replace operand of instruction and add old operand to the worklist.

Definition at line 414 of file InstCombiner.h.

References I, and Worklist.

Referenced by combineConstantOffsets(), llvm::InstCombinerImpl::commonIDivRemTransforms(), llvm::InstCombinerImpl::commonIDivTransforms(), llvm::InstCombinerImpl::commonShiftTransforms(), foldCtpop(), foldCttzCtlz(), foldFabsWithFcmpZero(), foldFCmpFSubIntoFCmp(), llvm::InstCombinerImpl::foldICmpXorConstant(), llvm::InstCombinerImpl::foldPHIArgIntToPtrToPHI(), foldSelectBinOpIdentity(), foldSelectZeroOrFixedOp(), foldShuffleWithInsert(), foldSqrtWithFcmpZero(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), simplifyAllocaArraySize(), simplifyAssocCastAssoc(), llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), llvm::InstCombinerImpl::simplifyDivRemOfSelectWithZeroOp(), simplifySVEIntrinsic(), simplifySVEIntrinsicBinOp(), simplifyValueKnownNonZero(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitAtomicRMWInst(), llvm::InstCombinerImpl::visitBranchInst(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitExtractElementInst(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::InstCombinerImpl::visitFDiv(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitPHINode(), llvm::InstCombinerImpl::visitReturnInst(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSRem(), llvm::InstCombinerImpl::visitStoreInst(), and llvm::InstCombinerImpl::visitSwitchInst().

replaceUse()

void llvm::InstCombiner::replaceUse ( Use & U, Value * NewValue ) inline

shouldAvoidAbsorbingNotIntoSelect()

bool llvm::InstCombiner::shouldAvoidAbsorbingNotIntoSelect ( const SelectInst & SI) inlinestatic

SimplifyDemandedBits() [1/2]

SimplifyDemandedBits() [2/2]

SimplifyDemandedVectorElts()

virtual Value * llvm::InstCombiner::SimplifyDemandedVectorElts ( Value * V, APInt DemandedElts, APInt & UndefElts, unsigned Depth = 0, bool AllowMultipleUsers = false ) pure virtual

SubOne()

targetInstCombineIntrinsic()

targetSimplifyDemandedUseBitsIntrinsic()

targetSimplifyDemandedVectorEltsIntrinsic()

AA

AC

Definition at line 75 of file InstCombiner.h.

Referenced by llvm::InstCombinerImpl::commonShiftTransforms(), ComputeMaxSignificantBits(), ComputeNumSignBits(), getAssumptionCache(), InstCombiner(), llvm::InstCombinerImpl::InstCombinerImpl(), llvm::InstCombinerImpl::SimplifyAddWithRemainder(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitCallInst(), and llvm::InstCombinerImpl::visitFreeze().

BackEdges

Backedges, used to avoid pushing instructions across backedges in cases where this may result in infinite combine loops.

For irreducible loops this picks an arbitrary backedge.

Definition at line 99 of file InstCombiner.h.

Referenced by computeBackEdges(), and isBackEdge().

BFI

BPI

Builder

BuilderTy& llvm::InstCombiner::Builder

Definition at line 61 of file InstCombiner.h.

Referenced by canonicalizeBitCastExtElt(), llvm::InstCombinerImpl::canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract(), canonicalizeGEPOfConstGEPI8(), combineConstantOffsets(), llvm::InstCombinerImpl::combineLoadToNewType(), combineStoreToNewValue(), llvm::InstCombinerImpl::commonCastTransforms(), llvm::InstCombinerImpl::commonIDivTransforms(), llvm::InstCombinerImpl::commonShiftTransforms(), llvm::InstCombinerImpl::foldAddWithConstant(), llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(), llvm::InstCombinerImpl::foldBinOpOfSelectAndCastOfSelectCondition(), llvm::InstCombinerImpl::foldBinOpShiftWithShift(), llvm::InstCombinerImpl::foldBinopWithPhiOperands(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), foldCtpop(), foldCttzCtlz(), llvm::InstCombinerImpl::foldFMulReassoc(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpAddConstant(), llvm::InstCombinerImpl::foldICmpAndConstant(), llvm::InstCombinerImpl::foldICmpAndConstConst(), llvm::InstCombinerImpl::foldICmpAndShift(), foldICmpAndXX(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::InstCombinerImpl::foldICmpBinOpEqualityWithConstant(), llvm::InstCombinerImpl::foldICmpBinOpWithConstantViaTruthTable(), llvm::InstCombinerImpl::foldICmpBitCast(), llvm::InstCombinerImpl::foldICmpCommutative(), llvm::InstCombinerImpl::foldICmpDivConstant(), llvm::InstCombinerImpl::foldICmpEqIntrinsicWithConstant(), llvm::InstCombinerImpl::foldICmpEquality(), llvm::InstCombinerImpl::foldICmpIntrinsicWithConstant(), llvm::InstCombinerImpl::foldICmpOrConstant(), foldICmpOrXX(), llvm::InstCombinerImpl::foldICmpSelectConstant(), llvm::InstCombinerImpl::foldICmpShlConstant(), llvm::InstCombinerImpl::foldICmpShrConstant(), llvm::InstCombinerImpl::foldICmpSRemConstant(), llvm::InstCombinerImpl::foldICmpSubConstant(), llvm::InstCombinerImpl::foldICmpTruncConstant(), llvm::InstCombinerImpl::foldICmpTruncWithTruncOrExt(), llvm::InstCombinerImpl::foldICmpUsingBoolRange(), llvm::InstCombinerImpl::foldICmpWithClamp(), llvm::InstCombinerImpl::foldICmpWithConstant(), llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), foldICmpWithLowBitMaskedVal(), llvm::InstCombinerImpl::foldICmpWithTrunc(), llvm::InstCombinerImpl::foldICmpWithZextOrSext(), llvm::InstCombinerImpl::foldICmpXorShiftConst(), foldIdempotentBinaryIntrinsicRecurrence(), llvm::InstCombinerImpl::foldIRemByPowerOfTwoToBitTest(), llvm::InstCombinerImpl::foldIsMultipleOfAPowerOfTwo(), foldLogicCastConstant(), llvm::InstCombinerImpl::foldMultiplicationOverflowCheck(), llvm::InstCombinerImpl::foldPowiReassoc(), llvm::InstCombinerImpl::foldPtrToIntOrAddrOfGEP(), llvm::InstCombinerImpl::foldReversedIntrinsicOperands(), llvm::InstCombinerImpl::foldSelectICmp(), llvm::InstCombinerImpl::foldSelectIntoOp(), llvm::InstCombinerImpl::foldSelectOpOp(), llvm::InstCombinerImpl::foldSelectShuffle(), llvm::InstCombinerImpl::FoldShiftByConstant(), llvm::InstCombinerImpl::foldShuffledIntrinsicOperands(), llvm::InstCombinerImpl::foldSquareSumFP(), llvm::InstCombinerImpl::foldSquareSumInt(), llvm::InstCombinerImpl::foldUsingDistributiveLaws(), llvm::InstCombinerImpl::foldVariableSignZeroExtensionOfVariableHighBitExtract(), foldVecExtTruncToExtElt(), llvm::InstCombinerImpl::foldVectorBinop(), foldVecTruncToExtElt(), freelyInvert(), getFreelyInverted(), getFreelyInverted(), getFreelyInvertedImpl(), getShiftedValue(), llvm::GCNTTIImpl::hoistLaneIntrinsicThroughOperand(), llvm::InstCombinerImpl::insertRangeTest(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::PPCTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), instCombineLD1GatherIndex(), InstCombiner(), instCombineRDFFR(), llvm::InstCombinerImpl::InstCombinerImpl(), instCombineSMECntsd(), instCombineST1ScatterIndex(), instCombineSVECmpNE(), instCombineSVECntElts(), instCombineSVECondLast(), instCombineSVEDup(), instCombineSVEDupqLane(), instCombineSVEDupX(), instCombineSVELast(), instCombineSVELD1(), instCombineSVEPTest(), instCombineSVESDIV(), instCombineSVESel(), instCombineSVESrshl(), instCombineSVEST1(), instCombineSVETBL(), instCombineSVEUnpack(), instCombineSVEUxt(), instCombineSVEUzp1(), instCombineSVEVectorBinOp(), instCombineSVEVectorFuseMulAddSub(), instCombineWhilelo(), matchDeMorgansLaws(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), modifyIntrinsicCall(), narrowUDivURem(), llvm::Negator::Negate(), optimizeIntegerToVectorInsertions(), llvm::InstCombinerImpl::OptimizePointerDifference(), optimizeVectorResizeWithIntegerBitCasts(), processPhiNode(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), llvm::InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(), llvm::InstCombinerImpl::reassociateShiftAmtsOfTwoSameDirectionShifts(), llvm::InstCombinerImpl::run(), llvm::InstCombinerImpl::SimplifyAddWithRemainder(), simplifyAllocaArraySize(), llvm::GCNTTIImpl::simplifyAMDGCNLaneIntrinsicDemanded(), simplifyAMDGCNMemoryIntrinsicDemanded(), simplifyAndOrWithOpReplaced(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), llvm::InstCombinerImpl::simplifyBinOpSplats(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::X86TTIImpl::simplifyDemandedVectorEltsIntrinsic(), simplifyInvariantGroupIntrinsic(), llvm::InstCombinerImpl::simplifyRangeCheck(), llvm::InstCombinerImpl::SimplifySelectsFeedingBinaryOp(), simplifyShiftSelectingPackedElement(), simplifySVEIntrinsicBinOp(), simplifyUsingControlFlow(), simplifyValueKnownNonZero(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), llvm::InstCombinerImpl::sinkNotIntoLogicalOp(), llvm::InstCombinerImpl::sinkNotIntoOtherHandOfLogicalOp(), llvm::InstCombinerImpl::SliceUpIllegalIntegerPHI(), llvm::InstCombinerImpl::takeLog2(), transformToIndexedCompare(), tryCombineFromSVBoolBinOp(), llvm::InstCombinerImpl::tryFactorizationFolds(), llvm::InstCombinerImpl::tryFoldInstWithCtpopWithNot(), unpackLoadToAggregate(), unpackStoreToAggregate(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitAShr(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitBranchInst(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitExtractElementInst(), llvm::InstCombinerImpl::visitExtractValueInst(), llvm::InstCombinerImpl::visitFAdd(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::InstCombinerImpl::visitFDiv(), llvm::InstCombinerImpl::visitFMul(), llvm::InstCombinerImpl::visitFNeg(), llvm::InstCombinerImpl::visitFPTrunc(), llvm::InstCombinerImpl::visitFSub(), llvm::InstCombinerImpl::visitGEPOfGEP(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitIntToPtr(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitMul(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitPtrToAddr(), llvm::InstCombinerImpl::visitPtrToInt(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitShl(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSRem(), llvm::InstCombinerImpl::visitSub(), llvm::InstCombinerImpl::visitSwitchInst(), llvm::InstCombinerImpl::visitTrunc(), llvm::InstCombinerImpl::visitUDiv(), llvm::InstCombinerImpl::visitURem(), llvm::InstCombinerImpl::visitXor(), and llvm::InstCombinerImpl::visitZExt().

ComputedBackEdges

bool llvm::InstCombiner::ComputedBackEdges = false protected

DC

DeadEdges

DL

Definition at line 78 of file InstCombiner.h.

Referenced by ComputeMaxSignificantBits(), ComputeNumSignBits(), llvm::InstCombinerImpl::foldBinOpShiftWithShift(), llvm::InstCombinerImpl::foldBinopWithPhiOperands(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), llvm::InstCombinerImpl::foldFMulReassoc(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpBinOpWithConstantViaTruthTable(), llvm::InstCombinerImpl::foldICmpInstWithConstantNotInt(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::InstCombinerImpl::foldICmpWithCastOp(), llvm::InstCombinerImpl::foldICmpWithConstant(), llvm::InstCombinerImpl::foldICmpWithZextOrSext(), llvm::InstCombinerImpl::foldIntegerTypedPHI(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::foldPHIArgZextsIntoPHI(), llvm::InstCombinerImpl::foldPtrToIntOrAddrOfGEP(), llvm::InstCombinerImpl::foldSelectICmp(), llvm::InstCombinerImpl::foldSelectShuffle(), llvm::InstCombinerImpl::FoldShiftByConstant(), llvm::InstCombinerImpl::foldVectorBinop(), getDataLayout(), InstCombiner(), llvm::InstCombinerImpl::InstCombinerImpl(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), llvm::InstCombinerImpl::OptimizePointerDifference(), llvm::InstCombinerImpl::prepareWorklist(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), llvm::InstCombinerImpl::SimplifyDemandedInstructionBits(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::tryFoldInstWithCtpopWithNot(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFAdd(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::InstCombinerImpl::visitFMul(), llvm::InstCombinerImpl::visitFNeg(), llvm::InstCombinerImpl::visitFree(), llvm::InstCombinerImpl::visitFSub(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitIntToPtr(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitMul(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitPtrToInt(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSub(), and llvm::InstCombinerImpl::visitTrunc().

DT

Definition at line 77 of file InstCombiner.h.

Referenced by llvm::InstCombinerImpl::commonCastTransforms(), ComputeMaxSignificantBits(), ComputeNumSignBits(), llvm::InstCombinerImpl::convertOrOfShiftsToFunnelShift(), llvm::InstCombinerImpl::dominatesAllUses(), llvm::InstCombinerImpl::foldBinopWithPhiOperands(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), llvm::InstCombinerImpl::foldIntegerTypedPHI(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::freezeOtherUses(), getDominatorTree(), llvm::InstCombinerImpl::handlePotentiallyDeadBlocks(), InstCombiner(), llvm::InstCombinerImpl::InstCombinerImpl(), llvm::InstCombinerImpl::prepareWorklist(), llvm::InstCombinerImpl::run(), llvm::InstCombinerImpl::SimplifyAddWithRemainder(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitBranchInst(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFreeze(), llvm::InstCombinerImpl::visitOr(), and llvm::InstCombinerImpl::visitZExt().

F

Definition at line 67 of file InstCombiner.h.

Referenced by llvm::InstCombinerImpl::foldVectorBinop(), InstCombiner(), llvm::InstCombinerImpl::InstCombinerImpl(), llvm::InstCombinerImpl::prepareWorklist(), llvm::InstCombinerImpl::SimplifySelectsFeedingBinaryOp(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitFAdd(), llvm::InstCombinerImpl::visitFSub(), llvm::InstCombinerImpl::visitReturnInst(), llvm::InstCombinerImpl::visitXor(), and llvm::InstCombinerImpl::~InstCombinerImpl().

MadeIRChange

bool llvm::InstCombiner::MadeIRChange = false protected

MaxArraySizeForCombine

uint64_t llvm::InstCombiner::MaxArraySizeForCombine = 0

MinimizeSize

ORE

PredOrder

Order of predecessors to canonicalize phi nodes towards.

Definition at line 94 of file InstCombiner.h.

PSI

RPOT

SQ

Definition at line 79 of file InstCombiner.h.

Referenced by llvm::InstCombinerImpl::commonCastTransforms(), llvm::InstCombinerImpl::commonShiftTransforms(), computeKnownBits(), computeKnownBits(), computeOverflowForSignedAdd(), computeOverflowForSignedMul(), computeOverflowForSignedSub(), computeOverflowForUnsignedAdd(), computeOverflowForUnsignedMul(), computeOverflowForUnsignedSub(), llvm::InstCombinerImpl::foldAddWithConstant(), llvm::InstCombinerImpl::foldICmpAddConstant(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::InstCombinerImpl::foldICmpBinOpEqualityWithConstant(), llvm::InstCombinerImpl::foldICmpCommutative(), llvm::InstCombinerImpl::foldICmpIntrinsicWithConstant(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::InstCombinerImpl::foldICmpWithMinMax(), llvm::InstCombinerImpl::foldICmpWithZero(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::foldSelectICmp(), llvm::InstCombinerImpl::foldSignBitTest(), llvm::InstCombinerImpl::foldUsingDistributiveLaws(), llvm::InstCombinerImpl::foldVectorSelect(), getSimplifyQuery(), InstCombiner(), isKnownToBeAPowerOfTwo(), MaskedValueIsZero(), llvm::InstCombinerImpl::reassociateShiftAmtsOfTwoSameDirectionShifts(), llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), SimplifyDemandedBits(), llvm::InstCombinerImpl::SimplifyDemandedInstructionBits(), llvm::InstCombinerImpl::SimplifySelectsFeedingBinaryOp(), llvm::InstCombinerImpl::tryFactorizationFolds(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitAShr(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitExtractElementInst(), llvm::InstCombinerImpl::visitExtractValueInst(), llvm::InstCombinerImpl::visitFAdd(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::InstCombinerImpl::visitFDiv(), llvm::InstCombinerImpl::visitFMul(), llvm::InstCombinerImpl::visitFreeze(), llvm::InstCombinerImpl::visitFRem(), llvm::InstCombinerImpl::visitGEPOfGEP(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitInsertValueInst(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitMul(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitPHINode(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitShl(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSIToFP(), llvm::InstCombinerImpl::visitSRem(), llvm::InstCombinerImpl::visitSub(), llvm::InstCombinerImpl::visitTrunc(), llvm::InstCombinerImpl::visitUDiv(), llvm::InstCombinerImpl::visitUIToFP(), llvm::InstCombinerImpl::visitURem(), llvm::InstCombinerImpl::visitXor(), llvm::InstCombinerImpl::visitZExt(), and llvm::InstCombinerImpl::~InstCombinerImpl().

TLI

Definition at line 76 of file InstCombiner.h.

Referenced by llvm::InstCombinerImpl::fmulByZeroIsZero(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), getTargetLibraryInfo(), InstCombiner(), llvm::InstCombinerImpl::InstCombinerImpl(), llvm::InstCombinerImpl::prepareWorklist(), llvm::InstCombinerImpl::run(), llvm::InstCombinerImpl::tryToSinkInstruction(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFDiv(), and llvm::InstCombinerImpl::visitFree().

Worklist

A worklist of the instructions that need to be simplified.

Definition at line 65 of file InstCombiner.h.

Referenced by llvm::InstCombinerImpl::addDeadEdge(), addToWorklist(), llvm::InstCombinerImpl::eraseInstFromFunction(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::handlePotentiallyDeadBlocks(), llvm::InstCombinerImpl::handlePotentiallyDeadSuccessors(), llvm::InstCombinerImpl::handleUnreachableFrom(), InsertNewInstBefore(), InstCombiner(), llvm::InstCombinerImpl::InstCombinerImpl(), llvm::InstCombinerImpl::matchBSwapOrBitReverse(), llvm::InstCombinerImpl::prepareWorklist(), llvm::InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(), llvm::InstCombinerImpl::replaceInInstruction(), replaceInstUsesWith(), replaceOperand(), replaceUse(), llvm::InstCombinerImpl::run(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), llvm::InstCombinerImpl::simplifyDivRemOfSelectWithZeroOp(), llvm::InstCombinerImpl::tryToSinkInstruction(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitBranchInst(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitExtractElementInst(), and llvm::InstCombinerImpl::visitStoreInst().


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