class InstCombinerImpl

Declaration

class InstCombinerImpl : public 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:61

Inherits from: InstCombiner, InstVisitor

Member Variables

Inherited from InstCombiner:

public MaxArraySizeForCombine = 0
public Builder
protected Worklist
protected MinimizeSize
protected AA
protected AC
protected TLI
protected DT
protected DL
protected SQ
protected ORE
protected BFI
protected PSI
protected LI
protected MadeIRChange = false

Method Overview

Inherited from InstCombiner:

Methods

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:491

Parameters

const llvm::Value* Op
unsigned int Depth = 0
const llvm::Instruction* CxtI = nullptr

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:440

Parameters

llvm::Instruction* InsertAt

llvm::Value* Descale(llvm::Value* Val,
                     llvm::APInt Scale,
                     bool& NoSignedWrap)

Description

Returns a value X such that Val = X * Scale, or null if none. If the multiplication is known not to overflow then NoSignedWrap is set.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:762

Parameters

llvm::Value* Val
llvm::APInt Scale
bool& NoSignedWrap

llvm::Value* EmitGEPOffset(llvm::User* GEP)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:319

Parameters

llvm::User* GEP

llvm::Value* EvaluateInDifferentType(
    llvm::Value* V,
    llvm::Type* Ty,
    bool isSigned)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:757

Parameters

llvm::Value* V
llvm::Type* Ty
bool isSigned

llvm::Instruction* FoldOpIntoSelect(
    llvm::Instruction& Op,
    llvm::SelectInst* SI,
    bool FoldWithMultiUse = false)

Description

Given an instruction with a select as one operand and a constant as the other operand, try to fold the binary operator into the select arguments. This also works for Cast instructions, which obviously do not have a second operand.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:628

Parameters

llvm::Instruction& Op
llvm::SelectInst* SI
bool FoldWithMultiUse = false

llvm::Instruction* FoldShiftByConstant(
    llvm::Value* Op0,
    llvm::Constant* Op1,
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:125

Parameters

llvm::Value* Op0
llvm::Constant* Op1
llvm::BinaryOperator& I

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:384

Parameters

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:394

Parameters

llvm::Instruction* New
llvm::Instruction& Old

InstCombinerImpl(
    llvm::InstructionWorklist& Worklist,
    llvm::InstCombiner::BuilderTy& Builder,
    bool MinimizeSize,
    llvm::AAResults* AA,
    llvm::AssumptionCache& AC,
    llvm::TargetLibraryInfo& TLI,
    llvm::TargetTransformInfo& TTI,
    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:65

Parameters

llvm::InstructionWorklist& Worklist
llvm::InstCombiner::BuilderTy& Builder
bool MinimizeSize
llvm::AAResults* AA
llvm::AssumptionCache& AC
llvm::TargetLibraryInfo& TLI
llvm::TargetTransformInfo& TTI
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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:486

Parameters

const llvm::Value* V
const llvm::APInt& Mask
unsigned int Depth = 0
const llvm::Instruction* CxtI = nullptr

bool OptimizeOverflowCheck(
    Instruction::BinaryOps BinaryOp,
    bool IsSigned,
    llvm::Value* LHS,
    llvm::Value* RHS,
    llvm::Instruction& CtxI,
    llvm::Value*& OperationResult,
    llvm::Constant*& OverflowResult)

Description

Try to optimize a sequence of instructions checking if an operation on LHS and RHS overflows. If this overflow check is done via one of the overflow check intrinsics, then CtxI has to be the call instruction calling that intrinsic. If this overflow check is done by arithmetic followed by a compare, then CtxI has to be the arithmetic instruction. If a simplification is possible, stores the simplified result of the operation in OperationResult and result of the overflow check in OverflowResult, and return true. If no simplification is possible, returns false.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:225

Parameters

Instruction::BinaryOps BinaryOp
bool IsSigned
llvm::Value* LHS
llvm::Value* RHS
llvm::Instruction& CtxI
llvm::Value*& OperationResult
llvm::Constant*& OverflowResult

llvm::Value* OptimizePointerDifference(
    llvm::Value* LHS,
    llvm::Value* RHS,
    llvm::Type* Ty,
    bool isNUW)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:91

Parameters

llvm::Value* LHS
llvm::Value* RHS
llvm::Type* Ty
bool isNUW

void PHIArgMergedDebugLoc(llvm::Instruction* Inst,
                          llvm::PHINode& PN)

Description

Helper function for FoldPHIArgXIntoPHI() to set debug location for the folded operation.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:654

Parameters

llvm::Instruction* Inst
llvm::PHINode& PN

llvm::Instruction* PromoteCastOfAllocation(
    llvm::BitCastInst& CI,
    llvm::AllocaInst& AI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:745

Parameters

llvm::BitCastInst& CI
llvm::AllocaInst& AI

llvm::Value* SimplifyAddWithRemainder(
    llvm::BinaryOperator& I)

Description

Tries to simplify add operations using the definition of remainder. The definition of remainder is X % C = X - (X / C ) * C. The add expression X % C0 + (( X / C0 ) % C1) * C0 can be simplified to X % (C0 * C1)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:553

Parameters

llvm::BinaryOperator& I

llvm::Instruction* SimplifyAnyMemSet(
    llvm::AnyMemSetInst* MI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:755

Parameters

llvm::AnyMemSetInst* MI

llvm::Instruction* SimplifyAnyMemTransfer(
    llvm::AnyMemTransferInst* MI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:754

Parameters

llvm::AnyMemTransferInst* MI

bool SimplifyAssociativeOrCommutative(
    llvm::BinaryOperator& I)

Description

Performs a few simplifications for operators which are associative or commutative.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:537

Parameters

llvm::BinaryOperator& I

bool SimplifyDemandedBits(
    llvm::Instruction* I,
    unsigned int Op,
    const llvm::APInt& DemandedMask,
    llvm::KnownBits& Known,
    unsigned int Depth = 0)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:578

Parameters

llvm::Instruction* I
unsigned int Op
const llvm::APInt& DemandedMask
llvm::KnownBits& Known
unsigned int Depth = 0

bool SimplifyDemandedInstructionBits(
    llvm::Instruction& Inst)

Description

Tries to simplify operands to an integer instruction based on its demanded bits.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:598

Parameters

llvm::Instruction& Inst

llvm::Value* SimplifyDemandedUseBits(
    llvm::Value* V,
    llvm::APInt DemandedMask,
    llvm::KnownBits& Known,
    unsigned int Depth,
    llvm::Instruction* CxtI)

Description

Attempts to replace V with a simpler value based on the demanded bits.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:576

Parameters

llvm::Value* V
llvm::APInt DemandedMask
llvm::KnownBits& Known
unsigned int Depth
llvm::Instruction* CxtI

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:600

Parameters

llvm::Value* V
llvm::APInt DemandedElts
llvm::APInt& UndefElts
unsigned int Depth = 0
bool AllowMultipleUsers = false

llvm::Value* SimplifyMultipleUseDemandedBits(
    llvm::Instruction* I,
    const llvm::APInt& DemandedMask,
    llvm::KnownBits& Known,
    unsigned int Depth,
    llvm::Instruction* CxtI)

Description

Helper routine of SimplifyDemandedUseBits. It computes KnownZero/KnownOne bits. It also tries to handle simplifications that can be done based on DemandedMask, but without modifying the Instruction.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:585

Parameters

llvm::Instruction* I
const llvm::APInt& DemandedMask
llvm::KnownBits& Known
unsigned int Depth
llvm::Instruction* CxtI

llvm::Value* SimplifySelectsFeedingBinaryOp(
    llvm::BinaryOperator& I,
    llvm::Value* LHS,
    llvm::Value* RHS)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:557

Parameters

llvm::BinaryOperator& I
llvm::Value* LHS
llvm::Value* RHS

llvm::Value* SimplifyUsingDistributiveLaws(
    llvm::BinaryOperator& I)

Description

Tries to simplify binary operations which some other binary operation distributes over. It does this by either by factorizing out common terms (eg "(A*B)+(A*C)" -> "A*(B+C)") or expanding out if this results in simplifications (eg: "A & (B | C) -> (A &B ) | (A &C )" if this is a win). Returns the simplified value, or null if it didn't simplify.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:546

Parameters

llvm::BinaryOperator& I

llvm::Instruction* SliceUpIllegalIntegerPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:148

Parameters

llvm::PHINode& PN

bool annotateAnyAllocSite(
    llvm::CallBase& Call,
    const llvm::TargetLibraryInfo* TLI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:196

Parameters

llvm::CallBase& Call
const llvm::TargetLibraryInfo* TLI

llvm::Instruction*
canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:115

Parameters

llvm::BinaryOperator& I

llvm::CmpInst* canonicalizeICmpPredicate(
    llvm::CmpInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:123

Parameters

llvm::CmpInst& I

llvm::LoadInst* combineLoadToNewType(
    llvm::LoadInst& LI,
    llvm::Type* NewTy,
    const llvm::Twine& Suffix = "")

Description

Helper to combine a load to a new type. This just does the work of combining a load to a new type. It handles metadata, etc., and returns the new instruction. The \c NewTy should be the loaded *value* type. This will convert it to a pointer, cast the operand to that pointer type, load it, etc. Note that this will create all of the instructions with whatever insert point the \c InstCombinerImpl currently is using.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:192

Parameters

llvm::LoadInst& LI
llvm::Type* NewTy
const llvm::Twine& Suffix = ""

llvm::Instruction* commonCastTransforms(
    llvm::CastInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:127

Parameters

llvm::CastInst& CI

llvm::Instruction* commonIDivTransforms(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:102

Parameters

llvm::BinaryOperator& I

llvm::Instruction* commonIRemTransforms(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:101

Parameters

llvm::BinaryOperator& I

llvm::Instruction* commonPointerCastTransforms(
    llvm::CastInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:128

Parameters

llvm::CastInst& CI

llvm::Instruction* commonShiftTransforms(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:121

Parameters

llvm::BinaryOperator& I

llvm::KnownBits computeKnownBits(
    const llvm::Value* V,
    unsigned int Depth,
    const llvm::Instruction* CxtI) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:475

Parameters

const llvm::Value* V
unsigned int Depth
const llvm::Instruction* CxtI

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:470

Parameters

const llvm::Value* V
llvm::KnownBits& Known
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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:531

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:514

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:502

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:526

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:508

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:496

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:520

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

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:185

Parameters

const llvm::Instruction* DI
const llvm::Instruction* UI
const llvm::BasicBlock* DB

llvm::Value* dyn_castNegVal(llvm::Value* V) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:200

Parameters

llvm::Value* V

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:453

Parameters

llvm::Instruction& I

llvm::Instruction* foldAddWithConstant(
    llvm::BinaryOperator& Add)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:634

Parameters

llvm::BinaryOperator& Add

llvm::Instruction*
foldAggregateConstructionIntoAggregateReuse(
    llvm::InsertValueInst& OrigIVI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:166

Parameters

llvm::InsertValueInst& OrigIVI

llvm::Instruction* foldAllocaCmp(
    llvm::ICmpInst& ICI,
    const llvm::AllocaInst* Alloca)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:660

Parameters

llvm::ICmpInst& ICI
const llvm::AllocaInst* Alloca

llvm::Value* foldAndOrOfICmps(
    llvm::ICmpInst* LHS,
    llvm::ICmpInst* RHS,
    llvm::Instruction& I,
    bool IsAnd,
    bool IsLogical = false)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:348

Parameters

llvm::ICmpInst* LHS
llvm::ICmpInst* RHS
llvm::Instruction& I
bool IsAnd
bool IsLogical = false

llvm::Value* foldAndOrOfICmpsOfAndWithPow2(
    llvm::ICmpInst* LHS,
    llvm::ICmpInst* RHS,
    llvm::Instruction* CxtI,
    bool IsAnd,
    bool IsLogical = false)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:363

Parameters

llvm::ICmpInst* LHS
llvm::ICmpInst* RHS
llvm::Instruction* CxtI
bool IsAnd
bool IsLogical = false

llvm::Value* foldAndOrOfICmpsUsingRanges(
    llvm::ICmpInst* ICmp1,
    llvm::ICmpInst* ICmp2,
    bool IsAnd)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:354

Parameters

llvm::ICmpInst* ICmp1
llvm::ICmpInst* ICmp2
bool IsAnd

llvm::Instruction*
foldAndOrOfSelectUsingImpliedCond(
    llvm::Value* Op,
    llvm::SelectInst& SI,
    bool IsAnd)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:376

Parameters

llvm::Value* Op
llvm::SelectInst& SI
bool IsAnd

llvm::Instruction* foldBinOpIntoSelectOrPhi(
    llvm::BinaryOperator& I)

Description

This is a convenience wrapper function for the above two functions.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:632

Parameters

llvm::BinaryOperator& I

llvm::Instruction* foldBinopOfSextBoolToSelect(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:323

Parameters

llvm::BinaryOperator& I

llvm::Instruction* foldBinopWithPhiOperands(
    llvm::BinaryOperator& BO)

Description

For a binary operator with 2 phi operands, try to hoist the binary operation before the phi. This can result in fewer instructions in patterns where at least one set of phi operands simplifies. Example: BB3: binop (phi [X, BB1], [C1, BB2]), (phi [Y, BB1], [C2, BB2]) --> BB1: BO = binop X, Y BB3: phi [BO, BB1], [(binop C1, C2), BB2]

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:622

Parameters

llvm::BinaryOperator& BO

llvm::Instruction* foldBitcastExtElt(
    llvm::ExtractElementInst& ExtElt)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:321

Parameters

llvm::ExtractElementInst& ExtElt

llvm::Instruction* foldCastedBitwiseLogic(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:322

Parameters

llvm::BinaryOperator& I

llvm::Instruction* foldCmpLoadFromIndexedGlobal(
    llvm::LoadInst* LI,
    llvm::GetElementPtrInst* GEP,
    llvm::GlobalVariable* GV,
    llvm::CmpInst& ICI,
    llvm::ConstantInt* AndCst = nullptr)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:661

Parameters

llvm::LoadInst* LI
llvm::GetElementPtrInst* GEP
llvm::GlobalVariable* GV
llvm::CmpInst& ICI
llvm::ConstantInt* AndCst = nullptr

llvm::Value* foldEqOfParts(llvm::ICmpInst* Cmp0,
                           llvm::ICmpInst* Cmp1,
                           bool IsAnd)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:352

Parameters

llvm::ICmpInst* Cmp0
llvm::ICmpInst* Cmp1
bool IsAnd

llvm::Instruction* foldFCmpIntToFPConst(
    llvm::FCmpInst& I,
    llvm::Instruction* LHSI,
    llvm::Constant* RHSC)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:665

Parameters

llvm::FCmpInst& I
llvm::Instruction* LHSI
llvm::Constant* RHSC

llvm::Instruction* foldFPSignBitOps(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:370

Parameters

llvm::BinaryOperator& I

llvm::Instruction* foldFreezeIntoRecurrence(
    llvm::FreezeInst& I,
    llvm::PHINode* PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:176

Parameters

llvm::FreezeInst& I
llvm::PHINode* PN

llvm::Instruction* foldGEPICmp(
    llvm::GEPOperator* GEPLHS,
    llvm::Value* RHS,
    ICmpInst::Predicate Cond,
    llvm::Instruction& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:656

Parameters

llvm::GEPOperator* GEPLHS
llvm::Value* RHS
ICmpInst::Predicate Cond
llvm::Instruction& I

llvm::Instruction* foldICmpAddConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Add,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:713

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Add
const llvm::APInt& C

llvm::Instruction* foldICmpAddOpConst(
    llvm::Value* X,
    const llvm::APInt& C,
    ICmpInst::Predicate Pred)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:667

Parameters

llvm::Value* X
const llvm::APInt& C
ICmpInst::Predicate Pred

llvm::Instruction* foldICmpAndConstConst(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* And,
    const llvm::APInt& C1)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:715

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* And
const llvm::APInt& C1

llvm::Instruction* foldICmpAndConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* And,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:693

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* And
const llvm::APInt& C

llvm::Instruction* foldICmpAndShift(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* And,
    const llvm::APInt& C1,
    const llvm::APInt& C2)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:717

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* And
const llvm::APInt& C1
const llvm::APInt& C2

llvm::Instruction* foldICmpBinOp(
    llvm::ICmpInst& Cmp,
    const llvm::SimplifyQuery& SQ)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:679

Parameters

llvm::ICmpInst& Cmp
const llvm::SimplifyQuery& SQ

llvm::Instruction*
foldICmpBinOpEqualityWithConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* BO,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:724

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* BO
const llvm::APInt& C

llvm::Instruction* foldICmpBinOpWithConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* BO,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:687

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* BO
const llvm::APInt& C

llvm::Instruction* foldICmpBitCast(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:731

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldICmpDivConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Div,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:709

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Div
const llvm::APInt& C

llvm::Instruction*
foldICmpEqIntrinsicWithConstant(
    llvm::ICmpInst& ICI,
    llvm::IntrinsicInst* II,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:729

Parameters

llvm::ICmpInst& ICI
llvm::IntrinsicInst* II
const llvm::APInt& C

llvm::Instruction* foldICmpEquality(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:680

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldICmpInstWithConstant(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:675

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction*
foldICmpInstWithConstantAllowUndef(
    llvm::ICmpInst& Cmp,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:677

Parameters

llvm::ICmpInst& Cmp
const llvm::APInt& C

llvm::Instruction* foldICmpInstWithConstantNotInt(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:676

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldICmpIntrinsicWithConstant(
    llvm::ICmpInst& ICI,
    llvm::IntrinsicInst* II,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:727

Parameters

llvm::ICmpInst& ICI
llvm::IntrinsicInst* II
const llvm::APInt& C

llvm::Instruction* foldICmpMulConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Mul,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:699

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Mul
const llvm::APInt& C

llvm::Instruction* foldICmpOrConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Or,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:697

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Or
const llvm::APInt& C

llvm::Instruction* foldICmpSRemConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* UDiv,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:705

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* UDiv
const llvm::APInt& C

llvm::Instruction* foldICmpSelectConstant(
    llvm::ICmpInst& Cmp,
    llvm::SelectInst* Select,
    llvm::ConstantInt* C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:689

Parameters

llvm::ICmpInst& Cmp
llvm::SelectInst* Select
llvm::ConstantInt* C

llvm::Instruction* foldICmpShlConstConst(
    llvm::ICmpInst& I,
    llvm::Value* ShAmt,
    const llvm::APInt& C1,
    const llvm::APInt& C2)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:721

Parameters

llvm::ICmpInst& I
llvm::Value* ShAmt
const llvm::APInt& C1
const llvm::APInt& C2

llvm::Instruction* foldICmpShlConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Shl,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:701

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Shl
const llvm::APInt& C

llvm::Instruction* foldICmpShrConstConst(
    llvm::ICmpInst& I,
    llvm::Value* ShAmt,
    const llvm::APInt& C1,
    const llvm::APInt& C2)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:719

Parameters

llvm::ICmpInst& I
llvm::Value* ShAmt
const llvm::APInt& C1
const llvm::APInt& C2

llvm::Instruction* foldICmpShrConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Shr,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:703

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Shr
const llvm::APInt& C

llvm::Instruction* foldICmpSubConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Sub,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:711

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Sub
const llvm::APInt& C

llvm::Instruction* foldICmpTruncConstant(
    llvm::ICmpInst& Cmp,
    llvm::TruncInst* Trunc,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:691

Parameters

llvm::ICmpInst& Cmp
llvm::TruncInst* Trunc
const llvm::APInt& C

llvm::Instruction* foldICmpUDivConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* UDiv,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:707

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* UDiv
const llvm::APInt& C

llvm::Instruction* foldICmpUsingKnownBits(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:672

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldICmpWithCastOp(
    llvm::ICmpInst& ICmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:669

Parameters

llvm::ICmpInst& ICmp

llvm::Instruction* foldICmpWithConstant(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:674

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldICmpWithDominatingICmp(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:673

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldICmpWithZero(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:683

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldICmpWithZextOrSext(
    llvm::ICmpInst& ICmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:670

Parameters

llvm::ICmpInst& ICmp

llvm::Instruction* foldICmpXorConstant(
    llvm::ICmpInst& Cmp,
    llvm::BinaryOperator* Xor,
    const llvm::APInt& C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:695

Parameters

llvm::ICmpInst& Cmp
llvm::BinaryOperator* Xor
const llvm::APInt& C

llvm::Instruction* foldIRemByPowerOfTwoToBitTest(
    llvm::ICmpInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:681

Parameters

llvm::ICmpInst& I

llvm::Instruction* foldIntegerTypedPHI(
    llvm::PHINode& PN)

Description

If an integer typed PHI has only one use which is an IntToPtr operation, replace the PHI with an existing pointer typed PHI if it exists. Otherwise insert a new pointer typed PHI and replace the original one.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:650

Parameters

llvm::PHINode& PN

llvm::Instruction*
foldIntrinsicWithOverflowCommon(
    llvm::IntrinsicInst* II)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:369

Parameters

llvm::IntrinsicInst* II

llvm::Instruction* foldItoFPtoI(
    llvm::CastInst& FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:142

Parameters

llvm::CastInst& FI

llvm::Value* foldLogicOfFCmps(
    llvm::FCmpInst* LHS,
    llvm::FCmpInst* RHS,
    bool IsAnd,
    bool IsLogicalSelect = false)

Description

Optimize (fcmp) & (fcmp) or (fcmp)|(fcmp). NOTE: Unlike most of instcombine, this returns a Value which should already be inserted into the function.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:360

Parameters

llvm::FCmpInst* LHS
llvm::FCmpInst* RHS
bool IsAnd
bool IsLogicalSelect = false

llvm::Value* foldMultiplicationOverflowCheck(
    llvm::ICmpInst& Cmp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:685

Parameters

llvm::ICmpInst& Cmp

llvm::Instruction* foldNot(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:330

Parameters

llvm::BinaryOperator& I

llvm::Instruction* foldOpIntoPhi(
    llvm::Instruction& I,
    llvm::PHINode* PN)

Description

Given a binary operator, cast instruction, or select which has a PHI node as operand #0, see if we can fold the instruction into the PHI (which is only possible if all operands to the PHI are constants).

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:612

Parameters

llvm::Instruction& I
llvm::PHINode* PN

llvm::Instruction* foldPHIArgBinOpIntoPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:639

Parameters

llvm::PHINode& PN

llvm::Instruction*
foldPHIArgExtractValueInstructionIntoPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:641

Parameters

llvm::PHINode& PN

llvm::Instruction* foldPHIArgGEPIntoPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:642

Parameters

llvm::PHINode& PN

llvm::Instruction*
foldPHIArgInsertValueInstructionIntoPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:640

Parameters

llvm::PHINode& PN

llvm::Instruction* foldPHIArgIntToPtrToPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:645

Parameters

llvm::PHINode& PN

llvm::Instruction* foldPHIArgLoadIntoPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:643

Parameters

llvm::PHINode& PN

llvm::Instruction* foldPHIArgOpIntoPHI(
    llvm::PHINode& PN)

Description

Try to rotate an operation below a PHI node, using PHI nodes for its operands.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:638

Parameters

llvm::PHINode& PN

llvm::Instruction* foldPHIArgZextsIntoPHI(
    llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:644

Parameters

llvm::PHINode& PN

llvm::Instruction* foldSPFofSPF(
    llvm::Instruction* Inner,
    llvm::SelectPatternFlavor SPF1,
    llvm::Value* A,
    llvm::Value* B,
    llvm::Instruction& Outer,
    llvm::SelectPatternFlavor SPF2,
    llvm::Value* C)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:737

Parameters

llvm::Instruction* Inner
llvm::SelectPatternFlavor SPF1
llvm::Value* A
llvm::Value* B
llvm::Instruction& Outer
llvm::SelectPatternFlavor SPF2
llvm::Value* C

llvm::Instruction* foldSelectExtConst(
    llvm::SelectInst& Sel)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:734

Parameters

llvm::SelectInst& Sel

llvm::Instruction* foldSelectICmp(
    ICmpInst::Predicate Pred,
    llvm::SelectInst* SI,
    llvm::Value* RHS,
    const llvm::ICmpInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:658

Parameters

ICmpInst::Predicate Pred
llvm::SelectInst* SI
llvm::Value* RHS
const llvm::ICmpInst& I

llvm::Instruction* foldSelectInstWithICmp(
    llvm::SelectInst& SI,
    llvm::ICmpInst* ICI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:740

Parameters

llvm::SelectInst& SI
llvm::ICmpInst* ICI

llvm::Instruction* foldSelectIntoOp(
    llvm::SelectInst& SI,
    llvm::Value*,
    llvm::Value*)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:736

Parameters

llvm::SelectInst& SI
llvm::Value*
llvm::Value*

llvm::Instruction* foldSelectOpOp(
    llvm::SelectInst& SI,
    llvm::Instruction* TI,
    llvm::Instruction* FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:735

Parameters

llvm::SelectInst& SI
llvm::Instruction* TI
llvm::Instruction* FI

llvm::Instruction* foldSelectShuffle(
    llvm::ShuffleVectorInst& Shuf)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:607

Parameters

llvm::ShuffleVectorInst& Shuf

llvm::Instruction* foldSelectValueEquivalence(
    llvm::SelectInst& SI,
    llvm::ICmpInst& ICI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:741

Parameters

llvm::SelectInst& SI
llvm::ICmpInst& ICI

llvm::Instruction* foldSignBitTest(
    llvm::ICmpInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:682

Parameters

llvm::ICmpInst& I

llvm::Instruction*
foldVariableSignZeroExtensionOfVariableHighBitExtract(
    llvm::BinaryOperator& OldAShr)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:117

Parameters

llvm::BinaryOperator& OldAShr

llvm::Instruction* foldVectorBinop(
    llvm::BinaryOperator& Inst)

Description

Canonicalize the position of binops relative to shufflevector.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:605

Parameters

llvm::BinaryOperator& Inst

llvm::Instruction* foldVectorSelect(
    llvm::SelectInst& Sel)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:606

Parameters

llvm::SelectInst& Sel

llvm::Value* foldXorOfICmps(
    llvm::ICmpInst* LHS,
    llvm::ICmpInst* RHS,
    llvm::BinaryOperator& Xor)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:350

Parameters

llvm::ICmpInst* LHS
llvm::ICmpInst* RHS
llvm::BinaryOperator& Xor

void freelyInvertAllUsersOf(llvm::Value* V)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:332

Parameters

llvm::Value* V

bool freezeOtherUses(llvm::FreezeInst& FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:175

Parameters

llvm::FreezeInst& FI

llvm::Value* getSelectCondition(llvm::Value* A,
                                llvm::Value* B)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:367

Parameters

llvm::Value* A
llvm::Value* B

llvm::Value* insertRangeTest(
    llvm::Value* V,
    const llvm::APInt& Lo,
    const llvm::APInt& Hi,
    bool isSigned,
    bool Inside)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:743

Parameters

llvm::Value* V
const llvm::APInt& Lo
const llvm::APInt& Hi
bool isSigned
bool Inside

bool isDesirableIntType(
    unsigned int BitWidth) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:197

Parameters

unsigned int BitWidth

Instruction::CastOps isEliminableCastPair(
    const llvm::CastInst* CI1,
    const llvm::CastInst* CI2)

Description

Determine if a pair of casts can be replaced by a single cast.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:344

Parameters

const llvm::CastInst* CI1
The first of a pair of casts.
const llvm::CastInst* CI2
The second of a pair of casts.

Returns

0 if the cast pair cannot be eliminated, otherwise returns an Instruction::CastOps value for a cast that can replace the pair, casting CI1->getSrcTy() to CI2->getDstTy().

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:480

Parameters

const llvm::Value* V
bool OrZero = false
unsigned int Depth = 0
const llvm::Instruction* CxtI = nullptr

llvm::Instruction* matchBSwapOrBitReverse(
    llvm::Instruction& I,
    bool MatchBSwaps,
    bool MatchBitReversals)

Description

Given an initial instruction, check to see if it is the root of a bswap/bitreverse idiom. If so, return the equivalent bswap/bitreverse intrinsic.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:751

Parameters

llvm::Instruction& I
bool MatchBSwaps
bool MatchBitReversals

llvm::Instruction* matchSAddSubSat(
    llvm::IntrinsicInst& MinMax1)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:329

Parameters

llvm::IntrinsicInst& MinMax1

llvm::Value* matchSelectFromAndOr(llvm::Value* A,
                                  llvm::Value* B,
                                  llvm::Value* C,
                                  llvm::Value* D)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:366

Parameters

llvm::Value* A
llvm::Value* B
llvm::Value* C
llvm::Value* D

bool matchThreeWayIntCompare(
    llvm::SelectInst* SI,
    llvm::Value*& LHS,
    llvm::Value*& RHS,
    llvm::ConstantInt*& Less,
    llvm::ConstantInt*& Equal,
    llvm::ConstantInt*& Greater)

Description

Match a select chain which produces one of three values based on whether the LHS is less than, equal to, or greater than RHS respectively. Return true if we matched a three way compare idiom. The LHS, RHS, Less, Equal and Greater values are saved in the matching process and returned to the caller.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:570

Parameters

llvm::SelectInst* SI
llvm::Value*& LHS
llvm::Value*& RHS
llvm::ConstantInt*& Less
llvm::ConstantInt*& Equal
llvm::ConstantInt*& Greater

bool mergeStoreIntoSuccessor(llvm::StoreInst& SI)

Description

Try to transform: if () { *P = v1; } else { *P = v2 } or: *P = v1; if () { *P = v2; } into a phi node with a store in the successor.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:746

Parameters

llvm::StoreInst& SI

llvm::Instruction* narrowBinOp(
    llvm::TruncInst& Trunc)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:324

Parameters

llvm::TruncInst& Trunc

llvm::Instruction* narrowFunnelShift(
    llvm::TruncInst& Trunc)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:327

Parameters

llvm::TruncInst& Trunc

llvm::Instruction* narrowMaskedBinOp(
    llvm::BinaryOperator& And)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:325

Parameters

llvm::BinaryOperator& And

llvm::Instruction* narrowMathIfNoOverflow(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:326

Parameters

llvm::BinaryOperator& I

llvm::Instruction* optimizeBitCastFromPhi(
    llvm::CastInst& CI,
    llvm::PHINode* PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:328

Parameters

llvm::CastInst& CI
llvm::PHINode* PN

llvm::Value*
pushFreezeToPreventPoisonFromPropagating(
    llvm::FreezeInst& FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:174

Parameters

llvm::FreezeInst& FI

llvm::Value*
reassociateShiftAmtsOfTwoSameDirectionShifts(
    llvm::BinaryOperator* Sh0,
    const llvm::SimplifyQuery& SQ,
    bool AnalyzeForSignBitExtraction = false)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:112

Parameters

llvm::BinaryOperator* Sh0
const llvm::SimplifyQuery& SQ
bool AnalyzeForSignBitExtraction = false

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:405

Parameters

llvm::Instruction& I
llvm::Value* V

llvm::Instruction* replaceOperand(
    llvm::Instruction& I,
    unsigned int OpNum,
    llvm::Value* V)

Description

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

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:426

Parameters

llvm::Instruction& I
unsigned int OpNum
llvm::Value* V

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

Description

Replace use and add the previously used value to the worklist.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:433

Parameters

llvm::Use& U
llvm::Value* NewValue

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:189

Parameters

llvm::SelectInst* SI
const llvm::ICmpInst* Icmp
const unsigned int SIOpd

bool run()

Description

Run the combiner over the entire worklist until it is empty.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:79

Returns

true if the IR is changed.

llvm::Instruction* scalarizePHI(
    llvm::ExtractElementInst& EI,
    llvm::PHINode* PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:320

Parameters

llvm::ExtractElementInst& EI
llvm::PHINode* PN

bool shouldChangeType(
    unsigned int FromBitWidth,
    unsigned int ToBitWidth) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:198

Parameters

unsigned int FromBitWidth
unsigned int ToBitWidth

bool shouldChangeType(llvm::Type* From,
                      llvm::Type* To) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:199

Parameters

llvm::Type* From
llvm::Type* To

bool shouldOptimizeCast(llvm::CastInst* CI)

Description

Classify whether a cast is worth optimizing. This is a helper to decide whether the simplification of logic(cast(A), cast(B)) to cast(logic(A, B)) should be performed.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:211

Parameters

llvm::CastInst* CI
The cast we are interested in.

Returns

true if this cast actually results in any code being generated and if it cannot already be eliminated by some other transformation.

bool simplifyDivRemOfSelectWithZeroOp(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:100

Parameters

llvm::BinaryOperator& I

llvm::Value* simplifyIntToPtrRoundTripCast(
    llvm::Value* Val)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:346

Parameters

llvm::Value* Val

llvm::Instruction* simplifyMaskedGather(
    llvm::IntrinsicInst& II)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:238

Parameters

llvm::IntrinsicInst& II

llvm::Value* simplifyMaskedLoad(
    llvm::IntrinsicInst& II)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:236

Parameters

llvm::IntrinsicInst& II

llvm::Instruction* simplifyMaskedScatter(
    llvm::IntrinsicInst& II)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:239

Parameters

llvm::IntrinsicInst& II

llvm::Instruction* simplifyMaskedStore(
    llvm::IntrinsicInst& II)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:237

Parameters

llvm::IntrinsicInst& II

llvm::Value* simplifyRangeCheck(
    llvm::ICmpInst* Cmp0,
    llvm::ICmpInst* Cmp1,
    bool Inverted)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:106

Parameters

llvm::ICmpInst* Cmp0
llvm::ICmpInst* Cmp1
bool Inverted

llvm::Value* simplifyShrShlDemandedBits(
    llvm::Instruction* Shr,
    const llvm::APInt& ShrOp1,
    llvm::Instruction* Shl,
    const llvm::APInt& ShlOp1,
    const llvm::APInt& DemandedMask,
    llvm::KnownBits& Known)

Description

Helper routine of SimplifyDemandedUseBits. It tries to simplify demanded bit for "r1 = shr x, c1; r2 = shl r1, c2" instruction sequence.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:592

Parameters

llvm::Instruction* Shr
const llvm::APInt& ShrOp1
llvm::Instruction* Shl
const llvm::APInt& ShlOp1
const llvm::APInt& DemandedMask
llvm::KnownBits& Known

bool sinkNotIntoOtherHandOfAndOrOr(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:109

Parameters

llvm::BinaryOperator& I

llvm::Instruction* transformCallThroughTrampoline(
    llvm::CallBase& Call,
    llvm::IntrinsicInst& Tramp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:233

Parameters

llvm::CallBase& Call
llvm::IntrinsicInst& Tramp

bool transformConstExprCastCall(
    llvm::CallBase& Call)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:232

Parameters

llvm::CallBase& Call

llvm::Instruction* transformSExtICmp(
    llvm::ICmpInst* ICI,
    llvm::Instruction& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:252

Parameters

llvm::ICmpInst* ICI
llvm::Instruction& CI

llvm::Instruction* transformZExtICmp(
    llvm::ICmpInst* ICI,
    llvm::ZExtInst& CI)

Description

Transform (zext icmp) to bitwise / integer operations in order to eliminate it.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:250

Parameters

llvm::ICmpInst* ICI
The icmp of the (zext icmp) pair we are interested in.
llvm::ZExtInst& CI
The zext of the (zext icmp) pair we are interested in.

Returns

null if the transformation cannot be performed. If the transformation can be performed the new instruction that replaces the (zext icmp) pair will be returned.

llvm::Value* tryFactorization(
    llvm::BinaryOperator&,
    Instruction::BinaryOps,
    llvm::Value*,
    llvm::Value*,
    llvm::Value*,
    llvm::Value*)

Description

This tries to simplify binary operations by factorizing out common terms (e. g. "(A*B)+(A*C)" -> "A*(B+C)").

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:562

Parameters

llvm::BinaryOperator&
Instruction::BinaryOps
llvm::Value*
llvm::Value*
llvm::Value*
llvm::Value*

llvm::Instruction* tryOptimizeCall(
    llvm::CallInst* CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:231

Parameters

llvm::CallInst* CI

llvm::Instruction* visitAShr(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:119

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitAdd(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:89

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitAddrSpaceCast(
    llvm::AddrSpaceCastInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:141

Parameters

llvm::AddrSpaceCastInst& CI

llvm::Instruction* visitAllocSite(
    llvm::Instruction& FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:154

Parameters

llvm::Instruction& FI

llvm::Instruction* visitAllocaInst(
    llvm::AllocaInst& AI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:153

Parameters

llvm::AllocaInst& AI

llvm::Instruction* visitAnd(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:107

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitAtomicRMWInst(
    llvm::AtomicRMWInst& SI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:158

Parameters

llvm::AtomicRMWInst& SI

llvm::Instruction* visitBitCast(
    llvm::BitCastInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:140

Parameters

llvm::BitCastInst& CI

llvm::Instruction* visitBranchInst(
    llvm::BranchInst& BI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:160

Parameters

llvm::BranchInst& BI

llvm::Instruction* visitCallBase(
    llvm::CallBase& Call)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:230

Parameters

llvm::CallBase& Call

llvm::Instruction* visitCallBrInst(
    llvm::CallBrInst& CBI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:146

Parameters

llvm::CallBrInst& CBI

llvm::Instruction* visitCallInst(
    llvm::CallInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:144

Parameters

llvm::CallInst& CI

llvm::Instruction* visitExtractElementInst(
    llvm::ExtractElementInst& EI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:169

Parameters

llvm::ExtractElementInst& EI

llvm::Instruction* visitExtractValueInst(
    llvm::ExtractValueInst& EV)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:171

Parameters

llvm::ExtractValueInst& EV

llvm::Instruction* visitFAdd(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:90

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitFCmpInst(
    llvm::FCmpInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:122

Parameters

llvm::FCmpInst& I

llvm::Instruction* visitFDiv(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:105

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitFMul(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:96

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitFNeg(
    llvm::UnaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:88

Parameters

llvm::UnaryOperator& I

llvm::Instruction* visitFPExt(llvm::CastInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:133

Parameters

llvm::CastInst& CI

llvm::Instruction* visitFPToSI(
    llvm::FPToSIInst& FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:135

Parameters

llvm::FPToSIInst& FI

llvm::Instruction* visitFPToUI(
    llvm::FPToUIInst& FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:134

Parameters

llvm::FPToUIInst& FI

llvm::Instruction* visitFPTrunc(
    llvm::FPTruncInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:132

Parameters

llvm::FPTruncInst& CI

llvm::Instruction* visitFRem(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:99

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitFSub(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:94

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitFenceInst(
    llvm::FenceInst& FI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:161

Parameters

llvm::FenceInst& FI

llvm::Instruction* visitFree(llvm::CallInst& FI,
                             llvm::Value* FreedOp)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:155

Parameters

llvm::CallInst& FI
llvm::Value* FreedOp

llvm::Instruction* visitFreeze(
    llvm::FreezeInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:177

Parameters

llvm::FreezeInst& I

llvm::Instruction* visitGEPOfBitcast(
    llvm::BitCastInst* BCI,
    llvm::GetElementPtrInst& GEP)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:152

Parameters

llvm::BitCastInst* BCI
llvm::GetElementPtrInst& GEP

llvm::Instruction* visitGEPOfGEP(
    llvm::GetElementPtrInst& GEP,
    llvm::GEPOperator* Src)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:151

Parameters

llvm::GetElementPtrInst& GEP
llvm::GEPOperator* Src

llvm::Instruction* visitGetElementPtrInst(
    llvm::GetElementPtrInst& GEP)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:150

Parameters

llvm::GetElementPtrInst& GEP

llvm::Instruction* visitICmpInst(
    llvm::ICmpInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:124

Parameters

llvm::ICmpInst& I

llvm::Instruction* visitInsertElementInst(
    llvm::InsertElementInst& IE)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:168

Parameters

llvm::InsertElementInst& IE

llvm::Instruction* visitInsertValueInst(
    llvm::InsertValueInst& IV)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:167

Parameters

llvm::InsertValueInst& IV

llvm::Instruction* visitInstruction(
    llvm::Instruction& I)

Description

Specify what to return for unhandled instructions.

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:180

Parameters

llvm::Instruction& I

llvm::Instruction* visitIntToPtr(
    llvm::IntToPtrInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:139

Parameters

llvm::IntToPtrInst& CI

llvm::Instruction* visitInvokeInst(
    llvm::InvokeInst& II)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:145

Parameters

llvm::InvokeInst& II

llvm::Instruction* visitLShr(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:120

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitLandingPadInst(
    llvm::LandingPadInst& LI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:172

Parameters

llvm::LandingPadInst& LI

llvm::Instruction* visitLoadInst(
    llvm::LoadInst& LI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:156

Parameters

llvm::LoadInst& LI

llvm::Instruction* visitMul(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:95

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitOr(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:108

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitPHINode(llvm::PHINode& PN)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:149

Parameters

llvm::PHINode& PN

llvm::Instruction* visitPtrToInt(
    llvm::PtrToIntInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:138

Parameters

llvm::PtrToIntInst& CI

llvm::Instruction* visitReturnInst(
    llvm::ReturnInst& RI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:163

Parameters

llvm::ReturnInst& RI

llvm::Instruction* visitSDiv(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:104

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitSExt(llvm::SExtInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:131

Parameters

llvm::SExtInst& CI

llvm::Instruction* visitSIToFP(llvm::CastInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:137

Parameters

llvm::CastInst& CI

llvm::Instruction* visitSRem(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:98

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitSelectInst(
    llvm::SelectInst& SI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:143

Parameters

llvm::SelectInst& SI

llvm::Instruction* visitShl(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:111

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitShuffleVectorInst(
    llvm::ShuffleVectorInst& SVI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:170

Parameters

llvm::ShuffleVectorInst& SVI

llvm::Instruction* visitStoreInst(
    llvm::StoreInst& SI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:157

Parameters

llvm::StoreInst& SI

llvm::Instruction* visitSub(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:93

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitSwitchInst(
    llvm::SwitchInst& SI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:162

Parameters

llvm::SwitchInst& SI

llvm::Instruction* visitTrunc(llvm::TruncInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:129

Parameters

llvm::TruncInst& CI

llvm::Instruction* visitUDiv(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:103

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitUIToFP(llvm::CastInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:136

Parameters

llvm::CastInst& CI

llvm::Instruction* visitURem(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:97

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitUnconditionalBranchInst(
    llvm::BranchInst& BI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:159

Parameters

llvm::BranchInst& BI

llvm::Instruction* visitUnreachableInst(
    llvm::UnreachableInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:164

Parameters

llvm::UnreachableInst& I

llvm::Instruction* visitVAEndInst(
    llvm::VAEndInst& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:173

Parameters

llvm::VAEndInst& I

llvm::Instruction* visitXor(
    llvm::BinaryOperator& I)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:110

Parameters

llvm::BinaryOperator& I

llvm::Instruction* visitZExt(llvm::ZExtInst& CI)

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:130

Parameters

llvm::ZExtInst& CI

bool willNotOverflow(
    BinaryOperator::BinaryOps Opcode,
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI,
    bool IsSigned) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:308

Parameters

BinaryOperator::BinaryOps Opcode
const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI
bool IsSigned

bool willNotOverflowAdd(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI,
    bool IsSigned) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:266

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI
bool IsSigned

bool willNotOverflowMul(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI,
    bool IsSigned) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:302

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI
bool IsSigned

bool willNotOverflowSignedAdd(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:254

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI

bool willNotOverflowSignedMul(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:290

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI

bool willNotOverflowSignedSub(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:272

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI

bool willNotOverflowSub(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI,
    bool IsSigned) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:284

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI
bool IsSigned

bool willNotOverflowUnsignedAdd(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:260

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI

bool willNotOverflowUnsignedMul(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:296

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI

bool willNotOverflowUnsignedSub(
    const llvm::Value* LHS,
    const llvm::Value* RHS,
    const llvm::Instruction& CxtI) const

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:278

Parameters

const llvm::Value* LHS
const llvm::Value* RHS
const llvm::Instruction& CxtI

virtual ~InstCombinerImpl()

Declared at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:74