LLVM 20.0.0git
|
The core instruction combiner logic. More...
#include "llvm/Transforms/InstCombine/InstCombiner.h"
Public Types | |
using | BuilderTy = IRBuilder< TargetFolder, IRBuilderCallbackInserter > |
An IRBuilder that automatically inserts new instructions into the worklist. | |
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 (CmpInst::Predicate 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 std::optional< std::pair< CmpInst::Predicate, Constant * > > | getFlippedStrictnessPredicateAndConstant (CmpInst::Predicate Pred, Constant *C) |
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. | |
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 |
LoopInfo * | LI |
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. | |
The core instruction combiner logic.
This class provides both the logic to recursively visit instructions and combine them.
Definition at line 47 of file InstCombiner.h.
An IRBuilder that automatically inserts new instructions into the worklist.
Definition at line 59 of file InstCombiner.h.
|
inline |
Definition at line 96 of file InstCombiner.h.
|
virtualdefault |
Add one to a Constant.
Definition at line 175 of file InstCombiner.h.
References C.
Referenced by llvm::InstCombinerImpl::foldAddWithConstant(), llvm::InstCombinerImpl::visitAdd(), and llvm::InstCombinerImpl::visitSub().
|
inline |
Definition at line 336 of file InstCombiner.h.
References I, and llvm::InstructionWorklist::push().
Referenced by llvm::InstCombinerImpl::addDeadEdge(), llvm::InstCombinerImpl::freelyInvertAllUsersOf(), getShiftedValue(), llvm::InstCombinerImpl::handleUnreachableFrom(), processUMulZExtIdiom(), replaceExtractElements(), rewriteGEPAsOffset(), and llvm::X86TTIImpl::simplifyDemandedVectorEltsIntrinsic().
|
inline |
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 248 of file InstCombiner.h.
References assert(), I, and llvm::PatternMatch::match().
Referenced by canFreelyInvert(), llvm::InstCombinerImpl::canonicalizeICmpPredicate(), llvm::InstCombinerImpl::sinkNotIntoLogicalOp(), and llvm::InstCombinerImpl::sinkNotIntoOtherHandOfLogicalOp().
|
inline |
Definition at line 431 of file InstCombiner.h.
References llvm::computeKnownBits(), llvm::Depth, and llvm::SimplifyQuery::getWithInstruction().
Referenced by canReplaceGEPIdxWithZero(), llvm::InstCombinerImpl::convertOrOfShiftsToFunnelShift(), llvm::InstCombinerImpl::foldAddWithConstant(), foldCtpop(), foldCttzCtlz(), llvm::InstCombinerImpl::foldICmpAndConstConst(), foldICmpAndXX(), llvm::InstCombinerImpl::foldICmpBinOp(), llvm::InstCombinerImpl::foldICmpTruncConstant(), llvm::InstCombinerImpl::foldICmpWithZero(), isKnownExactCastIntToFP(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::simplifyRangeCheck(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitSDiv(), and llvm::InstCombinerImpl::visitSwitchInst().
|
inline |
Definition at line 436 of file InstCombiner.h.
References llvm::computeKnownBits(), llvm::Depth, and llvm::SimplifyQuery::getWithInstruction().
|
inline |
Definition at line 457 of file InstCombiner.h.
References llvm::ComputeMaxSignificantBits(), llvm::Depth, and DL.
Referenced by processUGT_ADDCST_ADD(), and llvm::InstCombinerImpl::visitTrunc().
|
inline |
Definition at line 452 of file InstCombiner.h.
References llvm::ComputeNumSignBits(), llvm::Depth, and DL.
Referenced by canEvaluateTruncated(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::visitAdd(), and llvm::InstCombinerImpl::visitSExt().
|
inline |
Definition at line 485 of file InstCombiner.h.
References llvm::computeOverflowForSignedAdd(), llvm::SimplifyQuery::getWithInstruction(), LHS, and RHS.
Referenced by llvm::InstCombinerImpl::computeOverflow().
|
inline |
Definition at line 470 of file InstCombiner.h.
References llvm::computeOverflowForSignedMul(), llvm::SimplifyQuery::getWithInstruction(), LHS, and RHS.
Referenced by llvm::InstCombinerImpl::computeOverflow().
|
inline |
Definition at line 499 of file InstCombiner.h.
References llvm::computeOverflowForSignedSub(), llvm::SimplifyQuery::getWithInstruction(), LHS, and RHS.
Referenced by llvm::InstCombinerImpl::computeOverflow().
|
inline |
Definition at line 477 of file InstCombiner.h.
References llvm::computeOverflowForUnsignedAdd(), llvm::SimplifyQuery::getWithInstruction(), LHS, and RHS.
Referenced by llvm::InstCombinerImpl::computeOverflow().
|
inline |
Definition at line 462 of file InstCombiner.h.
References llvm::computeOverflowForUnsignedMul(), llvm::SimplifyQuery::getWithInstruction(), LHS, and RHS.
Referenced by llvm::InstCombinerImpl::computeOverflow().
|
inline |
Definition at line 492 of file InstCombiner.h.
References llvm::computeOverflowForUnsignedSub(), llvm::SimplifyQuery::getWithInstruction(), LHS, and RHS.
Referenced by llvm::InstCombinerImpl::computeOverflow().
|
pure virtual |
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.
Referenced by llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::ARMTTIImpl::instCombineIntrinsic(), instCombineST1ScatterIndex(), instCombineSVENoActiveUnaryErase(), instCombineSVENoActiveUnaryZero(), instCombineSVEST1(), modifyIntrinsicCall(), and simplifyX86MaskedStore().
|
inline |
Definition at line 338 of file InstCombiner.h.
Referenced by llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::PPCTTIImpl::instCombineIntrinsic(), and llvm::InstCombinerImpl::visitCallInst().
|
inline |
Definition at line 346 of file InstCombiner.h.
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 -> Other non-instructions 3 -> Arguments 4 -> Cast and (f)neg/not instructions 5 -> Other instructions
Definition at line 139 of file InstCombiner.h.
References llvm::PatternMatch::m_FNeg(), and llvm::PatternMatch::match().
Referenced by llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), llvm::InstCombinerImpl::visitFCmpInst(), and llvm::InstCombinerImpl::visitICmpInst().
|
inline |
Definition at line 341 of file InstCombiner.h.
References DL.
Referenced by canEvaluateTruncated(), canonicalizeGEPOfConstGEPI8(), canReplaceGEPIdxWithZero(), combineLoadToOperationType(), foldVecTruncToExtElt(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::PPCTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), likeBitCastFromVector(), llvm::Negator::Negate(), optimizeIntegerToVectorInsertions(), optimizeVectorResizeWithIntegerBitCasts(), simplifyAllocaArraySize(), simplifyAMDGCNMemoryIntrinsicDemanded(), simplifyAssocCastAssoc(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), unpackLoadToAggregate(), and unpackStoreToAggregate().
|
inline |
Definition at line 340 of file InstCombiner.h.
Referenced by llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::PPCTTIImpl::instCombineIntrinsic(), and llvm::InstCombinerImpl::visitCallInst().
|
static |
Definition at line 6831 of file InstCombineCompares.cpp.
References assert(), llvm::CallingConv::C, llvm::ConstantExpr::getAdd(), llvm::CmpInst::getFlippedStrictnessPredicate(), llvm::ICmpInst::getUnsignedPredicate(), llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::isIntPredicate(), llvm::ICmpInst::isRelational(), llvm::CmpInst::isSigned(), and llvm::Constant::replaceUndefsWith().
Referenced by canonicalizeCmpWithConstant(), llvm::InstCombinerImpl::foldICmpShlConstant(), and llvm::InstCombinerImpl::matchThreeWayIntCompare().
|
inline |
Definition at line 220 of file InstCombiner.h.
|
inline |
Definition at line 213 of file InstCombiner.h.
Referenced by foldICmpAndXX(), llvm::InstCombinerImpl::foldICmpBitCast(), foldICmpOrXX(), foldICmpWithLowBitMaskedVal(), llvm::InstCombinerImpl::tryFoldInstWithCtpopWithNot(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitICmpInst(), and llvm::InstCombinerImpl::visitSub().
Value * InstCombiner::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.
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 2520 of file InstructionCombining.cpp.
References A, llvm::PHINode::addIncoming(), assert(), B, Builder, llvm::CallingConv::C, Cond, llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateAShr(), llvm::IRBuilderBase::CreateBinaryIntrinsic(), llvm::IRBuilderBase::CreateBinOp(), llvm::IRBuilderBase::CreateCmp(), llvm::IRBuilderBase::CreateLogicalOp(), llvm::IRBuilderBase::CreatePHI(), llvm::IRBuilderBase::CreateSelect(), llvm::IRBuilderBase::CreateSExt(), llvm::IRBuilderBase::CreateSub(), llvm::IRBuilderBase::CreateTrunc(), llvm::IRBuilderBase::CreateXor(), llvm::Depth, 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::PatternMatch::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, llvm::IRBuilderBase::SetInsertPoint(), and shouldAvoidAbsorbingNotIntoSelect().
Referenced by getFreelyInvertedImpl().
|
inline |
Definition at line 348 of file InstCombiner.h.
|
inline |
Definition at line 343 of file InstCombiner.h.
|
inline |
Definition at line 347 of file InstCombiner.h.
|
inlinestatic |
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 284 of file InstCombiner.h.
References assert(), C, and llvm_unreachable.
Referenced by llvm::InstCombinerImpl::foldSelectShuffle(), foldSelectShuffleWith1Binop(), and llvm::InstCombinerImpl::foldVectorBinop().
|
inline |
Definition at line 342 of file InstCombiner.h.
Referenced by llvm::GCNTTIImpl::canSimplifyLegacyMulToMul(), foldCtpop(), foldCttzCtlz(), foldFCmpFSubIntoFCmp(), foldFPtoI(), foldICmpAndXX(), foldSelectBinOpIdentity(), llvm::InstCombinerImpl::foldSelectShuffle(), llvm::GCNTTIImpl::instCombineIntrinsic(), simplifyAndOrWithOpReplaced(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFCmpInst(), llvm::InstCombinerImpl::visitFNeg(), llvm::InstCombinerImpl::visitFSub(), and llvm::InstCombinerImpl::visitPHINode().
|
inline |
Definition at line 339 of file InstCombiner.h.
|
inline |
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 366 of file InstCombiner.h.
References llvm::InstructionWorklist::add(), and assert().
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(), foldSelectZeroOrMul(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), and replaceGEPIdxWithZero().
|
inline |
Same as InsertNewInstBefore, but also sets the debug loc.
Definition at line 375 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::EvaluateInDifferentType(), getShiftedValue(), replaceExtractElements(), llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), and llvm::InstCombinerImpl::simplifyShrShlDemandedBits().
|
inlinestatic |
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 157 of file InstCombiner.h.
Referenced by canonicalizeCmpWithConstant(), llvm::InstCombinerImpl::canonicalizeICmpPredicate(), and llvm::InstCombinerImpl::visitBranchInst().
Definition at line 238 of file InstCombiner.h.
|
inline |
Return true if the specified value is free to invert (apply ~ to).
This happens in cases where the ~ can be eliminated. If WillInvertAllUses is true, work under the assumption that the caller intends to remove all uses of V and only keep uses of ~V.
See also: canFreelyInvertAllUsersOf()
Definition at line 232 of file InstCombiner.h.
Referenced by canFreelyInvert(), matchDeMorgansLaws(), llvm::InstCombinerImpl::tryFoldInstWithCtpopWithNot(), llvm::InstCombinerImpl::visitAdd(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitICmpInst(), and llvm::InstCombinerImpl::visitSub().
|
inline |
Definition at line 441 of file InstCombiner.h.
References llvm::Depth, DL, and llvm::isKnownToBeAPowerOfTwo().
Referenced by foldCtpop(), llvm::InstCombinerImpl::foldICmpEquality(), llvm::InstCombinerImpl::foldIRemByPowerOfTwoToBitTest(), simplifyValueKnownNonZero(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitURem(), and llvm::InstCombinerImpl::visitXor().
Definition at line 189 of file InstructionCombining.cpp.
References llvm::TargetTransformInfo::isValidAddrSpaceCast().
|
inline |
Definition at line 447 of file InstCombiner.h.
References llvm::Depth, llvm::SimplifyQuery::getWithInstruction(), and llvm::MaskedValueIsZero().
Referenced by canEvaluateShiftedShift(), canEvaluateTruncated(), canEvaluateZExtd(), llvm::InstCombinerImpl::foldAddWithConstant(), 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().
|
inlinestatic |
Return the source operand of a potentially bitcasted value while optionally checking if it has one use.
If there is no bitcast or the one use check is not met, return the input value itself.
Definition at line 113 of file InstCombiner.h.
Referenced by llvm::X86TTIImpl::instCombineIntrinsic().
|
inline |
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 386 of file InstCombiner.h.
References llvm::dbgs(), I, LLVM_DEBUG, and llvm::InstructionWorklist::pushUsersToWorkList().
Referenced by llvm::InstCombinerImpl::commonCastTransforms(), llvm::InstCombinerImpl::commonIDivTransforms(), llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(), llvm::InstCombinerImpl::foldAllocaCmp(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), foldCtpop(), foldCttzCtlz(), llvm::InstCombinerImpl::foldFCmpIntToFPConst(), llvm::InstCombinerImpl::foldFMulReassoc(), foldFPtoI(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpAddConstant(), llvm::InstCombinerImpl::foldICmpAndConstant(), llvm::InstCombinerImpl::foldICmpAndConstConst(), llvm::InstCombinerImpl::foldICmpAndShift(), llvm::InstCombinerImpl::foldICmpBinOp(), 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::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(), foldSelectZeroOrMul(), llvm::InstCombinerImpl::FoldShiftByConstant(), llvm::InstCombinerImpl::foldVariableSignZeroExtensionOfVariableHighBitExtract(), llvm::InstCombinerImpl::freelyInvertAllUsersOf(), llvm::InstCombinerImpl::handleUnreachableFrom(), instCombineConvertFromSVBool(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), instCombineLD1GatherIndex(), instCombineMaxMinNM(), instCombineRDFFR(), instCombineSVEAllOrNoActive(), instCombineSVECmpNE(), instCombineSVECntElts(), instCombineSVECondLast(), instCombineSVEDup(), instCombineSVEDupqLane(), instCombineSVEDupX(), instCombineSVELast(), instCombineSVELD1(), instCombineSVENoActiveUnaryZero(), instCombineSVEPTest(), instCombineSVESDIV(), instCombineSVESel(), instCombineSVESrshl(), instCombineSVETBL(), instCombineSVEUnpack(), instCombineSVEUzp1(), instCombineSVEVectorBinOp(), instCombineSVEVectorFuseMulAddSub(), instCombineSVEVectorMul(), instCombineSVEZip(), modifyIntrinsicCall(), processPhiNode(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), llvm::InstCombinerImpl::removeInstructionsBeforeUnreachable(), replaceExtractElements(), rewriteGEPAsOffset(), simplifyAllocaArraySize(), llvm::InstCombinerImpl::SimplifyDemandedInstructionBits(), simplifyIRemMulShl(), 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::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().
|
inline |
Replace operand of instruction and add old operand to the worklist.
Definition at line 410 of file InstCombiner.h.
References llvm::InstructionWorklist::handleUseCountDecrement(), and I.
Referenced by llvm::InstCombinerImpl::commonIDivTransforms(), llvm::InstCombinerImpl::commonIRemTransforms(), llvm::InstCombinerImpl::commonShiftTransforms(), foldCtpop(), foldCttzCtlz(), foldFabsWithFcmpZero(), foldFCmpFSubIntoFCmp(), llvm::InstCombinerImpl::foldICmpAndConstConst(), llvm::InstCombinerImpl::foldICmpAndShift(), llvm::InstCombinerImpl::foldICmpXorConstant(), llvm::InstCombinerImpl::foldPHIArgIntToPtrToPHI(), foldSelectBinOpIdentity(), foldSelectZeroOrMul(), foldShuffleWithInsert(), foldSqrtWithFcmpZero(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), simplifyAllocaArraySize(), simplifyAssocCastAssoc(), llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), llvm::InstCombinerImpl::simplifyDivRemOfSelectWithZeroOp(), 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::visitGEPOfGEP(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitPHINode(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSRem(), llvm::InstCombinerImpl::visitStoreInst(), and llvm::InstCombinerImpl::visitSwitchInst().
Replace use and add the previously used value to the worklist.
Definition at line 418 of file InstCombiner.h.
References llvm::InstructionWorklist::handleUseCountDecrement().
Referenced by llvm::InstCombinerImpl::addDeadEdge(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(), llvm::InstCombinerImpl::SimplifyDemandedBits(), llvm::InstCombinerImpl::SimplifyDemandedFPClass(), llvm::InstCombinerImpl::simplifyDivRemOfSelectWithZeroOp(), and llvm::InstCombinerImpl::visitCallInst().
|
inlinestatic |
Definition at line 191 of file InstCombiner.h.
References llvm::PatternMatch::match(), and SI().
Referenced by getFreelyInvertedImpl().
|
inline |
Definition at line 509 of file InstCombiner.h.
References llvm::SimplifyQuery::getWithInstruction(), and I.
|
pure virtual |
Implemented in llvm::InstCombinerImpl, and llvm::InstCombinerImpl.
Referenced by llvm::ARMTTIImpl::instCombineIntrinsic().
|
pure virtual |
Implemented in llvm::InstCombinerImpl.
Referenced by llvm::X86TTIImpl::instCombineIntrinsic().
Subtract one from a Constant.
Definition at line 180 of file InstCombiner.h.
References C.
Referenced by llvm::InstCombinerImpl::foldAddWithConstant(), llvm::InstCombinerImpl::foldICmpAndConstant(), llvm::InstCombinerImpl::visitAdd(), and llvm::InstCombinerImpl::visitSub().
std::optional< Instruction * > InstCombiner::targetInstCombineIntrinsic | ( | IntrinsicInst & | II | ) |
Definition at line 156 of file InstructionCombining.cpp.
References II, and llvm::TargetTransformInfo::instCombineIntrinsic().
Referenced by llvm::InstCombinerImpl::visitCallInst().
std::optional< Value * > InstCombiner::targetSimplifyDemandedUseBitsIntrinsic | ( | IntrinsicInst & | II, |
APInt | DemandedMask, | ||
KnownBits & | Known, | ||
bool & | KnownBitsComputed | ||
) |
Definition at line 164 of file InstructionCombining.cpp.
References II, and llvm::TargetTransformInfo::simplifyDemandedUseBitsIntrinsic().
Referenced by llvm::InstCombinerImpl::SimplifyDemandedUseBits().
std::optional< Value * > InstCombiner::targetSimplifyDemandedVectorEltsIntrinsic | ( | IntrinsicInst & | II, |
APInt | DemandedElts, | ||
APInt & | UndefElts, | ||
APInt & | UndefElts2, | ||
APInt & | UndefElts3, | ||
std::function< void(Instruction *, unsigned, APInt, APInt &)> | SimplifyAndSetOp | ||
) |
Definition at line 175 of file InstructionCombining.cpp.
References II, and llvm::TargetTransformInfo::simplifyDemandedVectorEltsIntrinsic().
Referenced by llvm::InstCombinerImpl::SimplifyDemandedVectorElts().
|
protected |
Definition at line 69 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitLoadInst(), and llvm::InstCombinerImpl::visitStoreInst().
|
protected |
Definition at line 72 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::commonShiftTransforms(), llvm::InstCombinerImpl::SimplifyAddWithRemainder(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), llvm::InstCombinerImpl::visitAllocaInst(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitLoadInst(), and llvm::InstCombinerImpl::visitStoreInst().
|
protected |
Definition at line 78 of file InstCombiner.h.
|
protected |
Definition at line 79 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::freelyInvertAllUsersOf(), and llvm::InstCombinerImpl::visitBranchInst().
BuilderTy& llvm::InstCombiner::Builder |
Definition at line 60 of file InstCombiner.h.
Referenced by canonicalizeBitCastExtElt(), llvm::InstCombinerImpl::canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract(), canonicalizeGEPOfConstGEPI8(), llvm::InstCombinerImpl::combineLoadToNewType(), combineStoreToNewValue(), llvm::InstCombinerImpl::commonCastTransforms(), llvm::InstCombinerImpl::commonIDivTransforms(), llvm::InstCombinerImpl::commonShiftTransforms(), llvm::InstCombinerImpl::foldAddWithConstant(), 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::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::foldICmpWithConstant(), llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), foldICmpWithLowBitMaskedVal(), llvm::InstCombinerImpl::foldICmpWithTrunc(), llvm::InstCombinerImpl::foldICmpWithZextOrSext(), llvm::InstCombinerImpl::foldICmpXorShiftConst(), llvm::InstCombinerImpl::foldIRemByPowerOfTwoToBitTest(), foldLogicCastConstant(), llvm::InstCombinerImpl::foldMultiplicationOverflowCheck(), llvm::InstCombinerImpl::foldPowiReassoc(), llvm::InstCombinerImpl::foldSelectICmp(), llvm::InstCombinerImpl::foldSelectIntoOp(), llvm::InstCombinerImpl::foldSelectOpOp(), llvm::InstCombinerImpl::foldSelectShuffle(), llvm::InstCombinerImpl::FoldShiftByConstant(), llvm::InstCombinerImpl::foldSquareSumFP(), llvm::InstCombinerImpl::foldSquareSumInt(), llvm::InstCombinerImpl::foldUsingDistributiveLaws(), llvm::InstCombinerImpl::foldVariableSignZeroExtensionOfVariableHighBitExtract(), llvm::InstCombinerImpl::foldVectorBinop(), foldVecTruncToExtElt(), freelyInvert(), getFreelyInvertedImpl(), getShiftedValue(), llvm::InstCombinerImpl::insertRangeTest(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::PPCTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), instCombineLD1GatherIndex(), instCombineRDFFR(), instCombineST1ScatterIndex(), instCombineSVECmpNE(), instCombineSVECntElts(), instCombineSVECondLast(), instCombineSVEDupqLane(), instCombineSVEDupX(), instCombineSVELast(), instCombineSVELD1(), instCombineSVEPTest(), instCombineSVESDIV(), instCombineSVESel(), instCombineSVESrshl(), instCombineSVEST1(), instCombineSVETBL(), instCombineSVEUnpack(), instCombineSVEUzp1(), instCombineSVEVectorBinOp(), instCombineSVEVectorFuseMulAddSub(), 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(), simplifyAMDGCNMemoryIntrinsicDemanded(), simplifyAndOrWithOpReplaced(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), llvm::InstCombinerImpl::simplifyBinOpSplats(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), llvm::X86TTIImpl::simplifyDemandedVectorEltsIntrinsic(), simplifyInvariantGroupIntrinsic(), llvm::InstCombinerImpl::simplifyRangeCheck(), llvm::InstCombinerImpl::SimplifySelectsFeedingBinaryOp(), simplifyUsingControlFlow(), simplifyValueKnownNonZero(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), llvm::InstCombinerImpl::sinkNotIntoLogicalOp(), llvm::InstCombinerImpl::sinkNotIntoOtherHandOfLogicalOp(), llvm::InstCombinerImpl::SliceUpIllegalIntegerPHI(), transformToIndexedCompare(), tryCombineFromSVBoolBinOp(), llvm::InstCombinerImpl::tryFactorizationFolds(), llvm::InstCombinerImpl::tryFoldInstWithCtpopWithNot(), unpackLoadToAggregate(), unpackStoreToAggregate(), llvm::InstCombinerImpl::visitAdd(), 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::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().
|
protected |
Definition at line 81 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), and llvm::InstCombinerImpl::visitBranchInst().
|
protected |
Edges that are known to never be taken.
Definition at line 90 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::addDeadEdge(), llvm::InstCombinerImpl::handlePotentiallyDeadBlocks(), and llvm::InstCombinerImpl::prepareWorklist().
|
protected |
Definition at line 75 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::commonCastTransforms(), llvm::InstCombinerImpl::EvaluateInDifferentType(), llvm::InstCombinerImpl::foldBinOpShiftWithShift(), llvm::InstCombinerImpl::foldBinopWithPhiOperands(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), llvm::InstCombinerImpl::foldFMulReassoc(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpInstWithConstantNotInt(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::InstCombinerImpl::foldICmpWithCastOp(), llvm::InstCombinerImpl::foldICmpWithConstant(), llvm::InstCombinerImpl::foldIntegerTypedPHI(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::foldSelectICmp(), llvm::InstCombinerImpl::foldSelectShuffle(), llvm::InstCombinerImpl::FoldShiftByConstant(), llvm::InstCombinerImpl::foldVectorBinop(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), 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::visitGEPOfGEP(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitICmpInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitIntToPtr(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitMul(), llvm::InstCombinerImpl::visitPtrToInt(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitStoreInst(), and llvm::InstCombinerImpl::visitTrunc().
|
protected |
Definition at line 74 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::commonCastTransforms(), llvm::InstCombinerImpl::convertOrOfShiftsToFunnelShift(), llvm::InstCombinerImpl::dominatesAllUses(), llvm::InstCombinerImpl::foldBinopWithPhiOperands(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::foldICmpWithDominatingICmp(), llvm::InstCombinerImpl::foldIntegerTypedPHI(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::freezeOtherUses(), llvm::InstCombinerImpl::handlePotentiallyDeadBlocks(), 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::visitCallInst(), llvm::InstCombinerImpl::visitLoadInst(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitStoreInst(), and llvm::InstCombinerImpl::visitZExt().
|
protected |
Definition at line 85 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::combineLoadToNewType(), llvm::InstCombinerImpl::convertOrOfShiftsToFunnelShift(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), llvm::InstCombinerImpl::foldICmpAndConstant(), llvm::InstCombinerImpl::foldOpIntoPhi(), llvm::InstCombinerImpl::foldPHIArgLoadIntoPHI(), llvm::InstCombinerImpl::visitLandingPadInst(), llvm::InstCombinerImpl::visitLoadInst(), and llvm::InstCombinerImpl::visitStoreInst().
|
protected |
Definition at line 87 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::addDeadEdge(), llvm::InstCombinerImpl::handleUnreachableFrom(), llvm::InstCombinerImpl::prepareWorklist(), and llvm::InstCombinerImpl::run().
uint64_t llvm::InstCombiner::MaxArraySizeForCombine = 0 |
Maximum size of array considered when transforming.
Definition at line 55 of file InstCombiner.h.
Referenced by combineInstructionsOverFunction(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), unpackLoadToAggregate(), and unpackStoreToAggregate().
Definition at line 67 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::visitFree().
|
protected |
Definition at line 77 of file InstCombiner.h.
|
protected |
Order of predecessors to canonicalize phi nodes towards.
Definition at line 93 of file InstCombiner.h.
|
protected |
Definition at line 80 of file InstCombiner.h.
|
protected |
Definition at line 76 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::commonShiftTransforms(), 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::reassociateShiftAmtsOfTwoSameDirectionShifts(), llvm::InstCombinerImpl::SimplifyAssociativeOrCommutative(), 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::visitPtrToInt(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitShl(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSIToFP(), llvm::InstCombinerImpl::visitSRem(), llvm::InstCombinerImpl::visitSub(), llvm::InstCombinerImpl::visitUDiv(), llvm::InstCombinerImpl::visitUIToFP(), llvm::InstCombinerImpl::visitURem(), llvm::InstCombinerImpl::visitXor(), and llvm::InstCombinerImpl::visitZExt().
|
protected |
Definition at line 73 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), llvm::InstCombinerImpl::prepareWorklist(), llvm::InstCombinerImpl::run(), llvm::InstCombinerImpl::tryToSinkInstruction(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFDiv(), and llvm::InstCombinerImpl::visitFree().
|
protected |
A worklist of the instructions that need to be simplified.
Definition at line 64 of file InstCombiner.h.
Referenced by llvm::InstCombinerImpl::addDeadEdge(), llvm::InstCombinerImpl::foldFreezeIntoRecurrence(), llvm::InstCombinerImpl::handlePotentiallyDeadBlocks(), llvm::InstCombinerImpl::handlePotentiallyDeadSuccessors(), llvm::InstCombinerImpl::handleUnreachableFrom(), llvm::InstCombinerImpl::matchBSwapOrBitReverse(), llvm::InstCombinerImpl::prepareWorklist(), llvm::InstCombinerImpl::run(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), llvm::InstCombinerImpl::simplifyDivRemOfSelectWithZeroOp(), llvm::InstCombinerImpl::tryToSinkInstruction(), llvm::InstCombinerImpl::visitAllocSite(), llvm::InstCombinerImpl::visitBranchInst(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitExtractElementInst(), and llvm::InstCombinerImpl::visitStoreInst().