|
LLVM
4.0.0
|
The core instruction combiner logic. More...
#include <InstCombineInternal.h>
Public Types | |
| typedef IRBuilder < TargetFolder, IRBuilderCallbackInserter > | BuilderTy |
| An IRBuilder that automatically inserts new instructions into the worklist. More... | |
Public Attributes | |
| InstCombineWorklist & | Worklist |
| A worklist of the instructions that need to be simplified. More... | |
| BuilderTy * | Builder |
The core instruction combiner logic.
This class provides both the logic to recursively visit instructions and combine them.
Definition at line 160 of file InstCombineInternal.h.
An IRBuilder that automatically inserts new instructions into the worklist.
Definition at line 169 of file InstCombineInternal.h.
|
inline |
Definition at line 193 of file InstCombineInternal.h.
| Instruction * InstCombiner::commonCastTransforms | ( | CastInst & | CI | ) |
Implement the transforms common to all CastInst visitors.
Definition at line 259 of file InstCombineCasts.cpp.
References llvm::CastInst::Create(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::isIntegerTy(), and SI.
| Instruction* llvm::InstCombiner::commonDivTransforms | ( | BinaryOperator & | I | ) |
| Instruction * InstCombiner::commonIDivTransforms | ( | BinaryOperator & | I | ) |
This function implements the transforms common to both integer division instructions (udiv and sdiv).
It is called by the visitors to those integer division instructions. Common integer divide transforms
Definition at line 864 of file InstCombineMulDivRem.cpp.
References llvm::BinaryOperator::Create(), llvm::SelectInst::Create(), llvm::ConstantInt::get(), llvm::APInt::getBitWidth(), llvm::APInt::getLimitedValue(), llvm::APInt::getOneBitSet(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), I, llvm::Instruction::isExact(), llvm::Type::isIntegerTy(), IsMultiple(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_NSWMul(), llvm::PatternMatch::m_NSWShl(), llvm::PatternMatch::m_NUWMul(), llvm::PatternMatch::m_NUWShl(), llvm::PatternMatch::m_SDiv(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_SRem(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_UDiv(), llvm::PatternMatch::m_URem(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), MultiplyOverflows(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::Instruction::setIsExact(), llvm::User::setOperand(), simplifyValueKnownNonZero(), and X.
| Instruction * InstCombiner::commonIRemTransforms | ( | BinaryOperator & | I | ) |
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. Common integer remainder transforms
Definition at line 1446 of file InstCombineMulDivRem.cpp.
References llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), I, llvm::PatternMatch::m_APInt(), llvm::PatternMatch::match(), llvm::User::setOperand(), SI, and simplifyValueKnownNonZero().
| Instruction * InstCombiner::commonPointerCastTransforms | ( | CastInst & | CI | ) |
Implement the transforms for cast of pointer (bitcast/ptrtoint)
Definition at line 1516 of file InstCombineCasts.cpp.
References GEP, llvm::User::getOperand(), and llvm::User::setOperand().
| Instruction* llvm::InstCombiner::commonRemTransforms | ( | BinaryOperator & | I | ) |
| Instruction * InstCombiner::commonShiftTransforms | ( | BinaryOperator & | I | ) |
Definition at line 24 of file InstCombineShifts.cpp.
References A, assert(), B, C, llvm::BinaryOperator::Create(), llvm::ConstantInt::get(), llvm::Value::getName(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), I, llvm::isKnownNonNegative(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_Power2(), llvm::PatternMatch::m_SRem(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::User::setOperand(), and SI.
|
inline |
Definition at line 474 of file InstCombineInternal.h.
References llvm::computeKnownBits().
Referenced by foldCttzCtlz().
|
inline |
Definition at line 484 of file InstCombineInternal.h.
References llvm::ComputeNumSignBits(), and llvm::Depth.
Referenced by processUGT_ADDCST_ADD().
|
inline |
Definition at line 497 of file InstCombineInternal.h.
References llvm::computeOverflowForUnsignedAdd().
|
inline |
Definition at line 493 of file InstCombineInternal.h.
References llvm::computeOverflowForUnsignedMul().
|
inline |
Definition at line 488 of file InstCombineInternal.h.
References llvm::ComputeSignBit(), and llvm::Depth.
Referenced by canReplaceGEPIdxWithZero().
|
inline |
Creates a result tuple for an overflow intrinsic II with a given Result and a constant Overflow value.
Definition at line 444 of file InstCombineInternal.h.
References llvm::InsertValueInst::Create(), llvm::ConstantStruct::get(), llvm::UndefValue::get(), llvm::Value::getType(), and llvm::ARM_MB::ST.
| bool InstCombiner::dominatesAllUses | ( | const Instruction * | DI, |
| const Instruction * | UI, | ||
| const BasicBlock * | DB | ||
| ) | const |
True when DB dominates all uses of DI except UI.
Check that one use is in the same block as the definition and all other uses are in blocks dominated by a given block.
UI must be in the same block as DI. The routine checks that the DI parent and DB are different.
| DI | Definition |
| UI | Use |
| DB | Block that must dominate all uses of DI outside the parent block |
UI is the only use of DI in the parent block and all other uses of DI are in blocks dominated by DB. Definition at line 3809 of file InstCombineCompares.cpp.
References assert(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), and llvm::Value::users().
|
inline |
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.
Definition at line 457 of file InstCombineInternal.h.
References assert(), llvm::dbgs(), DEBUG, llvm::Instruction::eraseFromParent(), llvm::User::getNumOperands(), llvm::User::operands(), and llvm::Value::use_empty().
Referenced by combineLoadToOperationType(), removeTriviallyEmptyRange(), simplifyMaskedScatter(), simplifyMaskedStore(), simplifyX86MaskedStore(), visitAllocaInst(), and visitStoreInst().
Optimize (fcmp)&(fcmp).
NOTE: Unlike the rest of instcombine, this returns a Value which should already be inserted into the function.
Definition at line 1026 of file InstCombineAndOrXor.cpp.
References llvm::CmpInst::FCMP_ORD, getFCmpCode(), getFCmpValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), and std::swap().
Fold (icmp)&(icmp) if possible.
Definition at line 793 of file InstCombineAndOrXor.cpp.
References llvm::MCID::Add, llvm::AddOne(), assert(), llvm::dyn_cast(), foldLogOpOfMaskedICmps(), llvm::ConstantInt::get(), llvm::IntegerType::getBitWidth(), llvm::Type::getContext(), llvm::getICmpCode(), llvm::APInt::getLowBitsSet(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), getNewICmpValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::ConstantInt::getValue(), 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::ICmpInst::isEquality(), llvm::Constant::isNullValue(), llvm::APInt::isPowerOf2(), llvm::CmpInst::isSigned(), llvm::ConstantInt::isZero(), llvm_unreachable, llvm::PatternMatch::m_And(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::CmpInst::makeCmpResultType(), llvm::PatternMatch::match(), N, llvm::PredicatesFoldable(), llvm::APInt::sgt(), llvm::SubOne(), std::swap(), llvm::ICmpInst::swapOperands(), llvm::APInt::ugt(), and llvm::APInt::zext().
| Value * InstCombiner::foldFMulConst | ( | Instruction * | FMulOrDiv, |
| Constant * | 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 557 of file InstCombineMulDivRem.cpp.
References assert(), llvm::dyn_cast(), F, llvm::ConstantExpr::getFDiv(), llvm::ConstantExpr::getFMul(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::hasOneUse(), isFMulOrFDivWithConstant(), and isNormalFp().
| Instruction * InstCombiner::FoldItoFPtoI | ( | Instruction & | FI | ) |
Definition at line 1424 of file InstCombineCasts.cpp.
References llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), and fuzzer::min().
Optimize (fcmp)|(fcmp).
NOTE: Unlike the rest of instcombine, this returns a Value which should already be inserted into the function.
Definition at line 1966 of file InstCombineAndOrXor.cpp.
References llvm::CmpInst::FCMP_UNO, getFCmpCode(), getFCmpValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), and std::swap().
| Value * InstCombiner::FoldOrOfICmps | ( | ICmpInst * | LHS, |
| ICmpInst * | RHS, | ||
| Instruction * | CxtI | ||
| ) |
Fold (icmp)|(icmp) if possible.
Definition at line 1631 of file InstCombineAndOrXor.cpp.
References A, llvm::MCID::Add, llvm::AddOne(), llvm::APIntOps::And(), assert(), B, llvm::dyn_cast(), foldLogOpOfMaskedICmps(), llvm::ConstantInt::get(), llvm::getICmpCode(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), getNewICmpValue(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::ConstantInt::getSigned(), llvm::ConstantExpr::getSub(), llvm::ConstantInt::getType(), llvm::ConstantInt::getValue(), 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::ICmpInst::isEquality(), llvm::isKnownToBeAPowerOfTwo(), llvm::APInt::isPowerOf2(), llvm::CmpInst::isSigned(), llvm::ConstantInt::isZero(), llvm_unreachable, llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::BitmaskEnumDetail::Mask(), llvm::PatternMatch::match(), llvm::PredicatesFoldable(), llvm::APInt::sgt(), llvm::SubOne(), std::swap(), llvm::ICmpInst::swapOperands(), llvm::APInt::ugt(), llvm::APInt::ule(), llvm::APInt::ult(), and llvm::APIntOps::Xor().
| Instruction * InstCombiner::FoldOrWithConstants | ( | BinaryOperator & | I, |
| Value * | Op, | ||
| Value * | A, | ||
| Value * | B, | ||
| Value * | C | ||
| ) |
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 2024 of file InstCombineAndOrXor.cpp.
References 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::FoldShiftByConstant | ( | Value * | Op0, |
| Constant * | Op1, | ||
| BinaryOperator & | I | ||
| ) |
Definition at line 493 of file InstCombineShifts.cpp.
References llvm::MCID::Add, llvm::APIntOps::And(), assert(), llvm::tgtok::Bits, CanEvaluateShifted(), llvm::BinaryOperator::Create(), CreateMul(), llvm::dbgs(), DEBUG, llvm::dyn_cast(), foldShiftByConstOfShiftByConst(), llvm::ConstantInt::get(), llvm::ConstantExpr::get(), llvm::Value::getContext(), llvm::APInt::getHighBitsSet(), llvm::ConstantInt::getLimitedValue(), llvm::APInt::getLowBitsSet(), llvm::Value::getName(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), GetShiftedValue(), llvm::ConstantExpr::getShl(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), llvm::ConstantExpr::getZExt(), llvm::ConstantInt::getZExtValue(), llvm::Value::hasOneUse(), I, llvm::Instruction::isLogicalShift(), llvm::Instruction::isShift(), isValid(), LLVM_FALLTHROUGH, llvm::APInt::lshr(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Shr(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::BitmaskEnumDetail::Mask(), llvm::PatternMatch::match(), llvm::APIntOps::Or(), llvm::Value::takeName(), llvm::ConstantInt::uge(), llvm::NVPTX::PTXLdStInstCode::V2, X, and llvm::APIntOps::Xor().
| Instruction * InstCombiner::FoldXorWithConstants | ( | BinaryOperator & | I, |
| Value * | Op, | ||
| Value * | A, | ||
| Value * | B, | ||
| Value * | C | ||
| ) |
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 2053 of file InstCombineAndOrXor.cpp.
References 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().
|
inline |
Definition at line 206 of file InstCombineInternal.h.
Referenced by simplifyValueKnownNonZero().
|
inline |
Definition at line 208 of file InstCombineInternal.h.
Referenced by canReplaceGEPIdxWithZero(), combineLoadToNewType(), combineLoadToOperationType(), foldCttzCtlz(), likeBitCastFromVector(), optimizeIntegerToVectorInsertions(), simplifyAllocaArraySize(), simplifyValueKnownNonZero(), unpackLoadToAggregate(), and unpackStoreToAggregate().
|
inline |
Definition at line 210 of file InstCombineInternal.h.
Referenced by simplifyValueKnownNonZero().
|
inline |
Definition at line 212 of file InstCombineInternal.h.
|
inline |
Definition at line 214 of file InstCombineInternal.h.
Referenced by GetShiftedValue().
|
inline |
Inserts an instruction New before instruction Old.
Also adds the new instruction to the worklist and returns New so that it is suitable for use as the return from the visitation patterns.
Definition at line 402 of file InstCombineInternal.h.
References assert(), llvm::BasicBlock::getInstList(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getParent(), and llvm::iplist_impl< IntrusiveListT, TraitsT >::insert().
Referenced by simplifyAllocaArraySize().
|
inline |
Same as InsertNewInstBefore, but also sets the debug loc.
Definition at line 412 of file InstCombineInternal.h.
References llvm::Instruction::getDebugLoc(), and llvm::Instruction::setDebugLoc().
Referenced by replaceExtractElements().
|
inline |
Definition at line 480 of file InstCombineInternal.h.
References llvm::Depth, and llvm::MaskedValueIsZero().
Referenced by canEvaluateShiftedShift().
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 1470 of file InstCombineAddSub.cpp.
References llvm::EmitGEPOffset(), and Offset.
| bool InstCombiner::replacedSelectWithOperand | ( | SelectInst * | SI, |
| const ICmpInst * | Icmp, | ||
| const unsigned | SIOpd | ||
| ) |
Try to replace select with select operand SIOpd in SI-ICmp sequence.
True when a select result is replaced by one of its operands in select-icmp sequence.
This will eventually result in the elimination of the select.
| SI | Select instruction |
| Icmp | Compare instruction |
| SIOpd | Operand that replaces the select |
Notes:
Example:
entry: %4 = select i1 %3, C* %0, C* null %5 = icmp eq C* %4, null br i1 %5, label %9, label %7 ... ; <label>:7 ; preds = entry %8 = getelementptr inbounds C* %4, i64 0, i32 0 ...
can be transformed to
%5 = icmp eq C* %0, null %6 = select i1 %3, i1 %5, i1 true br i1 %6, label %9, label %7 ... ; <label>:7 ; preds = entry %8 = getelementptr inbounds C* %0, i64 0, i32 0 // replace by %0!
Similar when the first operand of the select is a constant or/and the compare is for not equal rather than equal.
NOTE: The function is only called when the select and compare constants are equal, the optimization can work only for EQ predicates. This is not a major restriction since a NE compare should be 'normalized' to an equal compare, which usually happens in the combiner and test case select-cmp-br.ll checks for it.
Definition at line 3884 of file InstCombineCompares.cpp.
References assert(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::CmpInst::getPredicate(), llvm::TerminatorInst::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::BasicBlock::getUniquePredecessor(), llvm::CmpInst::ICMP_EQ, isChainSelectCmpBranch(), and llvm::Value::replaceUsesOutsideBlock().
|
inline |
A combiner-aware RAUW-like routine.
This method is to be used when an instruction is found to be dead, replaceable with another preexisting expression. Here we add all uses of I to the worklist, replace all uses of I with the new value, then return I, so that the inst combiner will know that I was modified.
Definition at line 423 of file InstCombineInternal.h.
References llvm::dbgs(), DEBUG, llvm::UndefValue::get(), llvm::Value::getType(), I, llvm::Value::replaceAllUsesWith(), and llvm::Value::use_empty().
Referenced by foldCttzCtlz(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), replaceExtractElements(), simplifyAllocaArraySize(), simplifyMaskedGather(), simplifyX86MaskedLoad(), unpackLoadToAggregate(), visitAllocaInst(), and visitLoadInst().
| bool InstCombiner::run | ( | ) |
Run the combiner over the entire worklist until it is empty.
Definition at line 2818 of file InstructionCombining.cpp.
References llvm::computeKnownBits(), llvm::ConstantFoldInstruction(), llvm::dbgs(), DEBUG, E, llvm::ConstantInt::get(), llvm::Instruction::getDebugLoc(), llvm::BasicBlock::getFirstInsertionPt(), llvm::PHINode::getIncomingBlock(), llvm::BasicBlock::getInstList(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), llvm::isInstructionTriviallyDead(), llvm::Type::isIntOrIntVectorTy(), llvm::User::operands(), llvm::Value::print(), llvm::Value::replaceAllUsesWith(), SI, llvm::succ_begin(), llvm::succ_end(), TryToSinkInstruction(), llvm::Value::use_begin(), llvm::Value::use_empty(), and llvm::Value::user_begin().
Referenced by combineInstructionsOverFunction().
| bool InstCombiner::SimplifyDivRemOfSelect | ( | BinaryOperator & | I | ) |
Try to fold a divide or remainder of a select instruction.
Definition at line 791 of file InstCombineMulDivRem.cpp.
References llvm::BasicBlock::begin(), E, llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Value::hasOneUse(), I, llvm::User::setOperand(), SI, llvm::ARM_MB::ST, and llvm::Value::use_empty().
Try to fold a signed range checked with lower bound 0 to an unsigned icmp.
Example: (icmp sge x, 0) & (icmp slt x, n) –> icmp ult x, n If Inverted is true then the check is for the inverted range, e.g. (icmp slt x, 0) | (icmp sgt x, n) –> icmp ugt x, n
Definition at line 740 of file InstCombineAndOrXor.cpp.
References llvm::ComputeSignBit(), llvm::dyn_cast(), llvm::CmpInst::getInversePredicate(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::getSwappedPredicate(), llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::ConstantInt::isMinusOne(), and llvm::ConstantInt::isZero().
| Instruction * InstCombiner::SliceUpIllegalIntegerPHI | ( | PHINode & | FirstPhi | ) |
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 710 of file InstCombinePHI.cpp.
References llvm::PHINode::addIncoming(), llvm::array_pod_sort(), assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::PHINode::Create(), llvm::dbgs(), DEBUG, llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::find(), 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(), i, llvm::SmallPtrSetImpl< PtrType >::insert(), Offset, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::RegState::Undef, llvm::Instruction::user_back(), and llvm::Value::users().
| Instruction * InstCombiner::visitAdd | ( | BinaryOperator & | I | ) |
Definition at line 1030 of file InstCombineAddSub.cpp.
References A, llvm::AddOne(), B, C, checkForNegativeOperand(), llvm::computeKnownBits(), llvm::computeOverflowForUnsignedAdd(), llvm::CastInst::Create(), llvm::SelectInst::Create(), CreateAdd(), llvm::BinaryOperator::CreateNeg(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantExpr::getAdd(), llvm::IntegerType::getBitWidth(), llvm::APInt::getBitWidth(), llvm::SelectInst::getCondition(), llvm::SelectInst::getFalseValue(), llvm::APInt::getHighBitsSet(), llvm::Constant::getIntegerValue(), llvm::Value::getName(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::ConstantExpr::getSExt(), llvm::SelectInst::getTrueValue(), llvm::ConstantExpr::getTrunc(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::ConstantExpr::getXor(), llvm::ConstantExpr::getZExt(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), llvm::haveNoCommonBitsSet(), I, llvm::Type::isIntegerTy(), llvm::APInt::isMinSignedValue(), llvm::APInt::isNegative(), llvm::APInt::isPowerOf2(), llvm::APInt::isSignBit(), IT(), llvm::APInt::logBase2(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_NUWAdd(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::m_ZExt(), llvm::BitmaskEnumDetail::Mask(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), N, llvm::NeverOverflows, llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::APInt::sext(), llvm::APInt::sge(), SI, llvm::SimplifyAddInst(), llvm::SubOne(), llvm::APInt::trunc(), and X.
| Instruction * InstCombiner::visitAddrSpaceCast | ( | AddrSpaceCastInst & | CI | ) |
Definition at line 2134 of file InstCombineCasts.cpp.
References llvm::VectorType::get(), llvm::PointerType::get(), llvm::PointerType::getAddressSpace(), llvm::PointerType::getElementType(), llvm::User::getOperand(), llvm::Type::getScalarType(), and llvm::Value::getType().
| Instruction * InstCombiner::visitAllocaInst | ( | AllocaInst & | AI | ) |
Definition at line 226 of file InstCombineLoadStoreAlloca.cpp.
References llvm::dbgs(), DEBUG, llvm::dyn_cast(), eraseInstFromFunction(), llvm::ConstantInt::get(), llvm::AllocaInst::getAlignment(), llvm::AllocaInst::getAllocatedType(), llvm::AllocaInst::getArraySize(), llvm::Function::getEntryBlock(), llvm::BasicBlock::getFirstNonPHIOrDbg(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(), llvm::DataLayout::getPrefTypeAlignment(), llvm::AllocaInst::getType(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), I, i, llvm::AllocaInst::isArrayAllocation(), isOnlyCopiedFromConstantGlobal(), llvm::Type::isSized(), llvm::Instruction::moveBefore(), replaceInstUsesWith(), llvm::AllocaInst::setAlignment(), llvm::User::setOperand(), simplifyAllocaArraySize(), llvm::SmallVectorTemplateCommon< T >::size(), and visitAllocSite().
| Instruction * InstCombiner::visitAllocSite | ( | Instruction & | FI | ) |
Definition at line 2020 of file InstructionCombining.cpp.
References llvm::InvokeInst::Create(), F, llvm::ConstantInt::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt1Ty(), llvm::Value::getType(), i, isAllocSiteRemovable(), llvm::lowerObjectSizeCall(), None, llvm::SmallVectorTemplateCommon< T >::size(), and Users.
Referenced by visitAllocaInst().
| Instruction * InstCombiner::visitAnd | ( | BinaryOperator & | I | ) |
Definition at line 1264 of file InstCombineAndOrXor.cpp.
References A, llvm::MCID::Add, B, llvm::APInt::countLeadingZeros(), llvm::BinaryOperator::Create(), D, llvm::dyn_cast(), foldBoolSextMaskToSelect(), llvm::ConstantExpr::getAnd(), llvm::APInt::getBitWidth(), llvm::APInt::getLowBitsSet(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::ConstantExpr::getTrunc(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::Value::hasOneUse(), I, llvm::PatternMatch::m_And(), llvm::PatternMatch::m_c_Or(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::PatternMatch::m_Zero(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), matchDeMorgansLaws(), llvm::APIntOps::Or(), llvm::MCID::Select, llvm::SimplifyAndInst(), std::swap(), X, llvm::APIntOps::Xor(), and Y.
| Instruction * InstCombiner::visitAShr | ( | BinaryOperator & | I | ) |
Definition at line 819 of file InstCombineShifts.cpp.
References llvm::APInt::getLowBitsSet(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::APInt::getSignBit(), llvm::Value::getType(), I, llvm::Instruction::isExact(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::Instruction::setIsExact(), llvm::SimplifyAShrInst(), and X.
| Instruction * InstCombiner::visitBitCast | ( | BitCastInst & | CI | ) |
Definition at line 1992 of file InstCombineCasts.cpp.
References canonicalizeBitCastExtElt(), llvm::CastInst::Create(), llvm::InsertElementInst::Create(), llvm::GetElementPtrInst::CreateInBounds(), foldBitCastBitwiseLogic(), foldBitCastSelect(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::PointerType::getElementType(), llvm::Type::getInt32Ty(), llvm::Constant::getNullValue(), llvm::Type::getNumContainedTypes(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::Type::isPointerTy(), llvm::Type::isSized(), llvm::Type::isVectorTy(), optimizeIntegerToVectorInsertions(), and optimizeVectorResize().
| Instruction * InstCombiner::visitBranchInst | ( | BranchInst & | BI | ) |
Definition at line 2179 of file InstructionCombining.cpp.
References llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_ONE, llvm::UndefValue::get(), llvm::BranchInst::getCondition(), llvm::CmpInst::getInversePredicate(), llvm::BranchInst::getSuccessor(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_ULE, llvm::BranchInst::isConditional(), llvm::PatternMatch::m_Br(), llvm::PatternMatch::m_FCmp(), llvm::PatternMatch::m_ICmp(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::BranchInst::setCondition(), llvm::CmpInst::setPredicate(), llvm::BranchInst::swapSuccessors(), X, and Y.
| Instruction * InstCombiner::visitCallInst | ( | CallInst & | CI | ) |
CallInst simplification.
This mostly only handles folding of intrinsic instructions. For normal calls, it allows visitCallSite to do the heavy lifting.
Definition at line 1389 of file InstCombineCalls.cpp.
References A, llvm::CallInst::arg_operands(), AMDGPU::RuntimeMD::KeyName::Args, assert(), B, C, llvm::computeKnownBits(), llvm::Instruction::copyFastMathFlags(), llvm::CastInst::Create(), llvm::SelectInst::Create(), llvm::CastInst::CreateIntegerCast(), llvm::APFloat::divide(), llvm::Function::doesNotThrow(), llvm::CallInst::doesNotThrow(), llvm::dyn_cast(), emitX86MaskSelect(), foldCttzCtlz(), llvm::frexp(), llvm::ConstantInt::get(), llvm::ConstantFP::get(), llvm::ConstantAggregateZero::get(), llvm::VectorType::get(), llvm::ConstantPointerNull::get(), llvm::MDNode::get(), llvm::UndefValue::get(), llvm::APInt::getAllOnesValue(), llvm::CallInst::getArgOperand(), getBitWidth(), llvm::CallInst::getCalledFunction(), llvm::CallInst::getCalledValue(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getFunction(), llvm::Type::getHalfTy(), llvm::Type::getInt32Ty(), llvm::ConstantExpr::getIntegerCast(), llvm::IntrinsicInst::getIntrinsicID(), llvm::getKnownAlignment(), llvm::APInt::getLowBitsSet(), llvm::Instruction::getModule(), llvm::ConstantExpr::getMul(), llvm::Value::getName(), getNegativeIsTrueBoolVec(), llvm::Instruction::getOpcode(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::APFloat::getSemantics(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::ConstantFP::getValueAPF(), llvm::Type::getVectorNumElements(), llvm::ConstantInt::getZExtValue(), I, i, llvm::CmpInst::ICMP_NE, llvm::APFloatBase::IEK_Inf, llvm::APFloatBase::IEK_NaN, llvm::IntrinsicIDToOverflowCheckFlavor(), llvm::APInt::isAllOnesValue(), llvm::APFloat::isDenormal(), llvm::isFreeCall(), llvm::APFloat::isInfinity(), llvm::isKnownNonNullAt(), llvm::APFloat::isNaN(), llvm::APFloat::isNegative(), llvm::APFloat::isNormal(), llvm::Type::isPointerTy(), llvm::APFloat::isSignaling(), llvm::isValidAssumeForContext(), llvm::APFloat::isZero(), LLVM_FALLTHROUGH, llvm_unreachable, llvm::SPII::Load, llvm::lowerObjectSizeCall(), llvm::APInt::lshr(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_BSwap(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_FPOne(), llvm::PatternMatch::m_ICmp(), llvm::PatternMatch::m_Instruction(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Zero(), llvm::BitmaskEnumDetail::Mask(), llvm::PatternMatch::match(), llvm::maxnum(), llvm::LLVMContext::MD_nonnull, llvm::minnum(), N, llvm::SIInstrFlags::N_INFINITY, llvm::SIInstrFlags::N_NORMAL, llvm::SIInstrFlags::N_SUBNORMAL, llvm::SIInstrFlags::N_ZERO, llvm::None, llvm::OCF_INVALID, llvm::APFloatBase::opOK, llvm::SIInstrFlags::P_INFINITY, llvm::SIInstrFlags::P_NORMAL, llvm::SIInstrFlags::P_SUBNORMAL, llvm::SIInstrFlags::P_ZERO, Ptr, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SIInstrFlags::Q_NAN, removeTriviallyEmptyRange(), llvm::AttributeSet::ReturnIndex, llvm::APFloatBase::rmNearestTiesToEven, llvm::SIInstrFlags::S_NAN, llvm::CallInst::setArgOperand(), llvm::CallInst::setCalledFunction(), llvm::CallInst::setDoesNotThrow(), llvm::Instruction::setMetadata(), llvm::SimplifyCall(), simplifyMaskedGather(), simplifyMaskedLoad(), simplifyMaskedScatter(), simplifyMaskedStore(), simplifyMinnumMaxnum(), simplifyX86extrq(), simplifyX86immShift(), simplifyX86insertps(), simplifyX86insertq(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), simplifyX86movmsk(), simplifyX86pshufb(), simplifyX86varShift(), simplifyX86vpcom(), simplifyX86vperm2(), simplifyX86vpermilvar(), simplifyX86vpermv(), std::swap(), llvm::Value::takeName(), X, and llvm::APInt::zextOrTrunc().
| Instruction * InstCombiner::visitExtractElementInst | ( | ExtractElementInst & | EI | ) |
Definition at line 146 of file InstCombineVectorOps.cpp.
References assert(), C, cheapToScalarize(), llvm::CastInst::Create(), llvm::SelectInst::Create(), llvm::ExtractElementInst::Create(), llvm::BinaryOperator::CreateWithCopiedFlags(), llvm::findScalarElement(), llvm::ConstantInt::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::ExtractElementInst::getIndexOperand(), llvm::Type::getInt32Ty(), llvm::Value::getName(), llvm::SequentialType::getNumElements(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::ExtractElementInst::getVectorOperand(), llvm::ExtractElementInst::getVectorOperandType(), llvm::Value::hasOneUse(), I, llvm::ARM_PROC::IE, Int32Ty, llvm::Type::isVectorTy(), llvm::APInt::setBit(), llvm::User::setOperand(), SI, and llvm::SimplifyExtractElementInst().
| Instruction * InstCombiner::visitExtractValueInst | ( | ExtractValueInst & | EV | ) |
Definition at line 2288 of file InstructionCombining.cpp.
References llvm::ExtractValueInst::Create(), llvm::InsertValueInst::Create(), CreateAdd(), CreateMul(), E, GEP, llvm::UndefValue::get(), llvm::ExtractValueInst::getAggregateOperand(), llvm::ExtractValueInst::getIndices(), llvm::ConstantExpr::getNot(), llvm::ExtractValueInst::hasIndices(), I, llvm::CmpInst::ICMP_UGT, llvm::ExtractValueInst::idx_begin(), llvm::ExtractValueInst::idx_end(), L, llvm::makeArrayRef(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::SimplifyExtractValueInst().
| Instruction * InstCombiner::visitFAdd | ( | BinaryOperator & | I | ) |
Definition at line 1363 of file InstCombineAddSub.cpp.
References A, B, llvm::Instruction::copyFastMathFlags(), llvm::SelectInst::Create(), llvm::dyn_cast(), llvm::Instruction::getFastMathFlags(), llvm::ConstantExpr::getFPToSI(), llvm::User::getOperand(), llvm::ConstantExpr::getSIToFP(), llvm::Value::getType(), llvm::Instruction::hasNoSignedZeros(), llvm::Instruction::hasUnsafeAlgebra(), I, llvm::Constant::isNegativeZeroValue(), llvm::PatternMatch::m_AnyZero(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and llvm::SimplifyFAddInst().
| 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 4701 of file InstCombineCompares.cpp.
References llvm::Call, llvm::APFloat::clearSign(), llvm::APFloatBase::cmpLessThan, llvm::APFloat::compare(), llvm::APFloat::convert(), llvm::dyn_cast(), F, 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::getComplexity(), llvm::Value::getContext(), llvm::Instruction::getFastMathFlags(), llvm::ConstantExpr::getFNeg(), llvm::getIntrinsicForCallSite(), llvm::Constant::getNullValue(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::CmpInst::getPredicate(), llvm::APFloat::getSmallestNormalized(), llvm::CastInst::getSrcTy(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), llvm::GlobalVariable::hasDefinitiveInitializer(), llvm::Value::hasOneUse(), I, llvm::APFloatBase::IEEEdouble(), llvm::APFloatBase::IEEEhalf(), llvm::APFloatBase::IEEEquad(), llvm::APFloatBase::IEEEsingle(), llvm::GlobalVariable::isConstant(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isFP128Ty(), llvm::Type::isHalfTy(), llvm::Constant::isNullValue(), llvm::Type::isPPC_FP128Ty(), isVolatile(), llvm::Type::isX86_FP80Ty(), llvm::APFloat::isZero(), llvm_unreachable, llvm::SPII::Load, llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::APFloatBase::PPCDoubleDouble(), llvm::APFloatBase::rmNearestTiesToEven, llvm::User::setOperand(), llvm::CmpInst::setPredicate(), SI, llvm::SimplifyFCmpInst(), llvm::FCmpInst::swapOperands(), llvm::Value::user_begin(), X, llvm::APFloatBase::x87DoubleExtended(), and Y.
| Instruction * InstCombiner::visitFDiv | ( | BinaryOperator & | I | ) |
Definition at line 1302 of file InstCombineMulDivRem.cpp.
References C, CvtFDivConstToReciprocal(), fuzzer::Flags, llvm::Instruction::getDebugLoc(), llvm::Instruction::getFastMathFlags(), llvm::ConstantExpr::getFDiv(), llvm::ConstantExpr::getFMul(), llvm::User::getOperand(), llvm::Instruction::hasAllowReciprocal(), llvm::Value::hasOneUse(), llvm::Instruction::hasUnsafeAlgebra(), I, isNormalFp(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_FDiv(), llvm::PatternMatch::m_FMul(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::Instruction::setFastMathFlags(), llvm::User::setOperand(), SI, llvm::SimplifyFDivInst(), T, X, and Y.
| Instruction * InstCombiner::visitFMul | ( | BinaryOperator & | I | ) |
Definition at line 605 of file InstCombineMulDivRem.cpp.
References C, llvm::Instruction::copyFastMathFlags(), detectLog2OfHalf(), llvm::dyn_cast(), llvm::Instruction::getFastMathFlags(), llvm::ConstantExpr::getFMul(), llvm::Value::getName(), llvm::ConstantFP::getNegativeZero(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::hasNoSignedZeros(), llvm::Value::hasOneUse(), llvm::Instruction::hasUnsafeAlgebra(), i, isFiniteNonZeroFp(), isFMulOrFDivWithConstant(), llvm::BinaryOperator::isFNeg(), isNormalFp(), llvm::Log2(), llvm::PatternMatch::m_FMul(), llvm::PatternMatch::m_SpecificFP(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::CallInst::setArgOperand(), llvm::SimplifyFMulInst(), std::swap(), llvm::Value::takeName(), and Y.
| Instruction * InstCombiner::visitFPExt | ( | CastInst & | CI | ) |
Definition at line 1416 of file InstCombineCasts.cpp.
| Instruction * InstCombiner::visitFPToSI | ( | FPToSIInst & | FI | ) |
Definition at line 1475 of file InstCombineCasts.cpp.
References llvm::dyn_cast(), llvm::User::getOperand(), and I.
| Instruction * InstCombiner::visitFPToUI | ( | FPToUIInst & | FI | ) |
Definition at line 1464 of file InstCombineCasts.cpp.
References llvm::dyn_cast(), llvm::User::getOperand(), and I.
| Instruction * InstCombiner::visitFPTrunc | ( | FPTruncInst & | CI | ) |
Definition at line 1257 of file InstCombineCasts.cpp.
References AMDGPU::RuntimeMD::KeyName::Args, llvm::Instruction::copyFastMathFlags(), llvm::BinaryOperator::Create(), llvm::CallInst::Create(), llvm::SelectInst::Create(), llvm::BinaryOperator::CreateFNeg(), llvm::CastInst::CreateFPCast(), llvm::dyn_cast(), llvm::SelectPatternResult::Flavor, llvm::CallInst::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Type::getFPMantissaWidth(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::OperandBundleUser< InstrTy, OpIteratorTy >::getOperandBundlesAsDefs(), llvm::Value::getType(), llvm::Value::hasOneUse(), I, llvm::BinaryOperator::isFNeg(), lookThroughFPExtensions(), llvm::matchSelectPattern(), SI, and llvm::SPF_UNKNOWN.
| Instruction * InstCombiner::visitFree | ( | CallInst & | FI | ) |
Definition at line 2130 of file InstructionCombining.cpp.
References llvm::UndefValue::get(), llvm::CallInst::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt1PtrTy(), llvm::ConstantInt::getTrue(), I, and tryToMoveFreeBeforeNullTest().
| Instruction * InstCombiner::visitFRem | ( | BinaryOperator & | I | ) |
Definition at line 1605 of file InstCombineMulDivRem.cpp.
References llvm::Instruction::getFastMathFlags(), llvm::User::getOperand(), I, and llvm::SimplifyFRemInst().
| Instruction * InstCombiner::visitFSub | ( | BinaryOperator & | I | ) |
Definition at line 1745 of file InstCombineAddSub.cpp.
References llvm::Instruction::copyFastMathFlags(), llvm::BinaryOperator::CreateFNeg(), llvm::Instruction::getFastMathFlags(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Instruction::hasUnsafeAlgebra(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::match(), llvm::FastMathFlags::noSignedZeros(), SI, and llvm::SimplifyFSubInst().
| 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 1379 of file InstructionCombining.cpp.
References llvm::GetElementPtrInst::accumulateConstantOffset(), llvm::PHINode::addIncoming(), llvm::SmallVectorImpl< T >::append(), assert(), C, llvm::Instruction::clone(), llvm::CastInst::Create(), llvm::GetElementPtrInst::Create(), llvm::GetElementPtrInst::CreateInBounds(), llvm::CastInst::CreatePointerBitCastOrAddrSpaceCast(), llvm::dyn_cast(), E, llvm::SmallVectorBase::empty(), F, GEP, llvm::gep_type_begin(), llvm::gep_type_end(), llvm::VectorType::get(), llvm::PointerType::getAddressSpace(), llvm::GetElementPtrInst::getAddressSpace(), llvm::Type::getArrayElementType(), llvm::PointerType::getElementType(), llvm::BasicBlock::getFirstInsertionPt(), llvm::PHINode::getIncomingBlock(), llvm::generic_gep_type_iterator< ItTy >::getIndexedType(), llvm::BasicBlock::getInstList(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::GetElementPtrInst::getNumIndices(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getPointerAddressSpace(), llvm::GetElementPtrInst::getPointerAddressSpace(), llvm::GetElementPtrInst::getPointerOperandType(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::APInt::getSExtValue(), llvm::GetElementPtrInst::getSourceElementType(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::Value::hasOneUse(), I, llvm::GetElementPtrInst::idx_begin(), llvm::GetElementPtrInst::idx_end(), llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), llvm::isAllocationFn(), llvm::Type::isArrayTy(), llvm::GetElementPtrInst::isInBounds(), llvm::APInt::isNonNegative(), llvm::Type::isSized(), llvm::generic_gep_type_iterator< ItTy >::isStruct(), llvm::Type::isStructTy(), llvm::Type::isVectorTy(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_PtrToInt(), llvm::PatternMatch::m_SDiv(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Value(), llvm::makeArrayRef(), llvm::PatternMatch::match(), Offset, llvm::User::op_begin(), llvm::User::op_end(), llvm::User::operands(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::User::setOperand(), llvm::GetElementPtrInst::setSourceElementType(), shouldMergeGEPs(), llvm::SimplifyGEPInst(), llvm::Value::stripAndAccumulateInBoundsConstantOffsets(), llvm::Value::stripPointerCasts(), llvm::Value::takeName(), llvm::APInt::ule(), and Y.
| 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 4189 of file InstCombineCompares.cpp.
References A, assert(), B, C, canonicalizeCmpWithConstant(), llvm::CmpInst::Create(), llvm::ExtractValueInst::Create(), llvm::BinaryOperator::CreateNot(), foldICmpWithMinMax(), llvm::Constant::getAllOnesValue(), llvm::ConstantExpr::getBitCast(), llvm::getComplexity(), llvm::CmpInst::getInversePredicate(), llvm::Value::getName(), llvm::ConstantExpr::getNot(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Type::getScalarType(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), llvm::GetUnderlyingObject(), llvm::Value::hasOneUse(), I, llvm::CmpInst::ICMP_EQ, 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::Type::isIntegerTy(), llvm::isKnownToBeAPowerOfTwo(), llvm::APInt::isMaxSignedValue(), llvm::APInt::isMinSignedValue(), llvm::Type::isPointerTy(), LLVM_FALLTHROUGH, llvm_unreachable, llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Instruction(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_UAddWithOverflow(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), llvm::APIntOps::Not(), llvm::OCF_UNSIGNED_ADD, processUMulZExtIdiom(), SI, llvm::SimplifyICmpInst(), std::swap(), swapMayExposeCSEOpportunities(), llvm::ICmpInst::swapOperands(), llvm::Value::user_begin(), and X.
| Instruction * InstCombiner::visitInsertElementInst | ( | InsertElementInst & | IE | ) |
Definition at line 747 of file InstCombineVectorOps.cpp.
References collectShuffleElements(), foldConstantInsEltIntoShuffle(), foldInsSequenceIntoBroadcast(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::APInt::getAllOnesValue(), llvm::SequentialType::getNumElements(), llvm::User::getOperand(), llvm::Value::getType(), llvm::InsertElementInst::getType(), llvm::Type::getVectorNumElements(), llvm::Value::hasOneUse(), llvm::ARM_PROC::IE, llvm::BitmaskEnumDetail::Mask(), and llvm::Instruction::user_back().
| Instruction * InstCombiner::visitInsertValueInst | ( | InsertValueInst & | I | ) |
Try to find redundant insertvalue instructions, like the following ones: %0 = insertvalue { i8, i32 } undef, i8 x, 0 %1 = insertvalue { i8, i32 } %0, i8 y, 0 Here the second instruction inserts values at the same indices, as the first one, making the first one redundant.
It should be transformed to: %0 = insertvalue { i8, i32 } undef, i8 y, 0
Definition at line 549 of file InstCombineVectorOps.cpp.
References llvm::Depth, llvm::dyn_cast(), llvm::InsertValueInst::getIndices(), llvm::User::getOperand(), llvm::Value::hasOneUse(), I, and llvm::Value::user_back().
|
inline |
Specify what to return for unhandled instructions.
Definition at line 304 of file InstCombineInternal.h.
| Instruction * InstCombiner::visitIntToPtr | ( | IntToPtrInst & | CI | ) |
Definition at line 1494 of file InstCombineCasts.cpp.
References llvm::VectorType::get(), llvm::IntToPtrInst::getAddressSpace(), llvm::Value::getContext(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::Type::isVectorTy(), and P.
| Instruction * InstCombiner::visitInvokeInst | ( | InvokeInst & | II | ) |
Definition at line 2809 of file InstCombineCalls.cpp.
| Instruction * InstCombiner::visitLandingPadInst | ( | LandingPadInst & | LI | ) |
Definition at line 2467 of file InstructionCombining.cpp.
References llvm::LandingPadInst::addClause(), assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::classifyEHPersonality(), llvm::LandingPadInst::Create(), llvm::dyn_cast(), llvm::SmallVectorBase::empty(), llvm::SmallVectorImpl< T >::erase(), llvm::Filter, llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::LandingPadInst::getClause(), llvm::SequentialType::getElementType(), llvm::Constant::getNullValue(), llvm::LandingPadInst::getNumClauses(), llvm::SequentialType::getNumElements(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::Function::getPersonalityFn(), llvm::Intrinsic::getType(), llvm::Value::getType(), i, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::LandingPadInst::isCatch(), isCatchAll(), llvm::LandingPadInst::isCleanup(), llvm::LandingPadInst::isFilter(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::LandingPadInst::setCleanup(), shorter_filter(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::Constant::stripPointerCasts(), and llvm::Value::stripPointerCasts().
| Instruction * InstCombiner::visitLoadInst | ( | LoadInst & | LI | ) |
Definition at line 821 of file InstCombineLoadStoreAlloca.cpp.
References llvm::InstCombineWorklist::Add(), assert(), Builder, combineLoadToOperationType(), llvm::combineMetadataForCSE(), llvm::SelectInst::Create(), llvm::IRBuilder< T, Inserter >::CreateBitOrPointerCast(), llvm::IRBuilder< T, Inserter >::CreateLoad(), llvm::DefMaxInstsToScan, llvm::FindAvailableLoadedValue(), llvm::UndefValue::get(), llvm::DataLayout::getABITypeAlignment(), llvm::LoadInst::getAlignment(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::LoadInst::getOrdering(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::LoadInst::getPointerAddressSpace(), llvm::DataLayout::getPrefTypeAlignment(), llvm::LoadInst::getSynchScope(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::isSafeToLoadUnconditionally(), llvm::LoadInst::isUnordered(), replaceGEPIdxWithZero(), replaceInstUsesWith(), llvm::LoadInst::setAlignment(), llvm::LoadInst::setAtomic(), llvm::User::setOperand(), SI, unpackLoadToAggregate(), llvm::NVPTX::PTXLdStInstCode::V2, and Worklist.
| Instruction * InstCombiner::visitLShr | ( | BinaryOperator & | I | ) |
Definition at line 775 of file InstCombineShifts.cpp.
References llvm::APInt::getLowBitsSet(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::ConstantInt::getSigned(), llvm::Value::getType(), I, llvm::Instruction::isExact(), llvm::isPowerOf2_32(), llvm::Log2_32(), llvm::MaskedValueIsZero(), llvm::Instruction::setIsExact(), and llvm::SimplifyLShrInst().
| Instruction * InstCombiner::visitMul | ( | BinaryOperator & | I | ) |
i1 mul -> i1 and.
Definition at line 175 of file InstCombineMulDivRem.cpp.
References llvm::APInt::abs(), llvm::computeOverflowForUnsignedMul(), CreateAdd(), CreateMul(), llvm::BinaryOperator::CreateNeg(), llvm::dyn_cast(), llvm::ConstantInt::get(), getLogBase2Vector(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarType(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getShl(), llvm::ConstantExpr::getTrunc(), llvm::Value::getType(), llvm::ConstantExpr::getZExt(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), I, llvm::Type::isIntegerTy(), llvm::APInt::isNegative(), llvm::Constant::isNotMinSignedValue(), llvm::APInt::isPowerOf2(), llvm::Type::isVectorTy(), llvm::APInt::logBase2(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_NSWSub(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Value(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::NeverOverflows, llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::SimplifyMulInst(), llvm::Value::takeName(), X, and Y.
| Instruction * InstCombiner::visitOr | ( | BinaryOperator & | I | ) |
Definition at line 2079 of file InstCombineAndOrXor.cpp.
References A, B, C, llvm::SelectInst::Create(), D, llvm::dyn_cast(), llvm::Value::getName(), llvm::User::getOperand(), llvm::ConstantExpr::getOr(), llvm::Type::getScalarType(), llvm::ConstantInt::getSigned(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::Value::hasOneUse(), I, llvm::Type::isIntegerTy(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_c_And(), llvm::PatternMatch::m_c_Xor(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), matchDeMorgansLaws(), matchSelectFromAndOr(), llvm::APIntOps::Not(), llvm::APIntOps::Or(), llvm::MipsISD::Ret, llvm::SimplifyOrInst(), std::swap(), llvm::Value::takeName(), llvm::NVPTX::PTXLdStInstCode::V2, X, llvm::APIntOps::Xor(), and Y.
| Instruction * InstCombiner::visitPHINode | ( | PHINode & | PN | ) |
Definition at line 882 of file InstCombinePHI.cpp.
References llvm::BasicBlock::begin(), DeadPHICycle(), llvm::dyn_cast(), llvm::UndefValue::get(), GetAnyNonZeroConstInt(), llvm::PHINode::getBasicBlockIndex(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::Value::hasOneUse(), i, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::CmpInst::isEquality(), llvm::Type::isIntegerTy(), llvm::isKnownNonZero(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::match(), PHIsEqualValue(), llvm::PHINode::setIncomingBlock(), llvm::PHINode::setIncomingValue(), llvm::SimplifyInstruction(), llvm::Instruction::user_back(), and llvm::codeview::VB.
| Instruction * InstCombiner::visitPtrToInt | ( | PtrToIntInst & | CI | ) |
Definition at line 1540 of file InstCombineCasts.cpp.
References llvm::CastInst::CreateIntegerCast(), llvm::VectorType::get(), llvm::Value::getContext(), llvm::User::getOperand(), llvm::PtrToIntInst::getPointerAddressSpace(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::Type::isVectorTy(), and P.
| Instruction * InstCombiner::visitReturnInst | ( | ReturnInst & | RI | ) |
Definition at line 2159 of file InstructionCombining.cpp.
References llvm::computeKnownBits(), llvm::Constant::getIntegerValue(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isIntegerTy(), and llvm::User::setOperand().
| Instruction * InstCombiner::visitSDiv | ( | BinaryOperator & | I | ) |
Definition at line 1188 of file InstCombineMulDivRem.cpp.
References llvm::BinaryOperator::CreateNeg(), llvm::APInt::exactLogBase2(), llvm::ConstantInt::get(), llvm::APInt::getMinSignedBits(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), llvm::User::getOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::APInt::getSignBit(), llvm::ConstantExpr::getTrunc(), llvm::Value::getType(), llvm::APInt::isAllOnesValue(), llvm::Instruction::isExact(), llvm::Type::isIntegerTy(), llvm::isKnownToBeAPowerOfTwo(), llvm::APInt::isNonNegative(), llvm::APInt::isPowerOf2(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_NSWSub(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Zero(), llvm::BitmaskEnumDetail::Mask(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::SimplifySDivInst(), and X.
| Instruction* llvm::InstCombiner::visitSelectInst | ( | SelectInst & | SI | ) |
| Instruction * InstCombiner::visitSExt | ( | SExtInst & | CI | ) |
Definition at line 1118 of file InstCombineCasts.cpp.
References A, assert(), canEvaluateSExtd(), llvm::ComputeNumSignBits(), llvm::ComputeSignBit(), llvm::dbgs(), DEBUG, llvm::ConstantInt::get(), llvm::Value::getName(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::Type::isVectorTy(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), and llvm::Instruction::user_back().
| Instruction * InstCombiner::visitShl | ( | BinaryOperator & | I | ) |
Definition at line 714 of file InstCombineShifts.cpp.
References A, llvm::ComputeNumSignBits(), llvm::APInt::getHighBitsSet(), llvm::User::getOperand(), llvm::ConstantExpr::getShl(), llvm::Value::getType(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), I, llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), and llvm::SimplifyShlInst().
| Instruction * InstCombiner::visitShuffleVectorInst | ( | ShuffleVectorInst & | SVI | ) |
Definition at line 1104 of file InstCombineVectorOps.cpp.
References assert(), CanEvaluateShuffled(), llvm::dyn_cast(), E, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::MipsISD::Ext, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::SmallVectorTemplateCommon< T >::front(), llvm::ConstantInt::get(), llvm::VectorType::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::APInt::getAllOnesValue(), llvm::VectorType::getBitWidth(), llvm::Value::getContext(), llvm::SequentialType::getElementType(), llvm::Type::getInt32Ty(), llvm::Value::getName(), llvm::SequentialType::getNumElements(), llvm::User::getOperand(), llvm::ShuffleVectorInst::getShuffleMask(), llvm::Value::getType(), llvm::ShuffleVectorInst::getType(), llvm::Type::getVectorNumElements(), I, i, Int32Ty, isShuffleExtractingFromLHS(), isSplat(), llvm::VectorType::isValidElementType(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), recognizeIdentityMask(), llvm::User::setOperand(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::Value::users().
| Instruction * InstCombiner::visitSIToFP | ( | CastInst & | CI | ) |
Definition at line 1490 of file InstCombineCasts.cpp.
| Instruction * InstCombiner::visitSRem | ( | BinaryOperator & | I | ) |
Definition at line 1530 of file InstCombineMulDivRem.cpp.
References C, llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::Constant::getAggregateElement(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), llvm::User::getOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::APInt::getSignBit(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), I, i, llvm::Type::isIntegerTy(), llvm::APInt::isMinSignedValue(), llvm::APInt::isNegative(), llvm::PatternMatch::m_APInt(), llvm::BitmaskEnumDetail::Mask(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::User::setOperand(), llvm::SimplifySRemInst(), and Y.
| Instruction * InstCombiner::visitStoreInst | ( | StoreInst & | SI | ) |
Definition at line 1183 of file InstCombineLoadStoreAlloca.cpp.
References llvm::InstCombineWorklist::Add(), assert(), llvm::BasicBlock::begin(), combineStoreToValueType(), equivalentAddressValues(), eraseInstFromFunction(), GEP, llvm::UndefValue::get(), llvm::DataLayout::getABITypeAlignment(), llvm::StoreInst::getAlignment(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::User::getOperand(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::StoreInst::getPointerAddressSpace(), llvm::DataLayout::getPrefTypeAlignment(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::StoreInst::isUnordered(), Ptr, replaceGEPIdxWithZero(), llvm::StoreInst::setAlignment(), llvm::User::setOperand(), unpackStoreToAggregate(), and Worklist.
| Instruction * InstCombiner::visitSub | ( | BinaryOperator & | I | ) |
Definition at line 1534 of file InstCombineAddSub.cpp.
References A, llvm::MCID::Add, llvm::AddOne(), assert(), B, llvm::computeKnownBits(), CreateAdd(), llvm::BinaryOperator::CreateNeg(), llvm::BinaryOperator::CreateNot(), llvm::CastInst::CreateSExtOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), llvm::ConstantExpr::getNeg(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::ConstantExpr::getSub(), llvm::Value::getType(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), llvm::Type::isIntegerTy(), llvm::Constant::isNotMinSignedValue(), llvm::Constant::isOneValue(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_PtrToInt(), llvm::PatternMatch::m_SDiv(), llvm::PatternMatch::m_SExt(), 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(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), SI, llvm::SimplifySubInst(), X, and Y.
| Instruction * InstCombiner::visitSwitchInst | ( | SwitchInst & | SI | ) |
Definition at line 2236 of file InstructionCombining.cpp.
References assert(), llvm::SwitchInst::cases(), llvm::computeKnownBits(), llvm::APInt::countLeadingOnes(), llvm::IntegerType::get(), llvm::ConstantInt::get(), getBitWidth(), llvm::SwitchInst::getCondition(), llvm::Value::getContext(), llvm::ConstantExpr::getSub(), llvm::Value::getType(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), fuzzer::min(), llvm::SwitchInst::setCondition(), SI, and llvm::APInt::trunc().
| Instruction * InstCombiner::visitTrunc | ( | TruncInst & | CI | ) |
Definition at line 466 of file InstCombineCasts.cpp.
References A, assert(), canEvaluateTruncated(), llvm::BinaryOperator::Create(), llvm::CastInst::CreateIntegerCast(), llvm::dbgs(), DEBUG, llvm::SelectPatternResult::Flavor, foldVecTruncToExtElt(), llvm::ConstantInt::get(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::ConstantInt::getZExtValue(), llvm::Value::hasOneUse(), I, llvm::CmpInst::ICMP_NE, llvm::Type::isVectorTy(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Shr(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), llvm::matchSelectPattern(), SI, llvm::SPF_UNKNOWN, llvm::Value::takeName(), llvm::APInt::trunc(), llvm::APInt::ult(), and Zero.
| Instruction * InstCombiner::visitUDiv | ( | BinaryOperator & | I | ) |
Definition at line 1115 of file InstCombineMulDivRem.cpp.
References llvm::SelectInst::Create(), dyn_castZExtVal(), llvm::ConstantInt::get(), llvm::User::getOperand(), llvm::Value::getType(), i, llvm::Instruction::insertBefore(), llvm::Instruction::isExact(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_Exact(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::Instruction::setIsExact(), llvm::SimplifyUDivInst(), llvm::APInt::ushl_ov(), visitUDivOperand(), and X.
| Instruction * InstCombiner::visitUIToFP | ( | CastInst & | CI | ) |
Definition at line 1486 of file InstCombineCasts.cpp.
| Instruction * InstCombiner::visitURem | ( | BinaryOperator & | I | ) |
Definition at line 1487 of file InstCombineMulDivRem.cpp.
References llvm::MCID::Add, llvm::SelectInst::Create(), dyn_castZExtVal(), llvm::MipsISD::Ext, llvm::Constant::getAllOnesValue(), llvm::User::getOperand(), llvm::Value::getType(), llvm::isKnownToBeAPowerOfTwo(), llvm::APInt::isNegative(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_One(), llvm::PatternMatch::match(), and llvm::SimplifyURemInst().
| Instruction * InstCombiner::visitVACopyInst | ( | VACopyInst & | I | ) |
Definition at line 1381 of file InstCombineCalls.cpp.
References removeTriviallyEmptyRange().
| Instruction * InstCombiner::visitVAStartInst | ( | VAStartInst & | I | ) |
Definition at line 1376 of file InstCombineCalls.cpp.
References removeTriviallyEmptyRange().
| Instruction * InstCombiner::visitXor | ( | BinaryOperator & | I | ) |
Definition at line 2433 of file InstCombineAndOrXor.cpp.
References A, llvm::MCID::Add, llvm::APIntOps::And(), B, C, llvm::CastInst::Create(), llvm::CmpInst::Create(), CreateAdd(), llvm::BinaryOperator::CreateNot(), D, llvm::dyn_cast(), dyn_castNotVal(), llvm::ConstantInt::get(), llvm::ConstantExpr::getAnd(), llvm::ConstantExpr::getCast(), llvm::Instruction::getDebugLoc(), llvm::getICmpCode(), llvm::ConstantExpr::getNeg(), getNewICmpValue(), llvm::ConstantExpr::getNot(), llvm::BinaryOperator::getOpcode(), llvm::CastInst::getOpcode(), llvm::CmpInst::getOpcode(), llvm::User::getOperand(), llvm::ConstantExpr::getOr(), llvm::ConstantExpr::getSub(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::Value::hasOneUse(), I, llvm::IsFreeToInvert(), llvm::APInt::lshr(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_c_And(), llvm::PatternMatch::m_c_Or(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::APIntOps::Or(), llvm::PredicatesFoldable(), llvm::User::setOperand(), llvm::SimplifyXorInst(), std::swap(), llvm::BinaryOperator::swapOperands(), llvm::Value::takeName(), and llvm::APIntOps::Xor().
| Instruction * InstCombiner::visitZExt | ( | ZExtInst & | CI | ) |
Definition at line 831 of file InstCombineCasts.cpp.
References A, llvm::APIntOps::And(), assert(), C, canEvaluateZExtd(), llvm::BinaryOperator::Create(), llvm::dbgs(), DEBUG, llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::APInt::getHighBitsSet(), llvm::APInt::getLowBitsSet(), llvm::Value::getName(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::ConstantExpr::getZExt(), llvm::Value::hasOneUse(), llvm::Type::isVectorTy(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::APIntOps::Or(), llvm::Instruction::user_back(), and X.
| BuilderTy* llvm::InstCombiner::Builder |
Definition at line 170 of file InstCombineInternal.h.
Referenced by canonicalizeBitCastExtElt(), combineLoadToNewType(), combineLoadToOperationType(), combineStoreToNewValue(), evaluateGEPOffsetExpression(), foldCttzCtlz(), foldOperationIntoSelectOperand(), foldUDivNegCst(), foldUDivShl(), foldVecTruncToExtElt(), GetShiftedValue(), optimizeIntegerToVectorInsertions(), optimizeVectorResize(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), simplifyAllocaArraySize(), simplifyValueKnownNonZero(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), unpackLoadToAggregate(), unpackStoreToAggregate(), and visitLoadInst().
| InstCombineWorklist& llvm::InstCombiner::Worklist |
A worklist of the instructions that need to be simplified.
Definition at line 165 of file InstCombineInternal.h.
Referenced by GetShiftedValue(), processUMulZExtIdiom(), visitLoadInst(), and visitStoreInst().
1.8.6