LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
llvm::InstCombiner Class Reference

InstCombiner - The -instcombine pass. More...

#include <InstCombine.h>

Inheritance diagram for llvm::InstCombiner:
Inheritance graph
[legend]
Collaboration diagram for llvm::InstCombiner:
Collaboration graph
[legend]

Public Types

typedef IRBuilder< true,
TargetFolder,
InstCombineIRInserter
BuilderTy
 

Public Member Functions

 InstCombiner ()
 
virtual bool runOnFunction (Function &F)
 
bool DoOneIteration (Function &F, unsigned ItNum)
 
virtual void getAnalysisUsage (AnalysisUsage &AU) const
 
DataLayoutgetDataLayout () const
 
TargetLibraryInfogetTargetLibraryInfo () const
 
InstructionvisitAdd (BinaryOperator &I)
 
InstructionvisitFAdd (BinaryOperator &I)
 
ValueOptimizePointerDifference (Value *LHS, Value *RHS, Type *Ty)
 
InstructionvisitSub (BinaryOperator &I)
 
InstructionvisitFSub (BinaryOperator &I)
 
InstructionvisitMul (BinaryOperator &I)
 
ValuefoldFMulConst (Instruction *FMulOrDiv, ConstantFP *C, Instruction *InsertBefore)
 
InstructionvisitFMul (BinaryOperator &I)
 
InstructionvisitURem (BinaryOperator &I)
 
InstructionvisitSRem (BinaryOperator &I)
 
InstructionvisitFRem (BinaryOperator &I)
 
bool SimplifyDivRemOfSelect (BinaryOperator &I)
 
InstructioncommonRemTransforms (BinaryOperator &I)
 
InstructioncommonIRemTransforms (BinaryOperator &I)
 Common integer remainder transforms. More...
 
InstructioncommonDivTransforms (BinaryOperator &I)
 
InstructioncommonIDivTransforms (BinaryOperator &I)
 Common integer divide transforms. More...
 
InstructionvisitUDiv (BinaryOperator &I)
 
InstructionvisitSDiv (BinaryOperator &I)
 
InstructionvisitFDiv (BinaryOperator &I)
 
ValueFoldAndOfICmps (ICmpInst *LHS, ICmpInst *RHS)
 FoldAndOfICmps - Fold (icmp)&(icmp) if possible. More...
 
ValueFoldAndOfFCmps (FCmpInst *LHS, FCmpInst *RHS)
 
InstructionvisitAnd (BinaryOperator &I)
 
ValueFoldOrOfICmps (ICmpInst *LHS, ICmpInst *RHS)
 FoldOrOfICmps - Fold (icmp)|(icmp) if possible. More...
 
ValueFoldOrOfFCmps (FCmpInst *LHS, FCmpInst *RHS)
 
InstructionFoldOrWithConstants (BinaryOperator &I, Value *Op, Value *A, Value *B, Value *C)
 
InstructionvisitOr (BinaryOperator &I)
 
InstructionvisitXor (BinaryOperator &I)
 
InstructionvisitShl (BinaryOperator &I)
 
InstructionvisitAShr (BinaryOperator &I)
 
InstructionvisitLShr (BinaryOperator &I)
 
InstructioncommonShiftTransforms (BinaryOperator &I)
 
InstructionFoldFCmp_IntToFP_Cst (FCmpInst &I, Instruction *LHSI, Constant *RHSC)
 
InstructionFoldCmpLoadFromIndexedGlobal (GetElementPtrInst *GEP, GlobalVariable *GV, CmpInst &ICI, ConstantInt *AndCst=0)
 
InstructionvisitFCmpInst (FCmpInst &I)
 
InstructionvisitICmpInst (ICmpInst &I)
 
InstructionvisitICmpInstWithCastAndCast (ICmpInst &ICI)
 
InstructionvisitICmpInstWithInstAndIntCst (ICmpInst &ICI, Instruction *LHS, ConstantInt *RHS)
 
InstructionFoldICmpDivCst (ICmpInst &ICI, BinaryOperator *DivI, ConstantInt *DivRHS)
 
InstructionFoldICmpShrCst (ICmpInst &ICI, BinaryOperator *DivI, ConstantInt *DivRHS)
 FoldICmpShrCst - Handle "icmp(([al]shr X, cst1), cst2)". More...
 
InstructionFoldICmpAddOpCst (Instruction &ICI, Value *X, ConstantInt *CI, ICmpInst::Predicate Pred)
 FoldICmpAddOpCst - Fold "icmp pred (X+CI), X". More...
 
InstructionFoldGEPICmp (GEPOperator *GEPLHS, Value *RHS, ICmpInst::Predicate Cond, Instruction &I)
 
InstructionFoldShiftByConstant (Value *Op0, ConstantInt *Op1, BinaryOperator &I)
 
InstructioncommonCastTransforms (CastInst &CI)
 Implement the transforms common to all CastInst visitors. More...
 
InstructioncommonPointerCastTransforms (CastInst &CI)
 Implement the transforms for cast of pointer (bitcast/ptrtoint) More...
 
InstructionvisitTrunc (TruncInst &CI)
 
InstructionvisitZExt (ZExtInst &CI)
 
InstructionvisitSExt (SExtInst &CI)
 
InstructionvisitFPTrunc (FPTruncInst &CI)
 
InstructionvisitFPExt (CastInst &CI)
 
InstructionvisitFPToUI (FPToUIInst &FI)
 
InstructionvisitFPToSI (FPToSIInst &FI)
 
InstructionvisitUIToFP (CastInst &CI)
 
InstructionvisitSIToFP (CastInst &CI)
 
InstructionvisitPtrToInt (PtrToIntInst &CI)
 
InstructionvisitIntToPtr (IntToPtrInst &CI)
 
InstructionvisitBitCast (BitCastInst &CI)
 
InstructionvisitAddrSpaceCast (AddrSpaceCastInst &CI)
 
InstructionFoldSelectOpOp (SelectInst &SI, Instruction *TI, Instruction *FI)
 
InstructionFoldSelectIntoOp (SelectInst &SI, Value *, Value *)
 
InstructionFoldSPFofSPF (Instruction *Inner, SelectPatternFlavor SPF1, Value *A, Value *B, Instruction &Outer, SelectPatternFlavor SPF2, Value *C)
 
InstructionvisitSelectInst (SelectInst &SI)
 
InstructionvisitSelectInstWithICmp (SelectInst &SI, ICmpInst *ICI)
 
InstructionvisitCallInst (CallInst &CI)
 
InstructionvisitInvokeInst (InvokeInst &II)
 
InstructionSliceUpIllegalIntegerPHI (PHINode &PN)
 
InstructionvisitPHINode (PHINode &PN)
 
InstructionvisitGetElementPtrInst (GetElementPtrInst &GEP)
 
InstructionvisitAllocaInst (AllocaInst &AI)
 
InstructionvisitAllocSite (Instruction &FI)
 
InstructionvisitFree (CallInst &FI)
 
InstructionvisitLoadInst (LoadInst &LI)
 
InstructionvisitStoreInst (StoreInst &SI)
 
InstructionvisitBranchInst (BranchInst &BI)
 
InstructionvisitSwitchInst (SwitchInst &SI)
 
InstructionvisitInsertElementInst (InsertElementInst &IE)
 
InstructionvisitExtractElementInst (ExtractElementInst &EI)
 
InstructionvisitShuffleVectorInst (ShuffleVectorInst &SVI)
 
InstructionvisitExtractValueInst (ExtractValueInst &EV)
 
InstructionvisitLandingPadInst (LandingPadInst &LI)
 
InstructionvisitInstruction (Instruction &I)
 
InstructionInsertNewInstBefore (Instruction *New, Instruction &Old)
 
InstructionInsertNewInstWith (Instruction *New, Instruction &Old)
 
InstructionReplaceInstUsesWith (Instruction &I, Value *V)
 
InstructionEraseInstFromFunction (Instruction &I)
 
void ComputeMaskedBits (Value *V, APInt &KnownZero, APInt &KnownOne, unsigned Depth=0) const
 
bool MaskedValueIsZero (Value *V, const APInt &Mask, unsigned Depth=0) const
 
unsigned ComputeNumSignBits (Value *Op, unsigned Depth=0) const
 
- Public Member Functions inherited from llvm::FunctionPass
 FunctionPass (char &pid)
 
PasscreatePrinterPass (raw_ostream &O, const std::string &Banner) const
 createPrinterPass - Get a function printer pass. More...
 
virtual void assignPassManager (PMStack &PMS, PassManagerType T)
 
virtual PassManagerType getPotentialPassManagerType () const
 Return what kind of Pass Manager can manage this pass. More...
 
- Public Member Functions inherited from llvm::Pass
 Pass (PassKind K, char &pid)
 
virtual ~Pass ()
 
PassKind getPassKind () const
 
virtual const char * getPassName () const
 
AnalysisID getPassID () const
 getPassID - Return the PassID number that corresponds to this pass. More...
 
virtual bool doInitialization (Module &)
 
virtual bool doFinalization (Module &)
 
virtual void print (raw_ostream &O, const Module *M) const
 
void dump () const
 
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not. More...
 
void setResolver (AnalysisResolver *AR)
 
AnalysisResolvergetResolver () const
 
virtual void releaseMemory ()
 
virtual void * getAdjustedAnalysisPointer (AnalysisID ID)
 
virtual ImmutablePassgetAsImmutablePass ()
 
virtual PMDataManagergetAsPMDataManager ()
 
virtual void verifyAnalysis () const
 
virtual void dumpPassStructure (unsigned Offset=0)
 
template<typename AnalysisType >
AnalysisType * getAnalysisIfAvailable () const
 
bool mustPreserveAnalysisID (char &AID) const
 
template<typename AnalysisType >
AnalysisType & getAnalysis () const
 
template<typename AnalysisType >
AnalysisType & getAnalysis (Function &F)
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI) const
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI, Function &F)
 
- Public Member Functions inherited from llvm::InstVisitor< InstCombiner, Instruction * >
void visit (Iterator Start, Iterator End)
 
void visit (Module &M)
 
void visit (Function &F)
 
void visit (BasicBlock &BB)
 
void visit (Module *M)
 
void visit (Function *F)
 
void visit (BasicBlock *BB)
 
Instructionvisit (Instruction *I)
 
Instructionvisit (Instruction &I)
 
void visitModule (Module &M)
 
void visitFunction (Function &F)
 
void visitBasicBlock (BasicBlock &BB)
 
InstructionvisitReturnInst (ReturnInst &I)
 
InstructionvisitBranchInst (BranchInst &I)
 
InstructionvisitSwitchInst (SwitchInst &I)
 
InstructionvisitIndirectBrInst (IndirectBrInst &I)
 
InstructionvisitResumeInst (ResumeInst &I)
 
InstructionvisitUnreachableInst (UnreachableInst &I)
 
InstructionvisitICmpInst (ICmpInst &I)
 
InstructionvisitFCmpInst (FCmpInst &I)
 
InstructionvisitAllocaInst (AllocaInst &I)
 
InstructionvisitLoadInst (LoadInst &I)
 
InstructionvisitStoreInst (StoreInst &I)
 
InstructionvisitAtomicCmpXchgInst (AtomicCmpXchgInst &I)
 
InstructionvisitAtomicRMWInst (AtomicRMWInst &I)
 
InstructionvisitFenceInst (FenceInst &I)
 
InstructionvisitGetElementPtrInst (GetElementPtrInst &I)
 
InstructionvisitPHINode (PHINode &I)
 
InstructionvisitTruncInst (TruncInst &I)
 
InstructionvisitZExtInst (ZExtInst &I)
 
InstructionvisitSExtInst (SExtInst &I)
 
InstructionvisitFPTruncInst (FPTruncInst &I)
 
InstructionvisitFPExtInst (FPExtInst &I)
 
InstructionvisitFPToUIInst (FPToUIInst &I)
 
InstructionvisitFPToSIInst (FPToSIInst &I)
 
InstructionvisitUIToFPInst (UIToFPInst &I)
 
InstructionvisitSIToFPInst (SIToFPInst &I)
 
InstructionvisitPtrToIntInst (PtrToIntInst &I)
 
InstructionvisitIntToPtrInst (IntToPtrInst &I)
 
InstructionvisitBitCastInst (BitCastInst &I)
 
InstructionvisitAddrSpaceCastInst (AddrSpaceCastInst &I)
 
InstructionvisitSelectInst (SelectInst &I)
 
InstructionvisitVAArgInst (VAArgInst &I)
 
InstructionvisitExtractElementInst (ExtractElementInst &I)
 
InstructionvisitInsertElementInst (InsertElementInst &I)
 
InstructionvisitShuffleVectorInst (ShuffleVectorInst &I)
 
InstructionvisitExtractValueInst (ExtractValueInst &I)
 
InstructionvisitInsertValueInst (InsertValueInst &I)
 
InstructionvisitLandingPadInst (LandingPadInst &I)
 
InstructionvisitDbgDeclareInst (DbgDeclareInst &I)
 
InstructionvisitDbgValueInst (DbgValueInst &I)
 
InstructionvisitDbgInfoIntrinsic (DbgInfoIntrinsic &I)
 
InstructionvisitMemSetInst (MemSetInst &I)
 
InstructionvisitMemCpyInst (MemCpyInst &I)
 
InstructionvisitMemMoveInst (MemMoveInst &I)
 
InstructionvisitMemTransferInst (MemTransferInst &I)
 
InstructionvisitMemIntrinsic (MemIntrinsic &I)
 
InstructionvisitVAStartInst (VAStartInst &I)
 
InstructionvisitVAEndInst (VAEndInst &I)
 
InstructionvisitVACopyInst (VACopyInst &I)
 
InstructionvisitIntrinsicInst (IntrinsicInst &I)
 
InstructionvisitCallInst (CallInst &I)
 
InstructionvisitInvokeInst (InvokeInst &I)
 
InstructionvisitCastInst (CastInst &I)
 
InstructionvisitBinaryOperator (BinaryOperator &I)
 
InstructionvisitCmpInst (CmpInst &I)
 
InstructionvisitTerminatorInst (TerminatorInst &I)
 
InstructionvisitUnaryInstruction (UnaryInstruction &I)
 
InstructionvisitCallSite (CallSite CS)
 
void visitInstruction (Instruction &I)
 

Public Attributes

InstCombineWorklist Worklist
 Worklist - All of the instructions that need to be simplified. More...
 
BuilderTyBuilder
 

Static Public Attributes

static char ID = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::Pass
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID ID)
 

Detailed Description

InstCombiner - The -instcombine pass.

Definition at line 72 of file InstCombine.h.

Member Typedef Documentation

Builder - This is an IRBuilder that automatically inserts new instructions into the worklist when they are created.

Definition at line 86 of file InstCombine.h.

Constructor & Destructor Documentation

llvm::InstCombiner::InstCombiner ( )
inline

Member Function Documentation

Instruction * InstCombiner::commonCastTransforms ( CastInst CI)
Instruction* llvm::InstCombiner::commonDivTransforms ( BinaryOperator I)
Instruction * InstCombiner::commonIDivTransforms ( BinaryOperator I)
Instruction * InstCombiner::commonIRemTransforms ( BinaryOperator I)

Common integer remainder transforms.

This function implements the transforms common to both integer remainder instructions (urem and srem). It is called by the visitors to those integer remainder instructions.

Definition at line 1113 of file InstCombineMulDivRem.cpp.

References llvm::User::getOperand(), I, llvm::A64CC::NV, llvm::User::setOperand(), and simplifyValueKnownNonZero().

Instruction * InstCombiner::commonPointerCastTransforms ( CastInst CI)

Implement the transforms for cast of pointer (bitcast/ptrtoint)

Definition at line 1380 of file InstCombineCasts.cpp.

References llvm::dyn_cast(), llvm::User::getOperand(), llvm::APInt::getSExtValue(), llvm::Value::getType(), llvm::User::setOperand(), llvm::Value::takeName(), and TD.

Instruction* llvm::InstCombiner::commonRemTransforms ( BinaryOperator I)
Instruction * InstCombiner::commonShiftTransforms ( BinaryOperator I)
void llvm::InstCombiner::ComputeMaskedBits ( Value V,
APInt KnownZero,
APInt KnownOne,
unsigned  Depth = 0 
) const
inline

Definition at line 303 of file InstCombine.h.

References llvm::ComputeMaskedBits(), and TD.

unsigned llvm::InstCombiner::ComputeNumSignBits ( Value Op,
unsigned  Depth = 0 
) const
inline

Definition at line 312 of file InstCombine.h.

References llvm::ComputeNumSignBits(), and TD.

Referenced by ProcessUGT_ADDCST_ADD().

bool InstCombiner::DoOneIteration ( Function F,
unsigned  ItNum 
)
Instruction* llvm::InstCombiner::EraseInstFromFunction ( Instruction I)
inline
Value * InstCombiner::FoldAndOfFCmps ( FCmpInst LHS,
FCmpInst RHS 
)

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

Definition at line 1020 of file InstCombineAndOrXor.cpp.

References llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::ConstantInt::get(), getFCmpCode(), getFCmpValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), llvm::CmpInst::makeCmpResultType(), and std::swap().

Value * InstCombiner::FoldAndOfICmps ( ICmpInst LHS,
ICmpInst RHS 
)
Instruction * InstCombiner::FoldCmpLoadFromIndexedGlobal ( GetElementPtrInst GEP,
GlobalVariable GV,
CmpInst ICI,
ConstantInt AndCst = 0 
)

FoldCmpLoadFromIndexedGlobal - Called we see this pattern: cmp pred (load (gep GV, ...)), cmpcst where GV is a global variable with a constant initializer. Try to simplify this into some simple computation that does not need the load. For example we can optimize "icmp eq (load (gep "foo", 0, i)), 0" into "icmp eq i, 3".

If AndCst is non-null, then the loaded value is masked with that constant before doing the comparison. This handles cases like "A[i]&4 == 0".

TrueRangeEnd/FalseRangeEnd - In conjunction with First*Element, these define a state machine that triggers for ranges of values that the index is true or false for. This triggers on things like "abbbbc"[i] == 'b'. This is -2 when undefined, -3 when overdefined, and otherwise the last index in the range (inclusive). We use -2 for undefined here because we use relative comparisons and don't want 0-1 to match -1.

Definition at line 227 of file InstCombineCompares.cpp.

References llvm::CallingConv::C, llvm::ConstantFoldCompareInstOperands(), llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::ConstantInt::get(), llvm::Constant::getAggregateElement(), llvm::ConstantExpr::getAnd(), llvm::Type::getArrayElementType(), llvm::Type::getArrayNumElements(), llvm::Value::getContext(), llvm::ConstantExpr::getExtractValue(), llvm::GlobalVariable::getInitializer(), llvm::Type::getInt32Ty(), llvm::Type::getIntegerBitWidth(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Type::getPrimitiveSizeInBits(), llvm::Intrinsic::getType(), llvm::Value::getType(), llvm::GetElementPtrInst::getType(), llvm::ConstantInt::getZExtValue(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULT, llvm::GetElementPtrInst::isInBounds(), isZero(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and TD.

Instruction * InstCombiner::FoldFCmp_IntToFP_Cst ( FCmpInst I,
Instruction LHSI,
Constant RHSC 
)
Value * InstCombiner::foldFMulConst ( Instruction FMulOrDiv,
ConstantFP C,
Instruction InsertBefore 
)

foldFMulConst() is a helper routine of InstCombiner::visitFMul(). The input FMulOrDiv is a FMul/FDiv with one and only one operand being a constant (i.e. isFMulOrFDivWithConstant(FMulOrDiv) == true). This function is to simplify "FMulOrDiv * C" and returns the resulting expression. Note that this function could return NULL in case the constants cannot be folded into a normal floating-point.

Definition at line 357 of file InstCombineMulDivRem.cpp.

References llvm::dyn_cast(), F(), llvm::ConstantExpr::getFDiv(), llvm::ConstantExpr::getFMul(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::hasOneUse(), isFMulOrFDivWithConstant(), and isNormalFp().

Instruction * InstCombiner::FoldGEPICmp ( GEPOperator GEPLHS,
Value RHS,
ICmpInst::Predicate  Cond,
Instruction I 
)
Instruction * InstCombiner::FoldICmpAddOpCst ( Instruction ICI,
Value X,
ConstantInt CI,
ICmpInst::Predicate  Pred 
)
Instruction * InstCombiner::FoldICmpDivCst ( ICmpInst ICI,
BinaryOperator DivI,
ConstantInt DivRHS 
)
Instruction * InstCombiner::FoldICmpShrCst ( ICmpInst ICI,
BinaryOperator DivI,
ConstantInt DivRHS 
)
Value * InstCombiner::FoldOrOfFCmps ( FCmpInst LHS,
FCmpInst RHS 
)

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

Definition at line 1830 of file InstCombineAndOrXor.cpp.

References llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UNO, llvm::ConstantInt::get(), getFCmpCode(), getFCmpValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), llvm::CmpInst::makeCmpResultType(), and std::swap().

Value * InstCombiner::FoldOrOfICmps ( ICmpInst LHS,
ICmpInst RHS 
)
Instruction * InstCombiner::FoldOrWithConstants ( BinaryOperator I,
Value Op,
Value A,
Value B,
Value C 
)

FoldOrWithConstants - This helper function folds:

((A | B) & C1) | (B & C2)

into:

(A & C1) | B

when the XOR of the two constants is "all ones" (-1).

Definition at line 1896 of file InstCombineAndOrXor.cpp.

References llvm::CallingConv::C, llvm::dyn_cast(), llvm::ConstantInt::getValue(), llvm::APInt::isAllOnesValue(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and llvm::APIntOps::Xor().

Instruction * InstCombiner::FoldSelectIntoOp ( SelectInst SI,
Value TrueVal,
Value FalseVal 
)
Instruction * InstCombiner::FoldSelectOpOp ( SelectInst SI,
Instruction TI,
Instruction FI 
)
Instruction * InstCombiner::FoldShiftByConstant ( Value Op0,
ConstantInt Op1,
BinaryOperator I 
)
Instruction * InstCombiner::FoldSPFofSPF ( Instruction Inner,
SelectPatternFlavor  SPF1,
Value A,
Value B,
Instruction Outer,
SelectPatternFlavor  SPF2,
Value C 
)

FoldSPFofSPF - We have an SPF (e.g. a min or max) of an SPF of the form: SPF2(SPF1(A, B), C)

Definition at line 632 of file InstCombineSelect.cpp.

References llvm::SPF_SMAX, llvm::SPF_SMIN, llvm::SPF_UMAX, and llvm::SPF_UMIN.

Combine redundant false void InstCombiner::getAnalysisUsage ( AnalysisUsage ) const
virtual

getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.

Reimplemented from llvm::Pass.

Definition at line 90 of file InstructionCombining.cpp.

DataLayout* llvm::InstCombiner::getDataLayout ( ) const
inline
TargetLibraryInfo* llvm::InstCombiner::getTargetLibraryInfo ( ) const
inline

Definition at line 104 of file InstCombine.h.

Referenced by GetShiftedValue().

Instruction* llvm::InstCombiner::InsertNewInstBefore ( Instruction New,
Instruction Old 
)
inline
Instruction* llvm::InstCombiner::InsertNewInstWith ( Instruction New,
Instruction Old 
)
inline
bool llvm::InstCombiner::MaskedValueIsZero ( Value V,
const APInt Mask,
unsigned  Depth = 0 
) const
inline

Definition at line 308 of file InstCombine.h.

References llvm::MaskedValueIsZero(), and TD.

Value * InstCombiner::OptimizePointerDifference ( Value LHS,
Value RHS,
Type Ty 
)

Optimize pointer differences into the same array into a size. Consider: &A[10] - &A[0]: we should compile this to "10". LHS/RHS are the pointer operands to the ptrtoint instructions for the LHS/RHS of the subtract.

Definition at line 1285 of file InstCombineAddSub.cpp.

References llvm::EmitGEPOffset(), and TD.

Instruction* llvm::InstCombiner::ReplaceInstUsesWith ( Instruction I,
Value V 
)
inline
bool InstCombiner::runOnFunction ( Function F)
virtual

runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.

Builder - This is an IRBuilder that automatically inserts new instructions into the worklist when they are created.

Implements llvm::FunctionPass.

Definition at line 2497 of file InstructionCombining.cpp.

References llvm::Function::getAttributes(), llvm::Function::getContext(), llvm::AttributeSet::hasAttribute(), llvm::LowerDbgDeclare(), llvm::Attribute::MinSize, and TD.

bool InstCombiner::SimplifyDivRemOfSelect ( BinaryOperator I)

SimplifyDivRemOfSelect - Try to fold a divide or remainder of a select instruction.

Definition at line 600 of file InstCombineMulDivRem.cpp.

References llvm::BasicBlock::begin(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Value::hasOneUse(), I, llvm::User::setOperand(), llvm::A64DB::ST, and llvm::Value::use_empty().

Instruction * InstCombiner::SliceUpIllegalIntegerPHI ( PHINode FirstPhi)

SliceUpIllegalIntegerPHI - This is an integer PHI and we know that it has an illegal type: see if it is only used by trunc or trunc(lshr) operations. If so, we split the PHI into the various pieces being extracted. This sort of thing is introduced when SROA promotes an aggregate to large integer values.

TODO: The user of the trunc may be an bitcast to float/double/vector or an inttoptr. We should produce new PHIs in the right type.

Definition at line 618 of file InstCombinePHI.cpp.

References llvm::PHINode::addIncoming(), llvm::array_pod_sort(), llvm::SmallVectorTemplateCommon< T >::begin(), Builder, llvm::SmallPtrSet< PtrType, SmallSize >::count(), llvm::PHINode::Create(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateLShr(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateTrunc(), llvm::dbgs(), DEBUG, llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::ConstantInt::get(), llvm::UndefValue::get(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::Value::getName(), llvm::PHINode::getNumIncomingValues(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), ReplaceInstUsesWith(), llvm::IRBuilderBase::SetInsertPoint(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::RegState::Undef, llvm::Instruction::use_back(), llvm::Value::use_begin(), and llvm::Value::use_end().

Referenced by visitPHINode().

Instruction * InstCombiner::visitAdd ( BinaryOperator I)
Instruction * InstCombiner::visitAddrSpaceCast ( AddrSpaceCastInst CI)

Definition at line 1860 of file InstCombineCasts.cpp.

Instruction * InstCombiner::visitAllocaInst ( AllocaInst AI)
Instruction * InstCombiner::visitAllocSite ( Instruction FI)
Instruction * InstCombiner::visitAnd ( BinaryOperator I)
Instruction * InstCombiner::visitAShr ( BinaryOperator I)
Instruction * InstCombiner::visitBitCast ( BitCastInst CI)
Instruction * InstCombiner::visitBranchInst ( BranchInst BI)
Instruction * InstCombiner::visitCallInst ( CallInst CI)

visitCallInst - CallInst simplification. This mostly only handles folding of intrinsic instructions. For normal calls, it allows visitCallSite to do the heavy lifting.

Definition at line 201 of file InstCombineCalls.cpp.

References llvm::Intrinsic::arm_neon_vld1, llvm::Intrinsic::arm_neon_vld2, llvm::Intrinsic::arm_neon_vld2lane, llvm::Intrinsic::arm_neon_vld3, llvm::Intrinsic::arm_neon_vld3lane, llvm::Intrinsic::arm_neon_vld4, llvm::Intrinsic::arm_neon_vld4lane, llvm::Intrinsic::arm_neon_vmulls, llvm::Intrinsic::arm_neon_vmullu, llvm::Intrinsic::arm_neon_vst1, llvm::Intrinsic::arm_neon_vst2, llvm::Intrinsic::arm_neon_vst2lane, llvm::Intrinsic::arm_neon_vst3, llvm::Intrinsic::arm_neon_vst3lane, llvm::Intrinsic::arm_neon_vst4, llvm::Intrinsic::arm_neon_vst4lane, llvm::Intrinsic::bswap, llvm::CallingConv::C, llvm::ComputeMaskedBits(), llvm::APInt::countLeadingZeros(), llvm::APInt::countTrailingZeros(), llvm::CastInst::Create(), llvm::InsertValueInst::Create(), llvm::CastInst::CreateSExtOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), llvm::Intrinsic::ctlz, llvm::Intrinsic::cttz, llvm::Function::doesNotThrow(), llvm::CallInst::doesNotThrow(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantFP::get(), llvm::ConstantAggregateZero::get(), llvm::ConstantStruct::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::CallInst::getArgOperand(), llvm::APInt::getBitsSet(), getBitWidth(), llvm::IntegerType::getBitWidth(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::SequentialType::getElementType(), llvm::ConstantInt::getFalse(), llvm::APInt::getHighBitsSet(), llvm::Type::getInt32Ty(), llvm::Type::getIntegerBitWidth(), llvm::IntrinsicInst::getIntrinsicID(), llvm::getKnownAlignment(), llvm::MemIntrinsic::getLength(), llvm::APInt::getLowBitsSet(), llvm::Constant::getNullValue(), llvm::CallInst::getNumArgOperands(), llvm::VectorType::getNumElements(), llvm::getObjectSize(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::BasicBlock::getTerminator(), llvm::ConstantInt::getTrue(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::ConstantInt::getZExtValue(), I, llvm::isFreeCall(), llvm::MemIntrinsic::isVolatile(), IT(), llvm::PatternMatch::m_BSwap(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::Intrinsic::memcpy, llvm::Intrinsic::memset, llvm::Intrinsic::objectsize, llvm::Intrinsic::powi, llvm::Intrinsic::ppc_altivec_lvx, llvm::Intrinsic::ppc_altivec_lvxl, llvm::Intrinsic::ppc_altivec_stvx, llvm::Intrinsic::ppc_altivec_stvxl, llvm::Intrinsic::ppc_altivec_vperm, llvm::Intrinsic::sadd_with_overflow, llvm::CallInst::setArgOperand(), llvm::CallInst::setCalledFunction(), llvm::CallInst::setDoesNotThrow(), llvm::APInt::sext(), llvm::Intrinsic::smul_with_overflow, llvm::Intrinsic::ssub_with_overflow, llvm::A64DB::ST, llvm::Intrinsic::stackrestore, llvm::Intrinsic::stacksave, std::swap(), llvm::Value::takeName(), TD, llvm::Intrinsic::uadd_with_overflow, llvm::APInt::umul_ov(), llvm::Intrinsic::umul_with_overflow, llvm::Intrinsic::usub_with_overflow, llvm::X, llvm::Intrinsic::x86_sse2_cvtsd2si, llvm::Intrinsic::x86_sse2_cvtsd2si64, llvm::Intrinsic::x86_sse2_cvttsd2si, llvm::Intrinsic::x86_sse2_cvttsd2si64, llvm::Intrinsic::x86_sse2_storeu_dq, llvm::Intrinsic::x86_sse2_storeu_pd, llvm::Intrinsic::x86_sse41_pmovsxbw, llvm::Intrinsic::x86_sse41_pmovsxdq, llvm::Intrinsic::x86_sse41_pmovsxwd, llvm::Intrinsic::x86_sse41_pmovzxbw, llvm::Intrinsic::x86_sse41_pmovzxdq, llvm::Intrinsic::x86_sse41_pmovzxwd, llvm::Intrinsic::x86_sse_cvtss2si, llvm::Intrinsic::x86_sse_cvtss2si64, llvm::Intrinsic::x86_sse_cvttss2si, llvm::Intrinsic::x86_sse_cvttss2si64, llvm::Intrinsic::x86_sse_storeu_ps, and llvm::APInt::zext().

Instruction * InstCombiner::visitExtractElementInst ( ExtractElementInst EI)
Instruction * InstCombiner::visitExtractValueInst ( ExtractValueInst EV)
Instruction * InstCombiner::visitFAdd ( BinaryOperator I)
Instruction * InstCombiner::visitFCmpInst ( FCmpInst I)

Orders the operands of the compare so that they are listed from most complex to least complex. This puts constants before unary operators, before binary operators.

Definition at line 3211 of file InstCombineCompares.cpp.

References llvm::CallingConv::C, llvm::Call, llvm::APFloat::clearSign(), llvm::APFloat::cmpLessThan, llvm::APFloat::compare(), llvm::APFloat::convert(), llvm::SelectInst::Create(), llvm::dyn_cast(), F(), llvm::LibFunc::fabs, llvm::LibFunc::fabsf, llvm::LibFunc::fabsl, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::ConstantFP::get(), llvm::CallInst::getArgOperand(), llvm::CallInst::getCalledFunction(), llvm::ConstantExpr::getCompare(), llvm::getComplexity(), llvm::ConstantExpr::getFNeg(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::CmpInst::getPredicate(), llvm::APFloat::getSmallestNormalized(), llvm::CastInst::getSrcTy(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), I, llvm::APFloat::IEEEdouble, llvm::APFloat::IEEEhalf, llvm::APFloat::IEEEquad, llvm::APFloat::IEEEsingle, llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isFP128Ty(), llvm::Type::isHalfTy(), llvm::Type::isPPC_FP128Ty(), llvm::Type::isX86_FP80Ty(), llvm::APFloat::isZero(), llvm_unreachable, llvm::SPII::Load, llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::A64CC::NV, llvm::TargetOpcode::PHI, llvm::APFloat::PPCDoubleDouble, llvm::APFloat::rmNearestTiesToEven, llvm::MCID::Select, llvm::User::setOperand(), llvm::CmpInst::setPredicate(), llvm::SimplifyFCmpInst(), llvm::FCmpInst::swapOperands(), TD, llvm::X, llvm::APFloat::x87DoubleExtended, and Y.

Instruction * InstCombiner::visitFDiv ( BinaryOperator I)
Instruction * InstCombiner::visitFMul ( BinaryOperator I)
Instruction * InstCombiner::visitFPExt ( CastInst CI)

Definition at line 1303 of file InstCombineCasts.cpp.

Instruction * InstCombiner::visitFPToSI ( FPToSIInst FI)
Instruction * InstCombiner::visitFPToUI ( FPToUIInst FI)
Instruction * InstCombiner::visitFPTrunc ( FPTruncInst CI)
Instruction * InstCombiner::visitFree ( CallInst FI)
Instruction * InstCombiner::visitFRem ( BinaryOperator I)

Definition at line 1248 of file InstCombineMulDivRem.cpp.

References llvm::User::getOperand(), I, llvm::SimplifyFRemInst(), and TD.

Instruction * InstCombiner::visitFSub ( BinaryOperator I)
Instruction * InstCombiner::visitGetElementPtrInst ( GetElementPtrInst GEP)

See if we can simplify: X = bitcast A* to B* Y = gep X, <...constant indices...> into a gep of the original struct. This is important for SROA and alias analysis of unions. If "A" is also a bitcast, wait for A/X to be merged.

Definition at line 1073 of file InstructionCombining.cpp.

References llvm::GetElementPtrInst::accumulateConstantOffset(), llvm::SmallVectorImpl< T >::append(), llvm::CastInst::Create(), llvm::GetElementPtrInst::Create(), llvm::GetElementPtrInst::CreateInBounds(), llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::gep_type_begin(), llvm::gep_type_end(), llvm::PointerType::getAddressSpace(), llvm::Type::getArrayElementType(), llvm::SequentialType::getElementType(), llvm::Type::getInt8PtrTy(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::GetElementPtrInst::getNumIndices(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::GetElementPtrInst::getPointerAddressSpace(), llvm::Type::getPointerElementType(), llvm::GetElementPtrInst::getPointerOperandType(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::APInt::getSExtValue(), llvm::Value::getType(), llvm::GetElementPtrInst::getType(), I, llvm::GetElementPtrInst::idx_begin(), llvm::GetElementPtrInst::idx_end(), llvm::isAllocationFn(), llvm::Type::isArrayTy(), llvm::GetElementPtrInst::isInBounds(), llvm::Type::isSized(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_PtrToInt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::User::op_begin(), llvm::User::op_end(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::User::setOperand(), shouldMergeGEPs(), llvm::SimplifyGEPInst(), llvm::Value::stripPointerCasts(), llvm::Value::takeName(), and TD.

Instruction * InstCombiner::visitICmpInst ( ICmpInst I)

Orders the operands of the compare so that they are listed from most complex to least complex. This puts constants before unary operators, before binary operators.

Definition at line 2082 of file InstCombineCompares.cpp.

References llvm::ARM_PROC::A, llvm::APInt::abs(), llvm::CallingConv::C, ComputeSignedMinMaxValuesFromKnownBits(), ComputeUnsignedMinMaxValuesFromKnownBits(), llvm::APInt::countTrailingZeros(), llvm::CmpInst::Create(), llvm::SelectInst::Create(), llvm::BinaryOperator::CreateNot(), DemandedBitsLHSMask(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::Constant::getAllOnesValue(), llvm::APInt::getAllOnesValue(), llvm::ConstantExpr::getBitCast(), getBitWidth(), llvm::ConstantInt::getBitWidth(), llvm::APInt::getBitWidth(), llvm::getComplexity(), llvm::Value::getContext(), llvm::ConstantInt::getFalse(), llvm::ConstantExpr::getICmp(), llvm::CmpInst::getInversePredicate(), llvm::ConstantInt::getLimitedValue(), llvm::APInt::getLowBitsSet(), llvm::Value::getName(), llvm::ConstantExpr::getNot(), llvm::Constant::getNullValue(), llvm::APInt::getOneBitSet(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::User::getOperandUse(), llvm::Instruction::getParent(), llvm::CmpInst::getPredicate(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::ICmpInst::getSignedPredicate(), llvm::CmpInst::getSwappedPredicate(), llvm::ConstantInt::getTrue(), llvm::Value::getType(), llvm::ICmpInst::getUnsignedPredicate(), llvm::ConstantInt::getValue(), llvm::BinaryOperator::hasNoSignedWrap(), llvm::BinaryOperator::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), I, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::ICmpInst::isEquality(), llvm::BinaryOperator::isExact(), llvm::Type::isIntegerTy(), llvm::Type::isIntOrIntVectorTy(), llvm::isKnownToBeAPowerOfTwo(), llvm::APInt::isNegative(), llvm::Type::isPointerTy(), llvm::APInt::isPowerOf2(), isSignBitCheck(), llvm::CmpInst::isSigned(), llvm::CmpInst::isUnsigned(), llvm_unreachable, llvm::SPII::Load, llvm::APInt::logBase2(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Power2(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), NC, llvm::APIntOps::Not(), llvm::A64CC::NV, llvm::TargetOpcode::PHI, ProcessUAddIdiom(), ProcessUGT_ADDCST_ADD(), llvm::MCID::Select, llvm::User::setOperand(), llvm::SimplifyICmpInst(), llvm::APInt::sle(), llvm::APInt::slt(), std::swap(), swapMayExposeCSEOpportunities(), llvm::ICmpInst::swapOperands(), TD, llvm::APInt::uge(), llvm::APInt::ule(), llvm::APInt::ult(), llvm::Value::use_begin(), llvm::X, llvm::APIntOps::Xor(), Y, and llvm::APInt::zext().

Instruction * InstCombiner::visitICmpInstWithCastAndCast ( ICmpInst ICI)
Instruction * InstCombiner::visitICmpInstWithInstAndIntCst ( ICmpInst ICI,
Instruction LHSI,
ConstantInt RHS 
)

visitICmpInstWithInstAndIntCst - Handle "icmp (instr, intcst)".

Definition at line 1055 of file InstCombineCompares.cpp.

References AddOne(), llvm::APIntOps::And(), llvm::Intrinsic::bswap, llvm::APInt::byteSwap(), llvm::CallingConv::C, llvm::ComputeMaskedBits(), llvm::APInt::countTrailingZeros(), llvm::Intrinsic::ctlz, llvm::Intrinsic::ctpop, llvm::Intrinsic::cttz, llvm::dyn_cast(), llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::ConstantExpr::get(), llvm::APInt::getActiveBits(), llvm::ConstantExpr::getAnd(), llvm::ConstantExpr::getAShr(), getBitWidth(), llvm::IntegerType::getBitWidth(), llvm::ConstantInt::getBitWidth(), llvm::APInt::getBitWidth(), llvm::Value::getContext(), llvm::APInt::getHighBitsSet(), llvm::ConstantInt::getLimitedValue(), llvm::APInt::getLowBitsSet(), llvm::ConstantRange::getLower(), llvm::ConstantExpr::getLShr(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), llvm::ConstantExpr::getNot(), llvm::Constant::getNullValue(), llvm::APInt::getOneBitSet(), llvm::Instruction::getOpcode(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Type::getPrimitiveSizeInBits(), llvm::ConstantExpr::getShl(), llvm::ICmpInst::getSignedPredicate(), llvm::ConstantExpr::getSub(), llvm::CmpInst::getSwappedPredicate(), llvm::ConstantExpr::getTrunc(), llvm::Value::getType(), llvm::ConstantInt::getType(), llvm::ICmpInst::getUnsignedPredicate(), llvm::ConstantRange::getUpper(), llvm::ConstantInt::getValue(), llvm::ConstantExpr::getXor(), llvm::ConstantExpr::getZExt(), llvm::ConstantInt::getZExtValue(), llvm::Value::hasOneUse(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::APInt::isAllOnesValue(), llvm::Instruction::isArithmeticShift(), llvm::ICmpInst::isEquality(), llvm::BinaryOperator::isExact(), isHighOnes(), llvm::Instruction::isLogicalShift(), llvm::APInt::isMinValue(), llvm::ConstantInt::isNegative(), llvm::APInt::isNonNegative(), llvm::Constant::isNullValue(), llvm::APInt::isPowerOf2(), llvm::Instruction::isShift(), llvm::APInt::isSignBit(), isSignBitCheck(), llvm::CmpInst::isSigned(), isSignTest(), llvm::CmpInst::isUnsigned(), llvm::ConstantInt::isZero(), LI, llvm::APInt::logBase2(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_PtrToInt(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), llvm::ICmpInst::makeConstantRange(), llvm::PatternMatch::match(), llvm::APIntOps::Or(), P, llvm::User::setOperand(), llvm::APInt::sgt(), SubOne(), llvm::Value::takeName(), llvm::ConstantInt::uge(), llvm::X, llvm::APIntOps::Xor(), and llvm::APInt::zext().

Instruction * InstCombiner::visitInsertElementInst ( InsertElementInst IE)
Instruction* llvm::InstCombiner::visitInstruction ( Instruction I)
inline

Definition at line 210 of file InstCombine.h.

Instruction * InstCombiner::visitIntToPtr ( IntToPtrInst CI)
Instruction * InstCombiner::visitInvokeInst ( InvokeInst II)

Definition at line 757 of file InstCombineCalls.cpp.

Instruction * InstCombiner::visitLandingPadInst ( LandingPadInst LI)
Instruction * InstCombiner::visitLoadInst ( LoadInst LI)
Instruction * InstCombiner::visitLShr ( BinaryOperator I)
Instruction * InstCombiner::visitMul ( BinaryOperator I)
Instruction * InstCombiner::visitOr ( BinaryOperator I)
Instruction * InstCombiner::visitPHINode ( PHINode PN)
Instruction * InstCombiner::visitPtrToInt ( PtrToIntInst CI)
Instruction * InstCombiner::visitSDiv ( BinaryOperator I)
Instruction * InstCombiner::visitSelectInst ( SelectInst SI)
Instruction * InstCombiner::visitSelectInstWithICmp ( SelectInst SI,
ICmpInst ICI 
)
Instruction * InstCombiner::visitSExt ( SExtInst CI)
Instruction * InstCombiner::visitShl ( BinaryOperator I)
Instruction * InstCombiner::visitShuffleVectorInst ( ShuffleVectorInst SVI)
Instruction * InstCombiner::visitSIToFP ( CastInst CI)

Definition at line 1351 of file InstCombineCasts.cpp.

Instruction * InstCombiner::visitSRem ( BinaryOperator I)
Instruction * InstCombiner::visitStoreInst ( StoreInst SI)
Instruction * InstCombiner::visitSub ( BinaryOperator I)
Instruction * InstCombiner::visitSwitchInst ( SwitchInst SI)
Instruction * InstCombiner::visitTrunc ( TruncInst CI)
Instruction * InstCombiner::visitUDiv ( BinaryOperator I)
Instruction * InstCombiner::visitUIToFP ( CastInst CI)

Definition at line 1347 of file InstCombineCasts.cpp.

Instruction * InstCombiner::visitURem ( BinaryOperator I)
Instruction * InstCombiner::visitXor ( BinaryOperator I)
Instruction * InstCombiner::visitZExt ( ZExtInst CI)

Member Data Documentation

BuilderTy* llvm::InstCombiner::Builder
char InstCombiner::ID = 0
static

Definition at line 89 of file InstCombine.h.

InstCombineWorklist llvm::InstCombiner::Worklist

Worklist - All of the instructions that need to be simplified.

Definition at line 82 of file InstCombine.h.

Referenced by AddReachableCodeToWorklist(), GetShiftedValue(), and visitStoreInst().


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