class InstCombiner
Declaration
class InstCombiner : public InstVisitor { /* full declaration omitted */ };
Description
The core instruction combiner logic. This class provides both the logic to recursively visit instructions and combine them.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:300
Inherits from: InstVisitor
Member Variables
- public llvm::InstCombineWorklist& Worklist
- A worklist of the instructions that need to be simplified.
- public llvm::InstCombiner::BuilderTy& Builder
- public uint64_t MaxArraySizeForCombine = 0
- Maximum size of array considered when transforming.
Method Overview
- public unsigned int ComputeNumSignBits(const llvm::Value * Op, unsigned int Depth = 0, const llvm::Instruction * CxtI = nullptr) const
- public void CreateNonTerminatorUnreachable(llvm::Instruction * InsertAt)
- public llvm::Instruction * CreateOverflowTuple(llvm::IntrinsicInst * II, llvm::Value * Result, llvm::Constant * Overflow)
- public llvm::Instruction * FoldItoFPtoI(llvm::Instruction & FI)
- public llvm::Instruction * FoldShiftByConstant(llvm::Value * Op0, llvm::Constant * Op1, llvm::BinaryOperator & I)
- public llvm::Instruction * InsertNewInstBefore(llvm::Instruction * New, llvm::Instruction & Old)
- public llvm::Instruction * InsertNewInstWith(llvm::Instruction * New, llvm::Instruction & Old)
- public InstCombiner(llvm::InstCombineWorklist & Worklist, llvm::InstCombiner::BuilderTy & Builder, bool MinimizeSize, bool ExpensiveCombines, llvm::AliasAnalysis * AA, llvm::AssumptionCache & AC, llvm::TargetLibraryInfo & TLI, llvm::DominatorTree & DT, llvm::OptimizationRemarkEmitter & ORE, llvm::BlockFrequencyInfo * BFI, llvm::ProfileSummaryInfo * PSI, const llvm::DataLayout & DL, llvm::LoopInfo * LI)
- public bool MaskedValueIsZero(const llvm::Value * V, const llvm::APInt & Mask, unsigned int Depth = 0, const llvm::Instruction * CxtI = nullptr) const
- public llvm::Value * OptimizePointerDifference(llvm::Value * LHS, llvm::Value * RHS, llvm::Type * Ty, bool isNUW)
- public llvm::Instruction * SliceUpIllegalIntegerPHI(llvm::PHINode & PN)
- public llvm::Instruction * canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract(llvm::BinaryOperator & I)
- public llvm::LoadInst * combineLoadToNewType(llvm::LoadInst & LI, llvm::Type * NewTy, const llvm::Twine & Suffix = "")
- public llvm::Instruction * commonCastTransforms(llvm::CastInst & CI)
- public llvm::Instruction * commonDivTransforms(llvm::BinaryOperator & I)
- public llvm::Instruction * commonIDivTransforms(llvm::BinaryOperator & I)
- public llvm::Instruction * commonIRemTransforms(llvm::BinaryOperator & I)
- public llvm::Instruction * commonPointerCastTransforms(llvm::CastInst & CI)
- public llvm::Instruction * commonRemTransforms(llvm::BinaryOperator & I)
- public llvm::Instruction * commonShiftTransforms(llvm::BinaryOperator & I)
- public void computeKnownBits(const llvm::Value * V, llvm::KnownBits & Known, unsigned int Depth, const llvm::Instruction * CxtI) const
- public llvm::KnownBits computeKnownBits(const llvm::Value * V, unsigned int Depth, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflow(Instruction::BinaryOps BinaryOp, bool IsSigned, llvm::Value * LHS, llvm::Value * RHS, llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForSignedAdd(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForSignedMul(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForSignedSub(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForUnsignedAdd(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForUnsignedMul(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForUnsignedSub(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public bool dominatesAllUses(const llvm::Instruction * DI, const llvm::Instruction * UI, const llvm::BasicBlock * DB) const
- public llvm::Instruction * eraseInstFromFunction(llvm::Instruction & I)
- public llvm::Instruction * foldVariableSignZeroExtensionOfVariableHighBitExtract(llvm::BinaryOperator & OldAShr)
- public llvm::AssumptionCache & getAssumptionCache() const
- public const llvm::DataLayout & getDataLayout() const
- public llvm::DominatorTree & getDominatorTree() const
- public llvm::LoopInfo * getLoopInfo() const
- public llvm::TargetLibraryInfo & getTargetLibraryInfo() const
- public bool isKnownToBeAPowerOfTwo(const llvm::Value * V, bool OrZero = false, unsigned int Depth = 0, const llvm::Instruction * CxtI = nullptr)
- public llvm::Value * reassociateShiftAmtsOfTwoSameDirectionShifts(llvm::BinaryOperator * Sh0, const llvm::SimplifyQuery & SQ, bool AnalyzeForSignBitExtraction = false)
- public llvm::Instruction * replaceInstUsesWith(llvm::Instruction & I, llvm::Value * V)
- public bool replacePointer(llvm::Instruction & I, llvm::Value * V)
- public bool replacedSelectWithOperand(llvm::SelectInst * SI, const llvm::ICmpInst * Icmp, const unsigned int SIOpd)
- public bool run()
- public bool simplifyDivRemOfSelectWithZeroOp(llvm::BinaryOperator & I)
- public llvm::Value * simplifyRangeCheck(llvm::ICmpInst * Cmp0, llvm::ICmpInst * Cmp1, bool Inverted)
- public llvm::Instruction * visitAShr(llvm::BinaryOperator & I)
- public llvm::Instruction * visitAdd(llvm::BinaryOperator & I)
- public llvm::Instruction * visitAddrSpaceCast(llvm::AddrSpaceCastInst & CI)
- public llvm::Instruction * visitAllocSite(llvm::Instruction & FI)
- public llvm::Instruction * visitAllocaInst(llvm::AllocaInst & AI)
- public llvm::Instruction * visitAnd(llvm::BinaryOperator & I)
- public llvm::Instruction * visitAtomicRMWInst(llvm::AtomicRMWInst & SI)
- public llvm::Instruction * visitBitCast(llvm::BitCastInst & CI)
- public llvm::Instruction * visitBranchInst(llvm::BranchInst & BI)
- public llvm::Instruction * visitCallBrInst(llvm::CallBrInst & CBI)
- public llvm::Instruction * visitCallInst(llvm::CallInst & CI)
- public llvm::Instruction * visitExtractElementInst(llvm::ExtractElementInst & EI)
- public llvm::Instruction * visitExtractValueInst(llvm::ExtractValueInst & EV)
- public llvm::Instruction * visitFAdd(llvm::BinaryOperator & I)
- public llvm::Instruction * visitFCmpInst(llvm::FCmpInst & I)
- public llvm::Instruction * visitFDiv(llvm::BinaryOperator & I)
- public llvm::Instruction * visitFMul(llvm::BinaryOperator & I)
- public llvm::Instruction * visitFNeg(llvm::UnaryOperator & I)
- public llvm::Instruction * visitFPExt(llvm::CastInst & CI)
- public llvm::Instruction * visitFPToSI(llvm::FPToSIInst & FI)
- public llvm::Instruction * visitFPToUI(llvm::FPToUIInst & FI)
- public llvm::Instruction * visitFPTrunc(llvm::FPTruncInst & CI)
- public llvm::Instruction * visitFRem(llvm::BinaryOperator & I)
- public llvm::Instruction * visitFSub(llvm::BinaryOperator & I)
- public llvm::Instruction * visitFenceInst(llvm::FenceInst & FI)
- public llvm::Instruction * visitFree(llvm::CallInst & FI)
- public llvm::Instruction * visitFreeze(llvm::FreezeInst & I)
- public llvm::Instruction * visitGetElementPtrInst(llvm::GetElementPtrInst & GEP)
- public llvm::Instruction * visitICmpInst(llvm::ICmpInst & I)
- public llvm::Instruction * visitInsertElementInst(llvm::InsertElementInst & IE)
- public llvm::Instruction * visitInsertValueInst(llvm::InsertValueInst & IV)
- public llvm::Instruction * visitInstruction(llvm::Instruction & I)
- public llvm::Instruction * visitIntToPtr(llvm::IntToPtrInst & CI)
- public llvm::Instruction * visitInvokeInst(llvm::InvokeInst & II)
- public llvm::Instruction * visitLShr(llvm::BinaryOperator & I)
- public llvm::Instruction * visitLandingPadInst(llvm::LandingPadInst & LI)
- public llvm::Instruction * visitLoadInst(llvm::LoadInst & LI)
- public llvm::Instruction * visitMul(llvm::BinaryOperator & I)
- public llvm::Instruction * visitOr(llvm::BinaryOperator & I)
- public llvm::Instruction * visitPHINode(llvm::PHINode & PN)
- public llvm::Instruction * visitPtrToInt(llvm::PtrToIntInst & CI)
- public llvm::Instruction * visitReturnInst(llvm::ReturnInst & RI)
- public llvm::Instruction * visitSDiv(llvm::BinaryOperator & I)
- public llvm::Instruction * visitSExt(llvm::SExtInst & CI)
- public llvm::Instruction * visitSIToFP(llvm::CastInst & CI)
- public llvm::Instruction * visitSRem(llvm::BinaryOperator & I)
- public llvm::Instruction * visitSelectInst(llvm::SelectInst & SI)
- public llvm::Instruction * visitShl(llvm::BinaryOperator & I)
- public llvm::Instruction * visitShuffleVectorInst(llvm::ShuffleVectorInst & SVI)
- public llvm::Instruction * visitStoreInst(llvm::StoreInst & SI)
- public llvm::Instruction * visitSub(llvm::BinaryOperator & I)
- public llvm::Instruction * visitSwitchInst(llvm::SwitchInst & SI)
- public llvm::Instruction * visitTrunc(llvm::TruncInst & CI)
- public llvm::Instruction * visitUDiv(llvm::BinaryOperator & I)
- public llvm::Instruction * visitUIToFP(llvm::CastInst & CI)
- public llvm::Instruction * visitURem(llvm::BinaryOperator & I)
- public llvm::Instruction * visitVACopyInst(llvm::VACopyInst & I)
- public llvm::Instruction * visitVAStartInst(llvm::VAStartInst & I)
- public llvm::Instruction * visitXor(llvm::BinaryOperator & I)
- public llvm::Instruction * visitZExt(llvm::ZExtInst & CI)
Methods
¶unsigned int ComputeNumSignBits(
const llvm::Value* Op,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
unsigned int ComputeNumSignBits(
const llvm::Value* Op,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:749
Parameters
- const llvm::Value* Op
- unsigned int Depth = 0
- const llvm::Instruction* CxtI = nullptr
¶void CreateNonTerminatorUnreachable(
llvm::Instruction* InsertAt)
void CreateNonTerminatorUnreachable(
llvm::Instruction* InsertAt)
Description
Create and insert the idiom we use to indicate a block is unreachable without having to rewrite the CFG from within InstCombine.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:697
Parameters
- llvm::Instruction* InsertAt
¶llvm::Instruction* CreateOverflowTuple(
llvm::IntrinsicInst* II,
llvm::Value* Result,
llvm::Constant* Overflow)
llvm::Instruction* CreateOverflowTuple(
llvm::IntrinsicInst* II,
llvm::Value* Result,
llvm::Constant* Overflow)
Description
Creates a result tuple for an overflow intrinsic \p II with a given\p Result and a constant \p Overflow value.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:687
Parameters
- llvm::IntrinsicInst* II
- llvm::Value* Result
- llvm::Constant* Overflow
¶llvm::Instruction* FoldItoFPtoI(
llvm::Instruction& FI)
llvm::Instruction* FoldItoFPtoI(
llvm::Instruction& FI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:423
Parameters
¶llvm::Instruction* FoldShiftByConstant(
llvm::Value* Op0,
llvm::Constant* Op1,
llvm::BinaryOperator& I)
llvm::Instruction* FoldShiftByConstant(
llvm::Value* Op0,
llvm::Constant* Op1,
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:406
Parameters
- llvm::Value* Op0
- llvm::Constant* Op1
- llvm::BinaryOperator& I
¶llvm::Instruction* InsertNewInstBefore(
llvm::Instruction* New,
llvm::Instruction& Old)
llvm::Instruction* InsertNewInstBefore(
llvm::Instruction* New,
llvm::Instruction& Old)
Description
Inserts an instruction \p New before instruction \p Old Also adds the new instruction to the worklist and returns \p New so that it is suitable for use as the return from the visitation patterns.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:645
Parameters
- llvm::Instruction* New
- llvm::Instruction& Old
¶llvm::Instruction* InsertNewInstWith(
llvm::Instruction* New,
llvm::Instruction& Old)
llvm::Instruction* InsertNewInstWith(
llvm::Instruction* New,
llvm::Instruction& Old)
Description
Same as InsertNewInstBefore, but also sets the debug loc.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:655
Parameters
- llvm::Instruction* New
- llvm::Instruction& Old
¶InstCombiner(
llvm::InstCombineWorklist& Worklist,
llvm::InstCombiner::BuilderTy& Builder,
bool MinimizeSize,
bool ExpensiveCombines,
llvm::AliasAnalysis* AA,
llvm::AssumptionCache& AC,
llvm::TargetLibraryInfo& TLI,
llvm::DominatorTree& DT,
llvm::OptimizationRemarkEmitter& ORE,
llvm::BlockFrequencyInfo* BFI,
llvm::ProfileSummaryInfo* PSI,
const llvm::DataLayout& DL,
llvm::LoopInfo* LI)
InstCombiner(
llvm::InstCombineWorklist& Worklist,
llvm::InstCombiner::BuilderTy& Builder,
bool MinimizeSize,
bool ExpensiveCombines,
llvm::AliasAnalysis* AA,
llvm::AssumptionCache& AC,
llvm::TargetLibraryInfo& TLI,
llvm::DominatorTree& DT,
llvm::OptimizationRemarkEmitter& ORE,
llvm::BlockFrequencyInfo* BFI,
llvm::ProfileSummaryInfo* PSI,
const llvm::DataLayout& DL,
llvm::LoopInfo* LI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:338
Parameters
- llvm::InstCombineWorklist& Worklist
- llvm::InstCombiner::BuilderTy& Builder
- bool MinimizeSize
- bool ExpensiveCombines
- llvm::AliasAnalysis* AA
- llvm::AssumptionCache& AC
- llvm::TargetLibraryInfo& TLI
- llvm::DominatorTree& DT
- llvm::OptimizationRemarkEmitter& ORE
- llvm::BlockFrequencyInfo* BFI
- llvm::ProfileSummaryInfo* PSI
- const llvm::DataLayout& DL
- llvm::LoopInfo* LI
¶bool MaskedValueIsZero(
const llvm::Value* V,
const llvm::APInt& Mask,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
bool MaskedValueIsZero(
const llvm::Value* V,
const llvm::APInt& Mask,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:744
Parameters
- const llvm::Value* V
- const llvm::APInt& Mask
- unsigned int Depth = 0
- const llvm::Instruction* CxtI = nullptr
¶llvm::Value* OptimizePointerDifference(
llvm::Value* LHS,
llvm::Value* RHS,
llvm::Type* Ty,
bool isNUW)
llvm::Value* OptimizePointerDifference(
llvm::Value* LHS,
llvm::Value* RHS,
llvm::Type* Ty,
bool isNUW)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:372
Parameters
- llvm::Value* LHS
- llvm::Value* RHS
- llvm::Type* Ty
- bool isNUW
¶llvm::Instruction* SliceUpIllegalIntegerPHI(
llvm::PHINode& PN)
llvm::Instruction* SliceUpIllegalIntegerPHI(
llvm::PHINode& PN)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:429
Parameters
- llvm::PHINode& PN
¶llvm::Instruction*
canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract(
llvm::BinaryOperator& I)
llvm::Instruction*
canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:397
Parameters
¶llvm::LoadInst* combineLoadToNewType(
llvm::LoadInst& LI,
llvm::Type* NewTy,
const llvm::Twine& Suffix = "")
llvm::LoadInst* combineLoadToNewType(
llvm::LoadInst& LI,
llvm::Type* NewTy,
const llvm::Twine& Suffix = "")
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:470
Parameters
- llvm::LoadInst& LI
- llvm::Type* NewTy
- const llvm::Twine& Suffix = ""
¶llvm::Instruction* commonCastTransforms(
llvm::CastInst& CI)
llvm::Instruction* commonCastTransforms(
llvm::CastInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:408
Parameters
- llvm::CastInst& CI
¶llvm::Instruction* commonDivTransforms(
llvm::BinaryOperator& I)
llvm::Instruction* commonDivTransforms(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:384
Parameters
¶llvm::Instruction* commonIDivTransforms(
llvm::BinaryOperator& I)
llvm::Instruction* commonIDivTransforms(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:385
Parameters
¶llvm::Instruction* commonIRemTransforms(
llvm::BinaryOperator& I)
llvm::Instruction* commonIRemTransforms(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:383
Parameters
¶llvm::Instruction* commonPointerCastTransforms(
llvm::CastInst& CI)
llvm::Instruction* commonPointerCastTransforms(
llvm::CastInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:409
Parameters
- llvm::CastInst& CI
¶llvm::Instruction* commonRemTransforms(
llvm::BinaryOperator& I)
llvm::Instruction* commonRemTransforms(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:382
Parameters
¶llvm::Instruction* commonShiftTransforms(
llvm::BinaryOperator& I)
llvm::Instruction* commonShiftTransforms(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:403
Parameters
¶void computeKnownBits(
const llvm::Value* V,
llvm::KnownBits& Known,
unsigned int Depth,
const llvm::Instruction* CxtI) const
void computeKnownBits(
const llvm::Value* V,
llvm::KnownBits& Known,
unsigned int Depth,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:728
Parameters
- const llvm::Value* V
- llvm::KnownBits& Known
- unsigned int Depth
- const llvm::Instruction* CxtI
¶llvm::KnownBits computeKnownBits(
const llvm::Value* V,
unsigned int Depth,
const llvm::Instruction* CxtI) const
llvm::KnownBits computeKnownBits(
const llvm::Value* V,
unsigned int Depth,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:733
Parameters
- const llvm::Value* V
- unsigned int Depth
- const llvm::Instruction* CxtI
¶llvm::OverflowResult computeOverflow(
Instruction::BinaryOps BinaryOp,
bool IsSigned,
llvm::Value* LHS,
llvm::Value* RHS,
llvm::Instruction* CxtI) const
llvm::OverflowResult computeOverflow(
Instruction::BinaryOps BinaryOp,
bool IsSigned,
llvm::Value* LHS,
llvm::Value* RHS,
llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:789
Parameters
- Instruction::BinaryOps BinaryOp
- bool IsSigned
- llvm::Value* LHS
- llvm::Value* RHS
- llvm::Instruction* CxtI
¶llvm::OverflowResult computeOverflowForSignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult computeOverflowForSignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:772
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult computeOverflowForSignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult computeOverflowForSignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:760
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult computeOverflowForSignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult computeOverflowForSignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:784
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult
computeOverflowForUnsignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult
computeOverflowForUnsignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:766
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult
computeOverflowForUnsignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult
computeOverflowForUnsignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:754
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult
computeOverflowForUnsignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult
computeOverflowForUnsignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:778
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶bool dominatesAllUses(
const llvm::Instruction* DI,
const llvm::Instruction* UI,
const llvm::BasicBlock* DB) const
bool dominatesAllUses(
const llvm::Instruction* DI,
const llvm::Instruction* UI,
const llvm::BasicBlock* DB) const
Description
True when DB dominates all uses of DI except UI. UI must be in the same block as DI. The routine checks that the DI parent and DB are different.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:458
Parameters
- const llvm::Instruction* DI
- const llvm::Instruction* UI
- const llvm::BasicBlock* DB
¶llvm::Instruction* eraseInstFromFunction(
llvm::Instruction& I)
llvm::Instruction* eraseInstFromFunction(
llvm::Instruction& I)
Description
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.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:710
Parameters
¶llvm::Instruction*
foldVariableSignZeroExtensionOfVariableHighBitExtract(
llvm::BinaryOperator& OldAShr)
llvm::Instruction*
foldVariableSignZeroExtensionOfVariableHighBitExtract(
llvm::BinaryOperator& OldAShr)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:399
Parameters
- llvm::BinaryOperator& OldAShr
¶llvm::AssumptionCache& getAssumptionCache() const
llvm::AssumptionCache& getAssumptionCache() const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:352
¶const llvm::DataLayout& getDataLayout() const
const llvm::DataLayout& getDataLayout() const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:354
¶llvm::DominatorTree& getDominatorTree() const
llvm::DominatorTree& getDominatorTree() const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:356
¶llvm::LoopInfo* getLoopInfo() const
llvm::LoopInfo* getLoopInfo() const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:358
¶llvm::TargetLibraryInfo& getTargetLibraryInfo()
const
llvm::TargetLibraryInfo& getTargetLibraryInfo()
const
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:360
¶bool isKnownToBeAPowerOfTwo(
const llvm::Value* V,
bool OrZero = false,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr)
bool isKnownToBeAPowerOfTwo(
const llvm::Value* V,
bool OrZero = false,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:738
Parameters
- const llvm::Value* V
- bool OrZero = false
- unsigned int Depth = 0
- const llvm::Instruction* CxtI = nullptr
¶llvm::Value*
reassociateShiftAmtsOfTwoSameDirectionShifts(
llvm::BinaryOperator* Sh0,
const llvm::SimplifyQuery& SQ,
bool AnalyzeForSignBitExtraction = false)
llvm::Value*
reassociateShiftAmtsOfTwoSameDirectionShifts(
llvm::BinaryOperator* Sh0,
const llvm::SimplifyQuery& SQ,
bool AnalyzeForSignBitExtraction = false)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:394
Parameters
- llvm::BinaryOperator* Sh0
- const llvm::SimplifyQuery& SQ
- bool AnalyzeForSignBitExtraction = false
¶llvm::Instruction* replaceInstUsesWith(
llvm::Instruction& I,
llvm::Value* V)
llvm::Instruction* replaceInstUsesWith(
llvm::Instruction& I,
llvm::Value* V)
Description
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.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:666
Parameters
¶bool replacePointer(llvm::Instruction& I,
llvm::Value* V)
bool replacePointer(llvm::Instruction& I,
llvm::Value* V)
Description
Try to replace instruction \p I with value \p V which are pointers in different address space.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:468
Parameters
Returns
true if successful.
¶bool replacedSelectWithOperand(
llvm::SelectInst* SI,
const llvm::ICmpInst* Icmp,
const unsigned int SIOpd)
bool replacedSelectWithOperand(
llvm::SelectInst* SI,
const llvm::ICmpInst* Icmp,
const unsigned int SIOpd)
Description
Try to replace select with select operand SIOpd in SI-ICmp sequence.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:462
Parameters
- llvm::SelectInst* SI
- const llvm::ICmpInst* Icmp
- const unsigned int SIOpd
¶bool run()
bool run()
Description
Run the combiner over the entire worklist until it is empty.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:350
Returns
true if the IR is changed.
¶bool simplifyDivRemOfSelectWithZeroOp(
llvm::BinaryOperator& I)
bool simplifyDivRemOfSelectWithZeroOp(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:381
Parameters
¶llvm::Value* simplifyRangeCheck(
llvm::ICmpInst* Cmp0,
llvm::ICmpInst* Cmp1,
bool Inverted)
llvm::Value* simplifyRangeCheck(
llvm::ICmpInst* Cmp0,
llvm::ICmpInst* Cmp1,
bool Inverted)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:389
Parameters
- llvm::ICmpInst* Cmp0
- llvm::ICmpInst* Cmp1
- bool Inverted
¶llvm::Instruction* visitAShr(
llvm::BinaryOperator& I)
llvm::Instruction* visitAShr(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:401
Parameters
¶llvm::Instruction* visitAdd(
llvm::BinaryOperator& I)
llvm::Instruction* visitAdd(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:370
Parameters
¶llvm::Instruction* visitAddrSpaceCast(
llvm::AddrSpaceCastInst& CI)
llvm::Instruction* visitAddrSpaceCast(
llvm::AddrSpaceCastInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:422
Parameters
¶llvm::Instruction* visitAllocSite(
llvm::Instruction& FI)
llvm::Instruction* visitAllocSite(
llvm::Instruction& FI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:433
Parameters
¶llvm::Instruction* visitAllocaInst(
llvm::AllocaInst& AI)
llvm::Instruction* visitAllocaInst(
llvm::AllocaInst& AI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:432
Parameters
- llvm::AllocaInst& AI
¶llvm::Instruction* visitAnd(
llvm::BinaryOperator& I)
llvm::Instruction* visitAnd(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:390
Parameters
¶llvm::Instruction* visitAtomicRMWInst(
llvm::AtomicRMWInst& SI)
llvm::Instruction* visitAtomicRMWInst(
llvm::AtomicRMWInst& SI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:437
Parameters
¶llvm::Instruction* visitBitCast(
llvm::BitCastInst& CI)
llvm::Instruction* visitBitCast(
llvm::BitCastInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:421
Parameters
¶llvm::Instruction* visitBranchInst(
llvm::BranchInst& BI)
llvm::Instruction* visitBranchInst(
llvm::BranchInst& BI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:438
Parameters
- llvm::BranchInst& BI
¶llvm::Instruction* visitCallBrInst(
llvm::CallBrInst& CBI)
llvm::Instruction* visitCallBrInst(
llvm::CallBrInst& CBI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:427
Parameters
- llvm::CallBrInst& CBI
¶llvm::Instruction* visitCallInst(
llvm::CallInst& CI)
llvm::Instruction* visitCallInst(
llvm::CallInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:425
Parameters
- llvm::CallInst& CI
¶llvm::Instruction* visitExtractElementInst(
llvm::ExtractElementInst& EI)
llvm::Instruction* visitExtractElementInst(
llvm::ExtractElementInst& EI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:444
Parameters
¶llvm::Instruction* visitExtractValueInst(
llvm::ExtractValueInst& EV)
llvm::Instruction* visitExtractValueInst(
llvm::ExtractValueInst& EV)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:446
Parameters
¶llvm::Instruction* visitFAdd(
llvm::BinaryOperator& I)
llvm::Instruction* visitFAdd(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:371
Parameters
¶llvm::Instruction* visitFCmpInst(
llvm::FCmpInst& I)
llvm::Instruction* visitFCmpInst(
llvm::FCmpInst& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:404
Parameters
¶llvm::Instruction* visitFDiv(
llvm::BinaryOperator& I)
llvm::Instruction* visitFDiv(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:388
Parameters
¶llvm::Instruction* visitFMul(
llvm::BinaryOperator& I)
llvm::Instruction* visitFMul(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:377
Parameters
¶llvm::Instruction* visitFNeg(
llvm::UnaryOperator& I)
llvm::Instruction* visitFNeg(
llvm::UnaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:369
Parameters
¶llvm::Instruction* visitFPExt(llvm::CastInst& CI)
llvm::Instruction* visitFPExt(llvm::CastInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:414
Parameters
- llvm::CastInst& CI
¶llvm::Instruction* visitFPToSI(
llvm::FPToSIInst& FI)
llvm::Instruction* visitFPToSI(
llvm::FPToSIInst& FI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:416
Parameters
- llvm::FPToSIInst& FI
¶llvm::Instruction* visitFPToUI(
llvm::FPToUIInst& FI)
llvm::Instruction* visitFPToUI(
llvm::FPToUIInst& FI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:415
Parameters
- llvm::FPToUIInst& FI
¶llvm::Instruction* visitFPTrunc(
llvm::FPTruncInst& CI)
llvm::Instruction* visitFPTrunc(
llvm::FPTruncInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:413
Parameters
¶llvm::Instruction* visitFRem(
llvm::BinaryOperator& I)
llvm::Instruction* visitFRem(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:380
Parameters
¶llvm::Instruction* visitFSub(
llvm::BinaryOperator& I)
llvm::Instruction* visitFSub(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:375
Parameters
¶llvm::Instruction* visitFenceInst(
llvm::FenceInst& FI)
llvm::Instruction* visitFenceInst(
llvm::FenceInst& FI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:439
Parameters
- llvm::FenceInst& FI
¶llvm::Instruction* visitFree(llvm::CallInst& FI)
llvm::Instruction* visitFree(llvm::CallInst& FI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:434
Parameters
- llvm::CallInst& FI
¶llvm::Instruction* visitFreeze(
llvm::FreezeInst& I)
llvm::Instruction* visitFreeze(
llvm::FreezeInst& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:450
Parameters
¶llvm::Instruction* visitGetElementPtrInst(
llvm::GetElementPtrInst& GEP)
llvm::Instruction* visitGetElementPtrInst(
llvm::GetElementPtrInst& GEP)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:431
Parameters
¶llvm::Instruction* visitICmpInst(
llvm::ICmpInst& I)
llvm::Instruction* visitICmpInst(
llvm::ICmpInst& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:405
Parameters
¶llvm::Instruction* visitInsertElementInst(
llvm::InsertElementInst& IE)
llvm::Instruction* visitInsertElementInst(
llvm::InsertElementInst& IE)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:443
Parameters
¶llvm::Instruction* visitInsertValueInst(
llvm::InsertValueInst& IV)
llvm::Instruction* visitInsertValueInst(
llvm::InsertValueInst& IV)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:442
Parameters
¶llvm::Instruction* visitInstruction(
llvm::Instruction& I)
llvm::Instruction* visitInstruction(
llvm::Instruction& I)
Description
Specify what to return for unhandled instructions.
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:453
Parameters
¶llvm::Instruction* visitIntToPtr(
llvm::IntToPtrInst& CI)
llvm::Instruction* visitIntToPtr(
llvm::IntToPtrInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:420
Parameters
¶llvm::Instruction* visitInvokeInst(
llvm::InvokeInst& II)
llvm::Instruction* visitInvokeInst(
llvm::InvokeInst& II)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:426
Parameters
- llvm::InvokeInst& II
¶llvm::Instruction* visitLShr(
llvm::BinaryOperator& I)
llvm::Instruction* visitLShr(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:402
Parameters
¶llvm::Instruction* visitLandingPadInst(
llvm::LandingPadInst& LI)
llvm::Instruction* visitLandingPadInst(
llvm::LandingPadInst& LI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:447
Parameters
¶llvm::Instruction* visitLoadInst(
llvm::LoadInst& LI)
llvm::Instruction* visitLoadInst(
llvm::LoadInst& LI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:435
Parameters
- llvm::LoadInst& LI
¶llvm::Instruction* visitMul(
llvm::BinaryOperator& I)
llvm::Instruction* visitMul(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:376
Parameters
¶llvm::Instruction* visitOr(
llvm::BinaryOperator& I)
llvm::Instruction* visitOr(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:391
Parameters
¶llvm::Instruction* visitPHINode(llvm::PHINode& PN)
llvm::Instruction* visitPHINode(llvm::PHINode& PN)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:430
Parameters
- llvm::PHINode& PN
¶llvm::Instruction* visitPtrToInt(
llvm::PtrToIntInst& CI)
llvm::Instruction* visitPtrToInt(
llvm::PtrToIntInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:419
Parameters
¶llvm::Instruction* visitReturnInst(
llvm::ReturnInst& RI)
llvm::Instruction* visitReturnInst(
llvm::ReturnInst& RI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:441
Parameters
- llvm::ReturnInst& RI
¶llvm::Instruction* visitSDiv(
llvm::BinaryOperator& I)
llvm::Instruction* visitSDiv(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:387
Parameters
¶llvm::Instruction* visitSExt(llvm::SExtInst& CI)
llvm::Instruction* visitSExt(llvm::SExtInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:412
Parameters
- llvm::SExtInst& CI
¶llvm::Instruction* visitSIToFP(llvm::CastInst& CI)
llvm::Instruction* visitSIToFP(llvm::CastInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:418
Parameters
- llvm::CastInst& CI
¶llvm::Instruction* visitSRem(
llvm::BinaryOperator& I)
llvm::Instruction* visitSRem(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:379
Parameters
¶llvm::Instruction* visitSelectInst(
llvm::SelectInst& SI)
llvm::Instruction* visitSelectInst(
llvm::SelectInst& SI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:424
Parameters
- llvm::SelectInst& SI
¶llvm::Instruction* visitShl(
llvm::BinaryOperator& I)
llvm::Instruction* visitShl(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:393
Parameters
¶llvm::Instruction* visitShuffleVectorInst(
llvm::ShuffleVectorInst& SVI)
llvm::Instruction* visitShuffleVectorInst(
llvm::ShuffleVectorInst& SVI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:445
Parameters
¶llvm::Instruction* visitStoreInst(
llvm::StoreInst& SI)
llvm::Instruction* visitStoreInst(
llvm::StoreInst& SI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:436
Parameters
- llvm::StoreInst& SI
¶llvm::Instruction* visitSub(
llvm::BinaryOperator& I)
llvm::Instruction* visitSub(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:374
Parameters
¶llvm::Instruction* visitSwitchInst(
llvm::SwitchInst& SI)
llvm::Instruction* visitSwitchInst(
llvm::SwitchInst& SI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:440
Parameters
- llvm::SwitchInst& SI
¶llvm::Instruction* visitTrunc(llvm::TruncInst& CI)
llvm::Instruction* visitTrunc(llvm::TruncInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:410
Parameters
- llvm::TruncInst& CI
¶llvm::Instruction* visitUDiv(
llvm::BinaryOperator& I)
llvm::Instruction* visitUDiv(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:386
Parameters
¶llvm::Instruction* visitUIToFP(llvm::CastInst& CI)
llvm::Instruction* visitUIToFP(llvm::CastInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:417
Parameters
- llvm::CastInst& CI
¶llvm::Instruction* visitURem(
llvm::BinaryOperator& I)
llvm::Instruction* visitURem(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:378
Parameters
¶llvm::Instruction* visitVACopyInst(
llvm::VACopyInst& I)
llvm::Instruction* visitVACopyInst(
llvm::VACopyInst& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:449
Parameters
¶llvm::Instruction* visitVAStartInst(
llvm::VAStartInst& I)
llvm::Instruction* visitVAStartInst(
llvm::VAStartInst& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:448
Parameters
¶llvm::Instruction* visitXor(
llvm::BinaryOperator& I)
llvm::Instruction* visitXor(
llvm::BinaryOperator& I)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:392
Parameters
¶llvm::Instruction* visitZExt(llvm::ZExtInst& CI)
llvm::Instruction* visitZExt(llvm::ZExtInst& CI)
Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:411
Parameters
- llvm::ZExtInst& CI