LLVM
8.0.1
|
The core instruction combiner logic. More...
#include "Transforms/InstCombine/InstCombineInternal.h"
Public Types | |
using | BuilderTy = IRBuilder< TargetFolder, IRBuilderCallbackInserter > |
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 |
uint64_t | MaxArraySizeForCombine |
Maximum size of array considered when transforming. More... | |
The core instruction combiner logic.
This class provides both the logic to recursively visit instructions and combine them.
Definition at line 281 of file InstCombineInternal.h.
An IRBuilder that automatically inserts new instructions into the worklist.
Definition at line 290 of file InstCombineInternal.h.
|
inline |
Definition at line 317 of file InstCombineInternal.h.
Instruction * InstCombiner::commonCastTransforms | ( | CastInst & | CI | ) |
Implement the transforms common to all CastInst visitors.
Definition at line 261 of file InstCombineCasts.cpp.
References llvm::CastInst::Create(), llvm::dyn_cast(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::isIntegerTy(), and llvm::replaceAllDbgUsesWith().
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 592 of file InstCombineMulDivRem.cpp.
References assert(), 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::isIntOrIntVectorTy(), isMultiple(), llvm::APInt::isNullValue(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_c_Mul(), llvm::PatternMatch::m_NSWMul(), llvm::PatternMatch::m_NSWShl(), llvm::PatternMatch::m_NUWMul(), llvm::PatternMatch::m_NUWShl(), llvm::PatternMatch::m_One(), 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::setIsExact(), llvm::User::setOperand(), simplifyValueKnownNonZero(), X, and Y.
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 1198 of file InstCombineMulDivRem.cpp.
References llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), I, llvm::APInt::isMinSignedValue(), llvm::APInt::isMinValue(), 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 1774 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 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 673 of file InstCombineInternal.h.
References llvm::computeKnownBits().
Referenced by canReplaceGEPIdxWithZero(), foldCtpop(), and foldCttzCtlz().
|
inline |
Definition at line 678 of file InstCombineInternal.h.
References llvm::computeKnownBits().
|
inline |
Definition at line 694 of file InstCombineInternal.h.
References llvm::ComputeNumSignBits(), and llvm::Depth.
Referenced by processUGT_ADDCST_ADD().
|
inline |
Definition at line 717 of file InstCombineInternal.h.
References llvm::computeOverflowForSignedAdd().
|
inline |
Definition at line 705 of file InstCombineInternal.h.
References llvm::computeOverflowForSignedMul().
|
inline |
Definition at line 729 of file InstCombineInternal.h.
References llvm::computeOverflowForSignedSub().
|
inline |
Definition at line 711 of file InstCombineInternal.h.
References llvm::computeOverflowForUnsignedAdd().
|
inline |
Definition at line 699 of file InstCombineInternal.h.
References llvm::computeOverflowForUnsignedMul().
|
inline |
Definition at line 723 of file InstCombineInternal.h.
References llvm::computeOverflowForUnsignedSub().
|
inline |
Creates a result tuple for an overflow intrinsic II
with a given Result
and a constant Overflow
value.
Definition at line 642 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 4225 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 655 of file InstCombineInternal.h.
References llvm::InstCombineWorklist::Add(), assert(), llvm::dbgs(), llvm::Instruction::eraseFromParent(), llvm::User::getNumOperands(), LLVM_DEBUG, llvm::User::operands(), llvm::InstCombineWorklist::Remove(), llvm::salvageDebugInfo(), and llvm::Value::use_empty().
Referenced by combineLoadToOperationType(), removeBitcastsFromLoadStoreOnMinMax(), removeTriviallyEmptyRange(), simplifyMaskedScatter(), simplifyMaskedStore(), and simplifyX86MaskedStore().
Instruction * InstCombiner::FoldItoFPtoI | ( | Instruction & | FI | ) |
Definition at line 1682 of file InstCombineCasts.cpp.
References llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), and llvm::Value::getType().
Instruction * InstCombiner::FoldShiftByConstant | ( | Value * | Op0, |
Constant * | Op1, | ||
BinaryOperator & | I | ||
) |
Definition at line 347 of file InstCombineShifts.cpp.
References llvm::MCID::Add, assert(), llvm::tgtok::Bits, C, canEvaluateShifted(), canShiftBinOpWithConstantRHS(), llvm::BinaryOperator::Create(), llvm::SelectInst::Create(), llvm::dbgs(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantExpr::get(), llvm::Value::getContext(), llvm::APInt::getHighBitsSet(), llvm::APInt::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::APInt::getZExtValue(), llvm::Value::hasOneUse(), I, llvm::Instruction::isLogicalShift(), llvm::Instruction::isShift(), LLVM_DEBUG, LLVM_FALLTHROUGH, llvm::APInt::lshrInPlace(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_BinOp(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_Shr(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::BitmaskEnumDetail::Mask(), llvm::PatternMatch::match(), llvm::Value::takeName(), llvm::APInt::uge(), llvm::NVPTX::PTXLdStInstCode::V2, and X.
|
inline |
Definition at line 331 of file InstCombineInternal.h.
Referenced by foldCttzCtlz().
|
inline |
Definition at line 333 of file InstCombineInternal.h.
Referenced by canReplaceGEPIdxWithZero(), combineLoadToNewType(), combineLoadToOperationType(), foldCttzCtlz(), foldVecTruncToExtElt(), likeBitCastFromVector(), optimizeIntegerToVectorInsertions(), simplifyAllocaArraySize(), unpackLoadToAggregate(), and unpackStoreToAggregate().
|
inline |
Definition at line 335 of file InstCombineInternal.h.
Referenced by foldCttzCtlz().
|
inline |
Definition at line 337 of file InstCombineInternal.h.
|
inline |
Definition at line 339 of file InstCombineInternal.h.
References GEP, I, llvm::ARM_PROC::IE, and SI.
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 600 of file InstCombineInternal.h.
References llvm::InstCombineWorklist::Add(), 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 610 of file InstCombineInternal.h.
References llvm::Instruction::getDebugLoc(), and llvm::Instruction::setDebugLoc().
Referenced by replaceExtractElements().
|
inline |
Definition at line 683 of file InstCombineInternal.h.
References llvm::Depth, and llvm::isKnownToBeAPowerOfTwo().
Referenced by simplifyValueKnownNonZero().
|
inline |
Definition at line 689 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 1369 of file InstCombineAddSub.cpp.
References llvm::GEPOperator::countNonConstantIndices(), llvm::EmitGEPOffset(), and llvm::Value::hasOneUse().
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 4300 of file InstCombineCompares.cpp.
References assert(), llvm::APInt::ceilLogBase2(), computeSignedMinMaxValuesFromKnownBits(), computeUnsignedMinMaxValuesFromKnownBits(), llvm::KnownBits::countMinTrailingZeros(), llvm::APInt::countTrailingZeros(), llvm::ConstantInt::get(), llvm::APInt::getActiveBits(), llvm::APInt::getAllOnesValue(), getDemandedBitsLHSMask(), llvm::ConstantInt::getFalse(), llvm::Constant::getIntegerValue(), llvm::CmpInst::getInversePredicate(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::CmpInst::getPredicate(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::BasicBlock::getSinglePredecessor(), llvm::Instruction::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::ConstantInt::getTrue(), llvm::Value::getType(), llvm::ICmpInst::getUnsignedPredicate(), 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, isChainSelectCmpBranch(), llvm::Type::isIntOrIntVectorTy(), llvm::APInt::isNegative(), llvm::APInt::isOneValue(), llvm::APInt::isPowerOf2(), llvm::CmpInst::isSigned(), llvm::KnownBits::isZero(), llvm_unreachable, llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_Power2(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::KnownBits::One, llvm::Value::replaceUsesOutsideBlock(), llvm::APInt::sle(), llvm::APInt::slt(), llvm::APInt::ule(), llvm::APInt::ult(), X, and llvm::KnownBits::Zero.
|
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 621 of file InstCombineInternal.h.
References llvm::InstCombineWorklist::AddUsersToWorkList(), llvm::dbgs(), llvm::UndefValue::get(), llvm::Value::getType(), I, LLVM_DEBUG, llvm::Value::replaceAllUsesWith(), and llvm::Value::use_empty().
Referenced by foldCttzCtlz(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), removeBitcastsFromLoadStoreOnMinMax(), replaceExtractElements(), simplifyAllocaArraySize(), simplifyMaskedGather(), simplifyX86MaskedLoad(), and unpackLoadToAggregate().
bool llvm::InstCombiner::replacePointer | ( | Instruction & | I, |
Value * | V | ||
) |
Try to replace instruction I
with value V
which are pointers in different address space.
bool InstCombiner::run | ( | ) |
Run the combiner over the entire worklist until it is empty.
Definition at line 3111 of file InstructionCombining.cpp.
References llvm::computeKnownBits(), llvm::ConstantFoldInstruction(), llvm::dbgs(), E, EnableCodeSinking, llvm::ConstantInt::get(), llvm::KnownBits::getConstant(), 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::Value::getType(), llvm::Value::hasOneUse(), llvm::iplist_impl< IntrusiveListT, TraitsT >::insert(), llvm::KnownBits::isConstant(), llvm::isInstructionTriviallyDead(), llvm::Type::isIntOrIntVectorTy(), LLVM_DEBUG, llvm::User::operands(), llvm::Value::print(), llvm::Value::replaceAllUsesWith(), llvm::DebugCounter::shouldExecute(), SI, llvm::succ_begin(), llvm::succ_end(), TryToSinkInstruction(), llvm::Value::use_begin(), llvm::Value::use_empty(), and llvm::Value::user_begin().
bool InstCombiner::simplifyDivRemOfSelectWithZeroOp | ( | BinaryOperator & | I | ) |
Fold a divide or remainder with a select instruction divisor when one of the select operands is zero.
In that case, we can use the other select operand because div/rem by zero is undefined.
Definition at line 491 of file InstCombineMulDivRem.cpp.
References llvm::BasicBlock::begin(), llvm::dyn_cast(), E, llvm::SelectInst::getCondition(), llvm::ConstantInt::getFalse(), llvm::SelectInst::getFalseValue(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::ConstantInt::getTrue(), llvm::SelectInst::getTrueValue(), llvm::Value::getType(), llvm::Value::hasOneUse(), I, llvm::isGuaranteedToTransferExecutionToSuccessor(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::match(), llvm::User::setOperand(), SI, 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 755 of file InstCombineAndOrXor.cpp.
References llvm::computeKnownBits(), 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(), llvm::KnownBits::isNonNegative(), 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 951 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(), 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(), llvm::SmallPtrSetImpl< PtrType >::insert(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorBase::size(), llvm::RegState::Undef, llvm::Instruction::user_back(), and llvm::Value::users().
Instruction * InstCombiner::visitAdd | ( | BinaryOperator & | I | ) |
Definition at line 1035 of file InstCombineAddSub.cpp.
References B, canonicalizeLowbitMask(), checkForNegativeOperand(), llvm::computeKnownBits(), llvm::SelectInst::Create(), CreateAdd(), llvm::BinaryOperator::CreateNeg(), llvm::dyn_cast(), llvm::MipsISD::Ext, llvm::ConstantInt::get(), llvm::ConstantExpr::getAdd(), llvm::SelectInst::getCondition(), llvm::SelectInst::getFalseValue(), llvm::APInt::getHighBitsSet(), llvm::Value::getName(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::SelectInst::getTrueValue(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::ConstantExpr::getXor(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), llvm::haveNoCommonBitsSet(), I, llvm::Type::isIntOrIntVectorTy(), llvm::APInt::isPowerOf2(), llvm::APInt::isSignMask(), llvm::APInt::logBase2(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_c_And(), llvm::PatternMatch::m_c_BinOp(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Deferred(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_One(), 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::BitmaskEnumDetail::Mask(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), N, llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::User::setOperand(), SI, llvm::SimplifyAddInst(), X, and llvm::KnownBits::Zero.
Instruction * InstCombiner::visitAddrSpaceCast | ( | AddrSpaceCastInst & | CI | ) |
Definition at line 2409 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 342 of file InstCombineLoadStoreAlloca.cpp.
References llvm::dbgs(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::PointerType::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::AllocaInst::getType(), llvm::Value::getType(), I, llvm::AllocaInst::isArrayAllocation(), isDereferenceableForAllocaSize(), isOnlyCopiedFromConstantGlobal(), llvm::Type::isSized(), LLVM_DEBUG, llvm::max(), llvm::Instruction::moveBefore(), llvm::AllocaInst::setAlignment(), llvm::User::setOperand(), simplifyAllocaArraySize(), and llvm::SmallVectorBase::size().
Instruction * InstCombiner::visitAllocSite | ( | Instruction & | FI | ) |
Definition at line 2267 of file InstructionCombining.cpp.
References llvm::ConvertDebugDeclareToDebugValue(), llvm::InvokeInst::Create(), llvm::Intrinsic::donothing, F(), llvm::FindDbgAddrUses(), llvm::ConstantInt::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt1Ty(), llvm::Instruction::getModule(), llvm::Value::getType(), isAllocSiteRemovable(), llvm::lowerObjectSizeCall(), llvm::None, llvm::Intrinsic::objectsize, llvm::SmallVectorBase::size(), and Users.
Instruction * InstCombiner::visitAnd | ( | BinaryOperator & | I | ) |
Definition at line 1530 of file InstCombineAndOrXor.cpp.
References llvm::MCID::Add, assert(), B, C, llvm::BinaryOperator::Create(), llvm::SelectInst::Create(), llvm::dyn_cast(), llvm::MipsISD::Ext, foldAndToXor(), llvm::ConstantInt::get(), llvm::ConstantExpr::getAnd(), llvm::Value::getName(), llvm::Constant::getNullValue(), getOpcode(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::ConstantExpr::getTrunc(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::Value::hasOneUse(), I, llvm::IsFreeToInvert(), llvm::APInt::isIntN(), llvm::Type::isIntOrIntVectorTy(), llvm::APInt::isOneValue(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_c_BinOp(), llvm::PatternMatch::m_c_Or(), llvm::PatternMatch::m_c_Xor(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_LogicalShift(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::PatternMatch::m_ZExt(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), matchDeMorgansLaws(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::recognizeBSwapOrBitReverseIdiom(), llvm::Instruction::removeFromParent(), llvm::SimplifyAndInst(), SimplifyBSwap(), llvm::Value::takeName(), X, and Y.
Instruction * InstCombiner::visitAShr | ( | BinaryOperator & | I | ) |
Definition at line 824 of file InstCombineShifts.cpp.
References llvm::BinaryOperator::Create(), llvm::ConstantInt::get(), llvm::APInt::getLowBitsSet(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::APInt::getSignMask(), llvm::Value::getType(), llvm::APInt::getZExtValue(), I, llvm::Instruction::isExact(), llvm::Type::isVectorTy(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_NSWShl(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::Instruction::setIsExact(), llvm::SimplifyAShrInst(), llvm::APInt::ult(), and X.
Instruction * InstCombiner::visitBitCast | ( | BitCastInst & | CI | ) |
Definition at line 2261 of file InstCombineCasts.cpp.
References canonicalizeBitCastExtElt(), llvm::CastInst::Create(), llvm::InsertElementInst::Create(), llvm::GetElementPtrInst::CreateInBounds(), foldBitCastBitwiseLogic(), foldBitCastSelect(), llvm::UndefValue::get(), llvm::PointerType::getAddressSpace(), 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(), I, llvm::Type::isPointerTy(), llvm::Type::isSized(), llvm::Type::isVectorTy(), optimizeIntegerToVectorInsertions(), and optimizeVectorResize().
Instruction * InstCombiner::visitBranchInst | ( | BranchInst & | BI | ) |
Definition at line 2472 of file InstructionCombining.cpp.
References llvm::BranchInst::getCondition(), llvm::ConstantInt::getFalse(), llvm::CmpInst::getInversePredicate(), llvm::BranchInst::getSuccessor(), llvm::Value::getType(), llvm::isCanonicalPredicate(), llvm::BranchInst::isConditional(), llvm::PatternMatch::m_Br(), llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::BranchInst::setCondition(), llvm::CmpInst::setPredicate(), llvm::BranchInst::swapSuccessors(), and X.
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 1833 of file InstCombineCalls.cpp.
References llvm::Intrinsic::aarch64_crypto_aesd, llvm::Intrinsic::aarch64_crypto_aese, llvm::Intrinsic::aarch64_neon_smull, llvm::Intrinsic::aarch64_neon_tbl1, llvm::Intrinsic::aarch64_neon_umull, llvm::MCID::Add, llvm::CallBase::addAttribute(), llvm::AlwaysOverflows, llvm::Intrinsic::amdgcn_class, llvm::Intrinsic::amdgcn_cos, llvm::Intrinsic::amdgcn_cvt_pk_i16, llvm::Intrinsic::amdgcn_cvt_pk_u16, llvm::Intrinsic::amdgcn_cvt_pknorm_i16, llvm::Intrinsic::amdgcn_cvt_pknorm_u16, llvm::Intrinsic::amdgcn_cvt_pkrtz, llvm::Intrinsic::amdgcn_exp, llvm::Intrinsic::amdgcn_exp_compr, llvm::Intrinsic::amdgcn_fcmp, llvm::Intrinsic::amdgcn_fmed3, llvm::Intrinsic::amdgcn_frexp_exp, llvm::Intrinsic::amdgcn_frexp_mant, llvm::Intrinsic::amdgcn_icmp, llvm::Intrinsic::amdgcn_kill, llvm::Intrinsic::amdgcn_rcp, llvm::Intrinsic::amdgcn_rsq, llvm::Intrinsic::amdgcn_sbfe, llvm::Intrinsic::amdgcn_ubfe, llvm::Intrinsic::amdgcn_update_dpp, llvm::Intrinsic::amdgcn_wqm_vote, Arg, llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::Intrinsic::arm_neon_aesd, llvm::Intrinsic::arm_neon_aese, 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::arm_neon_vtbl1, assert(), llvm::Intrinsic::assume, B, llvm::Intrinsic::bswap, C, canonicalizeConstantArg0ToArg1(), llvm::Intrinsic::ceil, llvm::computeKnownBits(), llvm::computeOverflowForUnsignedAdd(), llvm::computeOverflowForUnsignedSub(), llvm::Attribute::Convergent, llvm::APFloat::convert(), llvm::Instruction::copyFastMathFlags(), llvm::Instruction::copyIRFlags(), llvm::Intrinsic::cos, llvm::CastInst::Create(), llvm::SelectInst::Create(), llvm::BinaryOperator::CreateFNeg(), llvm::CastInst::CreateIntegerCast(), llvm::Intrinsic::ctlz, llvm::Intrinsic::ctpop, llvm::Intrinsic::cttz, llvm::Data, llvm::APFloat::divide(), llvm::Function::doesNotThrow(), llvm::CallBase::doesNotThrow(), llvm::dyn_cast(), llvm::Intrinsic::experimental_gc_relocate, llvm::Intrinsic::experimental_guard, llvm::Intrinsic::fabs, llvm::CmpInst::FIRST_FCMP_PREDICATE, llvm::CmpInst::FIRST_ICMP_PREDICATE, llvm::Intrinsic::floor, llvm::Intrinsic::fma, fmed3AMDGCN(), llvm::Intrinsic::fmuladd, foldCtpop(), foldCttzCtlz(), llvm::frexp(), llvm::Intrinsic::fshl, llvm::Intrinsic::fshr, llvm::AttributeList::FunctionIndex, llvm::ConstantInt::get(), llvm::MetadataAsValue::get(), llvm::ConstantFP::get(), llvm::ConstantAggregateZero::get(), llvm::VectorType::get(), llvm::ConstantVector::get(), llvm::ConstantPointerNull::get(), llvm::MDString::get(), llvm::MDNode::get(), llvm::UndefValue::get(), llvm::Constant::getAllOnesValue(), llvm::APInt::getAllOnesValue(), llvm::CallBase::getArgOperand(), getBitWidth(), llvm::APInt::getBitWidth(), llvm::CallBase::getCalledFunction(), llvm::ConstantExpr::getCompare(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getFastMathFlags(), llvm::Instruction::getFunction(), llvm::Type::getHalfTy(), llvm::Type::getInt32Ty(), llvm::Type::getIntegerBitWidth(), llvm::ConstantExpr::getIntegerCast(), llvm::Type::getIntNTy(), llvm::IntrinsicInst::getIntrinsicID(), llvm::CmpInst::getInversePredicate(), llvm::getKnownAlignment(), llvm::MemIntrinsicBase< Derived >::getLength(), llvm::APInt::getLowBitsSet(), llvm::Instruction::getModule(), llvm::ConstantExpr::getMul(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), getNegativeIsTrueBoolVec(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::Instruction::getNextNonDebugInstruction(), llvm::Constant::getNullValue(), llvm::Instruction::getOpcode(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::APFloat::getSemantics(), llvm::ConstantExpr::getSExt(), llvm::APInt::getSplat(), llvm::CmpInst::getSwappedPredicate(), llvm::BasicBlock::getTerminator(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::PointerType::getUnqual(), llvm::ConstantFP::getValueAPF(), llvm::Type::getVectorNumElements(), llvm::ConstantInt::getZExtValue(), GuardWideningWindow, llvm::Value::hasOneUse(), I, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::APFloatBase::IEK_Inf, llvm::APFloatBase::IEK_NaN, llvm::IntrinsicIDToOverflowCheckFlavor(), llvm::KnownBits::isAllOnes(), llvm::APFloat::isDenormal(), llvm::Type::isDoubleTy(), llvm::Instruction::isFast(), llvm::Type::isFloatTy(), llvm::CmpInst::isFPPredicate(), llvm::isFreeCall(), llvm::Type::isHalfTy(), llvm::APFloat::isInfinity(), llvm::Type::isIntegerTy(), llvm::isKnownNeverNaN(), llvm::isKnownNonZero(), llvm::APFloat::isNaN(), llvm::APFloat::isNegative(), llvm::APInt::isNonNegative(), llvm::APFloat::isNormal(), llvm::Constant::isNotMinSignedValue(), llvm::Constant::isNullValue(), llvm::Type::isPointerTy(), llvm::isPowerOf2_32(), llvm::isSafeToSpeculativelyExecute(), llvm::APFloat::isSignaling(), llvm::CmpInst::isSigned(), llvm::APInt::isSubsetOf(), llvm::isValidAssumeForContext(), llvm::Type::isVectorTy(), llvm::APFloat::isZero(), llvm::CmpInst::LAST_FCMP_PREDICATE, llvm::CmpInst::LAST_ICMP_PREDICATE, llvm::Intrinsic::launder_invariant_group, llvm::Intrinsic::lifetime_end, llvm::Intrinsic::lifetime_start, LLVM_FALLTHROUGH, llvm_unreachable, llvm::SPII::Load, llvm::Log2_32_Ceil(), llvm::lowerObjectSizeCall(), llvm::APInt::lshr(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APFloat(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_BSwap(), llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_FAbs(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_FPExt(), llvm::PatternMatch::m_FPOne(), llvm::PatternMatch::m_FSub(), llvm::PatternMatch::m_ICmp(), llvm::PatternMatch::m_Instruction(), llvm::PatternMatch::m_NaN(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_PosZeroFP(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Undef(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::m_ZeroInt(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::m_ZExtOrSExt(), llvm::BitmaskEnumDetail::Mask(), llvm::Intrinsic::masked_gather, llvm::Intrinsic::masked_load, llvm::Intrinsic::masked_scatter, llvm::Intrinsic::masked_store, llvm::PatternMatch::match(), llvm::Intrinsic::maximum, llvm::maximum(), llvm::Intrinsic::maxnum, llvm::maxnum(), llvm::LLVMContext::MD_nonnull, llvm::Intrinsic::memcpy, llvm::Intrinsic::memcpy_element_unordered_atomic, llvm::Intrinsic::memset, llvm::Intrinsic::minimum, llvm::minimum(), llvm::Intrinsic::minnum, llvm::minnum(), llvm::Instruction::moveBefore(), N, llvm::SIInstrFlags::N_INFINITY, llvm::SIInstrFlags::N_NORMAL, llvm::SIInstrFlags::N_SUBNORMAL, llvm::SIInstrFlags::N_ZERO, llvm::Intrinsic::nearbyint, llvm::NeverOverflows, llvm::None, llvm::Attribute::NonNull, llvm::Intrinsic::objectsize, llvm::OCF_INVALID, llvm::APFloatBase::opOK, OR, Other, llvm::SIInstrFlags::P_INFINITY, llvm::SIInstrFlags::P_NORMAL, llvm::SIInstrFlags::P_SUBNORMAL, llvm::SIInstrFlags::P_ZERO, llvm::peekThroughBitcast(), 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::ppc_qpx_qvlfd, llvm::Intrinsic::ppc_qpx_qvlfs, llvm::Intrinsic::ppc_qpx_qvstfd, llvm::Intrinsic::ppc_qpx_qvstfs, llvm::Intrinsic::ppc_vsx_lxvd2x, llvm::Intrinsic::ppc_vsx_lxvw4x, llvm::Intrinsic::ppc_vsx_stxvd2x, llvm::Intrinsic::ppc_vsx_stxvw4x, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SIInstrFlags::Q_NAN, llvm::Intrinsic::read_register, removeTriviallyEmptyRange(), llvm::AttributeList::ReturnIndex, llvm::Intrinsic::rint, llvm::NVPTX::PTXCvtMode::RM, llvm::APFloatBase::rmNearestTiesToEven, llvm::APFloatBase::rmTowardZero, llvm::Intrinsic::round, llvm::SIInstrFlags::S_NAN, llvm::APInt::sadd_ov(), llvm::Intrinsic::sadd_sat, llvm::Intrinsic::sadd_with_overflow, llvm::Attribute::SanitizeAddress, llvm::Attribute::SanitizeHWAddress, llvm::CallBase::setArgOperand(), llvm::CallBase::setCalledFunction(), llvm::CallBase::setDoesNotThrow(), llvm::Instruction::setMetadata(), llvm::User::setOperand(), Signed, llvm::SimplifyCall(), simplifyInvariantGroupIntrinsic(), simplifyMaskedGather(), simplifyMaskedLoad(), simplifyMaskedScatter(), simplifyMaskedStore(), simplifyNeonTbl1(), simplifyNeonVld1(), SimplifyNVVMIntrinsic(), simplifyX86extrq(), simplifyX86immShift(), simplifyX86insertps(), simplifyX86insertq(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), simplifyX86movmsk(), simplifyX86pack(), simplifyX86pshufb(), simplifyX86round(), simplifyX86varShift(), simplifyX86vpcom(), simplifyX86vpermilvar(), simplifyX86vpermv(), llvm::Intrinsic::sin, llvm::Intrinsic::smul_with_overflow, llvm::Intrinsic::ssub_sat, llvm::Intrinsic::ssub_with_overflow, llvm::Intrinsic::stackrestore, llvm::Intrinsic::stacksave, llvm::Intrinsic::strip_invariant_group, std::swap(), llvm::Value::takeName(), llvm::Intrinsic::trunc, llvm::Intrinsic::uadd_sat, llvm::APInt::uadd_sat(), llvm::Intrinsic::uadd_with_overflow, llvm::Intrinsic::umul_with_overflow, llvm::APInt::urem(), llvm::Intrinsic::usub_sat, llvm::Intrinsic::usub_with_overflow, X, llvm::Intrinsic::x86_avx2_maskload_d, llvm::Intrinsic::x86_avx2_maskload_d_256, llvm::Intrinsic::x86_avx2_maskload_q, llvm::Intrinsic::x86_avx2_maskload_q_256, llvm::Intrinsic::x86_avx2_maskstore_d, llvm::Intrinsic::x86_avx2_maskstore_d_256, llvm::Intrinsic::x86_avx2_maskstore_q, llvm::Intrinsic::x86_avx2_maskstore_q_256, llvm::Intrinsic::x86_avx2_packssdw, llvm::Intrinsic::x86_avx2_packsswb, llvm::Intrinsic::x86_avx2_packusdw, llvm::Intrinsic::x86_avx2_packuswb, llvm::Intrinsic::x86_avx2_pblendvb, llvm::Intrinsic::x86_avx2_permd, llvm::Intrinsic::x86_avx2_permps, llvm::Intrinsic::x86_avx2_pmovmskb, llvm::Intrinsic::x86_avx2_pshuf_b, llvm::Intrinsic::x86_avx2_psll_d, llvm::Intrinsic::x86_avx2_psll_q, llvm::Intrinsic::x86_avx2_psll_w, llvm::Intrinsic::x86_avx2_pslli_d, llvm::Intrinsic::x86_avx2_pslli_q, llvm::Intrinsic::x86_avx2_pslli_w, llvm::Intrinsic::x86_avx2_psllv_d, llvm::Intrinsic::x86_avx2_psllv_d_256, llvm::Intrinsic::x86_avx2_psllv_q, llvm::Intrinsic::x86_avx2_psllv_q_256, llvm::Intrinsic::x86_avx2_psra_d, llvm::Intrinsic::x86_avx2_psra_w, llvm::Intrinsic::x86_avx2_psrai_d, llvm::Intrinsic::x86_avx2_psrai_w, llvm::Intrinsic::x86_avx2_psrav_d, llvm::Intrinsic::x86_avx2_psrav_d_256, llvm::Intrinsic::x86_avx2_psrl_d, llvm::Intrinsic::x86_avx2_psrl_q, llvm::Intrinsic::x86_avx2_psrl_w, llvm::Intrinsic::x86_avx2_psrli_d, llvm::Intrinsic::x86_avx2_psrli_q, llvm::Intrinsic::x86_avx2_psrli_w, llvm::Intrinsic::x86_avx2_psrlv_d, llvm::Intrinsic::x86_avx2_psrlv_d_256, llvm::Intrinsic::x86_avx2_psrlv_q, llvm::Intrinsic::x86_avx2_psrlv_q_256, llvm::Intrinsic::x86_avx512_add_pd_512, llvm::Intrinsic::x86_avx512_add_ps_512, llvm::Intrinsic::x86_avx512_cmp_pd_128, llvm::Intrinsic::x86_avx512_cmp_pd_256, llvm::Intrinsic::x86_avx512_cmp_pd_512, llvm::Intrinsic::x86_avx512_cmp_ps_128, llvm::Intrinsic::x86_avx512_cmp_ps_256, llvm::Intrinsic::x86_avx512_cmp_ps_512, llvm::Intrinsic::x86_avx512_cvttsd2si, llvm::Intrinsic::x86_avx512_cvttsd2si64, llvm::Intrinsic::x86_avx512_cvttsd2usi, llvm::Intrinsic::x86_avx512_cvttsd2usi64, llvm::Intrinsic::x86_avx512_cvttss2si, llvm::Intrinsic::x86_avx512_cvttss2si64, llvm::Intrinsic::x86_avx512_cvttss2usi, llvm::Intrinsic::x86_avx512_cvttss2usi64, llvm::Intrinsic::x86_avx512_div_pd_512, llvm::Intrinsic::x86_avx512_div_ps_512, llvm::Intrinsic::x86_avx512_mask_add_sd_round, llvm::Intrinsic::x86_avx512_mask_add_ss_round, llvm::Intrinsic::x86_avx512_mask_cmp_sd, llvm::Intrinsic::x86_avx512_mask_cmp_ss, llvm::Intrinsic::x86_avx512_mask_div_sd_round, llvm::Intrinsic::x86_avx512_mask_div_ss_round, llvm::Intrinsic::x86_avx512_mask_max_sd_round, llvm::Intrinsic::x86_avx512_mask_max_ss_round, llvm::Intrinsic::x86_avx512_mask_min_sd_round, llvm::Intrinsic::x86_avx512_mask_min_ss_round, llvm::Intrinsic::x86_avx512_mask_mul_sd_round, llvm::Intrinsic::x86_avx512_mask_mul_ss_round, llvm::Intrinsic::x86_avx512_mask_rndscale_pd_128, llvm::Intrinsic::x86_avx512_mask_rndscale_pd_256, llvm::Intrinsic::x86_avx512_mask_rndscale_pd_512, llvm::Intrinsic::x86_avx512_mask_rndscale_ps_128, llvm::Intrinsic::x86_avx512_mask_rndscale_ps_256, llvm::Intrinsic::x86_avx512_mask_rndscale_ps_512, llvm::Intrinsic::x86_avx512_mask_rndscale_sd, llvm::Intrinsic::x86_avx512_mask_rndscale_ss, llvm::Intrinsic::x86_avx512_mask_sub_sd_round, llvm::Intrinsic::x86_avx512_mask_sub_ss_round, llvm::Intrinsic::x86_avx512_mul_pd_512, llvm::Intrinsic::x86_avx512_mul_ps_512, llvm::Intrinsic::x86_avx512_packssdw_512, llvm::Intrinsic::x86_avx512_packsswb_512, llvm::Intrinsic::x86_avx512_packusdw_512, llvm::Intrinsic::x86_avx512_packuswb_512, llvm::Intrinsic::x86_avx512_permvar_df_256, llvm::Intrinsic::x86_avx512_permvar_df_512, llvm::Intrinsic::x86_avx512_permvar_di_256, llvm::Intrinsic::x86_avx512_permvar_di_512, llvm::Intrinsic::x86_avx512_permvar_hi_128, llvm::Intrinsic::x86_avx512_permvar_hi_256, llvm::Intrinsic::x86_avx512_permvar_hi_512, llvm::Intrinsic::x86_avx512_permvar_qi_128, llvm::Intrinsic::x86_avx512_permvar_qi_256, llvm::Intrinsic::x86_avx512_permvar_qi_512, llvm::Intrinsic::x86_avx512_permvar_sf_512, llvm::Intrinsic::x86_avx512_permvar_si_512, llvm::Intrinsic::x86_avx512_pshuf_b_512, llvm::Intrinsic::x86_avx512_psll_d_512, llvm::Intrinsic::x86_avx512_psll_q_512, llvm::Intrinsic::x86_avx512_psll_w_512, llvm::Intrinsic::x86_avx512_pslli_d_512, llvm::Intrinsic::x86_avx512_pslli_q_512, llvm::Intrinsic::x86_avx512_pslli_w_512, llvm::Intrinsic::x86_avx512_psllv_d_512, llvm::Intrinsic::x86_avx512_psllv_q_512, llvm::Intrinsic::x86_avx512_psllv_w_128, llvm::Intrinsic::x86_avx512_psllv_w_256, llvm::Intrinsic::x86_avx512_psllv_w_512, llvm::Intrinsic::x86_avx512_psra_d_512, llvm::Intrinsic::x86_avx512_psra_q_128, llvm::Intrinsic::x86_avx512_psra_q_256, llvm::Intrinsic::x86_avx512_psra_q_512, llvm::Intrinsic::x86_avx512_psra_w_512, llvm::Intrinsic::x86_avx512_psrai_d_512, llvm::Intrinsic::x86_avx512_psrai_q_128, llvm::Intrinsic::x86_avx512_psrai_q_256, llvm::Intrinsic::x86_avx512_psrai_q_512, llvm::Intrinsic::x86_avx512_psrai_w_512, llvm::Intrinsic::x86_avx512_psrav_d_512, llvm::Intrinsic::x86_avx512_psrav_q_128, llvm::Intrinsic::x86_avx512_psrav_q_256, llvm::Intrinsic::x86_avx512_psrav_q_512, llvm::Intrinsic::x86_avx512_psrav_w_128, llvm::Intrinsic::x86_avx512_psrav_w_256, llvm::Intrinsic::x86_avx512_psrav_w_512, llvm::Intrinsic::x86_avx512_psrl_d_512, llvm::Intrinsic::x86_avx512_psrl_q_512, llvm::Intrinsic::x86_avx512_psrl_w_512, llvm::Intrinsic::x86_avx512_psrli_d_512, llvm::Intrinsic::x86_avx512_psrli_q_512, llvm::Intrinsic::x86_avx512_psrli_w_512, llvm::Intrinsic::x86_avx512_psrlv_d_512, llvm::Intrinsic::x86_avx512_psrlv_q_512, llvm::Intrinsic::x86_avx512_psrlv_w_128, llvm::Intrinsic::x86_avx512_psrlv_w_256, llvm::Intrinsic::x86_avx512_psrlv_w_512, llvm::Intrinsic::x86_avx512_sub_pd_512, llvm::Intrinsic::x86_avx512_sub_ps_512, llvm::Intrinsic::x86_avx512_vcomi_sd, llvm::Intrinsic::x86_avx512_vcomi_ss, llvm::Intrinsic::x86_avx512_vcvtsd2si32, llvm::Intrinsic::x86_avx512_vcvtsd2si64, llvm::Intrinsic::x86_avx512_vcvtsd2usi32, llvm::Intrinsic::x86_avx512_vcvtsd2usi64, llvm::Intrinsic::x86_avx512_vcvtss2si32, llvm::Intrinsic::x86_avx512_vcvtss2si64, llvm::Intrinsic::x86_avx512_vcvtss2usi32, llvm::Intrinsic::x86_avx512_vcvtss2usi64, llvm::Intrinsic::x86_avx512_vpermilvar_pd_512, llvm::Intrinsic::x86_avx512_vpermilvar_ps_512, llvm::Intrinsic::x86_avx_blendv_pd_256, llvm::Intrinsic::x86_avx_blendv_ps_256, llvm::Intrinsic::x86_avx_maskload_pd, llvm::Intrinsic::x86_avx_maskload_pd_256, llvm::Intrinsic::x86_avx_maskload_ps, llvm::Intrinsic::x86_avx_maskload_ps_256, llvm::Intrinsic::x86_avx_maskstore_pd, llvm::Intrinsic::x86_avx_maskstore_pd_256, llvm::Intrinsic::x86_avx_maskstore_ps, llvm::Intrinsic::x86_avx_maskstore_ps_256, llvm::Intrinsic::x86_avx_movmsk_pd_256, llvm::Intrinsic::x86_avx_movmsk_ps_256, llvm::Intrinsic::x86_avx_round_pd_256, llvm::Intrinsic::x86_avx_round_ps_256, llvm::Intrinsic::x86_avx_vpermilvar_pd, llvm::Intrinsic::x86_avx_vpermilvar_pd_256, llvm::Intrinsic::x86_avx_vpermilvar_ps, llvm::Intrinsic::x86_avx_vpermilvar_ps_256, llvm::Intrinsic::x86_bmi_bextr_32, llvm::Intrinsic::x86_bmi_bextr_64, llvm::Intrinsic::x86_bmi_bzhi_32, llvm::Intrinsic::x86_bmi_bzhi_64, llvm::Intrinsic::x86_mmx_pmovmskb, llvm::Intrinsic::x86_pclmulqdq, llvm::Intrinsic::x86_pclmulqdq_256, llvm::Intrinsic::x86_pclmulqdq_512, llvm::Intrinsic::x86_sse2_cmp_sd, llvm::Intrinsic::x86_sse2_comieq_sd, llvm::Intrinsic::x86_sse2_comige_sd, llvm::Intrinsic::x86_sse2_comigt_sd, llvm::Intrinsic::x86_sse2_comile_sd, llvm::Intrinsic::x86_sse2_comilt_sd, llvm::Intrinsic::x86_sse2_comineq_sd, llvm::Intrinsic::x86_sse2_cvtsd2si, llvm::Intrinsic::x86_sse2_cvtsd2si64, llvm::Intrinsic::x86_sse2_cvttsd2si, llvm::Intrinsic::x86_sse2_cvttsd2si64, llvm::Intrinsic::x86_sse2_maskmov_dqu, llvm::Intrinsic::x86_sse2_max_sd, llvm::Intrinsic::x86_sse2_min_sd, llvm::Intrinsic::x86_sse2_movmsk_pd, llvm::Intrinsic::x86_sse2_packssdw_128, llvm::Intrinsic::x86_sse2_packsswb_128, llvm::Intrinsic::x86_sse2_packuswb_128, llvm::Intrinsic::x86_sse2_pmovmskb_128, llvm::Intrinsic::x86_sse2_psll_d, llvm::Intrinsic::x86_sse2_psll_q, llvm::Intrinsic::x86_sse2_psll_w, llvm::Intrinsic::x86_sse2_pslli_d, llvm::Intrinsic::x86_sse2_pslli_q, llvm::Intrinsic::x86_sse2_pslli_w, llvm::Intrinsic::x86_sse2_psra_d, llvm::Intrinsic::x86_sse2_psra_w, llvm::Intrinsic::x86_sse2_psrai_d, llvm::Intrinsic::x86_sse2_psrai_w, llvm::Intrinsic::x86_sse2_psrl_d, llvm::Intrinsic::x86_sse2_psrl_q, llvm::Intrinsic::x86_sse2_psrl_w, llvm::Intrinsic::x86_sse2_psrli_d, llvm::Intrinsic::x86_sse2_psrli_q, llvm::Intrinsic::x86_sse2_psrli_w, llvm::Intrinsic::x86_sse2_ucomieq_sd, llvm::Intrinsic::x86_sse2_ucomige_sd, llvm::Intrinsic::x86_sse2_ucomigt_sd, llvm::Intrinsic::x86_sse2_ucomile_sd, llvm::Intrinsic::x86_sse2_ucomilt_sd, llvm::Intrinsic::x86_sse2_ucomineq_sd, llvm::Intrinsic::x86_sse41_blendvpd, llvm::Intrinsic::x86_sse41_blendvps, llvm::Intrinsic::x86_sse41_insertps, llvm::Intrinsic::x86_sse41_packusdw, llvm::Intrinsic::x86_sse41_pblendvb, llvm::Intrinsic::x86_sse41_round_pd, llvm::Intrinsic::x86_sse41_round_ps, llvm::Intrinsic::x86_sse41_round_sd, llvm::Intrinsic::x86_sse41_round_ss, llvm::Intrinsic::x86_sse4a_extrq, llvm::Intrinsic::x86_sse4a_extrqi, llvm::Intrinsic::x86_sse4a_insertq, llvm::Intrinsic::x86_sse4a_insertqi, llvm::Intrinsic::x86_sse_cmp_ss, llvm::Intrinsic::x86_sse_comieq_ss, llvm::Intrinsic::x86_sse_comige_ss, llvm::Intrinsic::x86_sse_comigt_ss, llvm::Intrinsic::x86_sse_comile_ss, llvm::Intrinsic::x86_sse_comilt_ss, llvm::Intrinsic::x86_sse_comineq_ss, llvm::Intrinsic::x86_sse_cvtss2si, llvm::Intrinsic::x86_sse_cvtss2si64, llvm::Intrinsic::x86_sse_cvttss2si, llvm::Intrinsic::x86_sse_cvttss2si64, llvm::Intrinsic::x86_sse_max_ss, llvm::Intrinsic::x86_sse_min_ss, llvm::Intrinsic::x86_sse_movmsk_ps, llvm::Intrinsic::x86_sse_ucomieq_ss, llvm::Intrinsic::x86_sse_ucomige_ss, llvm::Intrinsic::x86_sse_ucomigt_ss, llvm::Intrinsic::x86_sse_ucomile_ss, llvm::Intrinsic::x86_sse_ucomilt_ss, llvm::Intrinsic::x86_sse_ucomineq_ss, llvm::Intrinsic::x86_ssse3_pshuf_b_128, llvm::Intrinsic::x86_tbm_bextri_u32, llvm::Intrinsic::x86_tbm_bextri_u64, llvm::Intrinsic::x86_vcvtph2ps_128, llvm::Intrinsic::x86_vcvtph2ps_256, llvm::Intrinsic::x86_xop_vfrcz_sd, llvm::Intrinsic::x86_xop_vfrcz_ss, llvm::Intrinsic::x86_xop_vpcomb, llvm::Intrinsic::x86_xop_vpcomd, llvm::Intrinsic::x86_xop_vpcomq, llvm::Intrinsic::x86_xop_vpcomub, llvm::Intrinsic::x86_xop_vpcomud, llvm::Intrinsic::x86_xop_vpcomuq, llvm::Intrinsic::x86_xop_vpcomuw, llvm::Intrinsic::x86_xop_vpcomw, Y, and llvm::APInt::zextOrTrunc().
Instruction * InstCombiner::visitExtractElementInst | ( | ExtractElementInst & | EI | ) |
Definition at line 257 of file InstCombineVectorOps.cpp.
References cheapToScalarize(), llvm::CastInst::Create(), llvm::CmpInst::Create(), llvm::ExtractElementInst::Create(), llvm::BinaryOperator::CreateWithCopiedFlags(), llvm::dyn_cast(), foldBitcastExtElt(), llvm::ConstantInt::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::ExtractElementInst::getIndexOperand(), llvm::Type::getInt32Ty(), llvm::SequentialType::getNumElements(), getOpcode(), llvm::BinaryOperator::getOpcode(), 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::PatternMatch::m_BinOp(), llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::APInt::setBit(), llvm::User::setOperand(), llvm::SimplifyExtractElementInst(), X, and Y.
Instruction * InstCombiner::visitExtractValueInst | ( | ExtractValueInst & | EV | ) |
Definition at line 2561 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(), llvm::makeArrayRef(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::Intrinsic::sadd_with_overflow, llvm::Instruction::setAAMetadata(), llvm::SimplifyExtractValueInst(), llvm::Intrinsic::smul_with_overflow, llvm::Intrinsic::ssub_with_overflow, llvm::Intrinsic::uadd_with_overflow, llvm::Intrinsic::umul_with_overflow, and llvm::Intrinsic::usub_with_overflow.
Instruction * InstCombiner::visitFAdd | ( | BinaryOperator & | I | ) |
Definition at line 1270 of file InstCombineAddSub.cpp.
References llvm::BinaryOperator::CreateFSubFMF(), F(), factorizeFAddFSub(), llvm::Instruction::getFastMathFlags(), llvm::Type::getFltSemantics(), llvm::ConstantExpr::getFPToSI(), llvm::Type::getIntegerBitWidth(), llvm::User::getOperand(), llvm::Type::getScalarType(), llvm::ConstantExpr::getSIToFP(), llvm::Value::getType(), llvm::Instruction::hasAllowReassoc(), llvm::Instruction::hasNoSignedZeros(), I, llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::APFloatBase::semanticsPrecision(), llvm::SimplifyFAddInst(), and X.
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 5396 of file InstCombineCompares.cpp.
References B, C, llvm::APFloat::clearSign(), llvm::APFloatBase::cmpLessThan, llvm::APFloat::compare(), llvm::APFloat::convert(), llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::SelectPatternResult::Flavor, foldFabsWithFcmpZero(), foldFCmpReciprocalAndZero(), foldVectorCmp(), llvm::ConstantFP::get(), llvm::getComplexity(), llvm::Instruction::getFastMathFlags(), llvm::Type::getFltSemantics(), llvm::ConstantExpr::getFNeg(), llvm::Constant::getNullValue(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::CmpInst::getPredicate(), llvm::Type::getScalarType(), llvm::APFloat::getSmallestNormalized(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), llvm::GlobalVariable::hasDefinitiveInitializer(), llvm::Value::hasOneUse(), I, llvm::GlobalVariable::isConstant(), llvm::isKnownNeverNaN(), llvm::Type::isVectorTy(), isVolatile(), llvm::APFloat::isZero(), llvm::SPII::Load, llvm::PatternMatch::m_AnyZeroFP(), llvm::PatternMatch::m_APFloat(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_FPExt(), llvm::PatternMatch::m_Instruction(), llvm::PatternMatch::m_PosZeroFP(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::matchSelectPattern(), llvm::APFloatBase::rmNearestTiesToEven, llvm::User::setOperand(), llvm::CmpInst::setPredicate(), llvm::SimplifyFCmpInst(), llvm::SPF_UNKNOWN, llvm::FCmpInst::swapOperands(), llvm::Instruction::user_back(), X, and Y.
Instruction * InstCombiner::visitFDiv | ( | BinaryOperator & | I | ) |
Definition at line 1107 of file InstCombineMulDivRem.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Attrs, B, llvm::IRBuilder< T, Inserter >::CreateFDiv(), llvm::BinaryOperator::CreateFDivFMF(), llvm::emitUnaryFloatFnCall(), foldFDivConstantDividend(), foldFDivConstantDivisor(), llvm::ConstantFP::get(), llvm::Function::getAttributes(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::Instruction::getFastMathFlags(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Instruction::hasAllowReassoc(), llvm::Instruction::hasAllowReciprocal(), llvm::Instruction::hasNoNaNs(), llvm::Value::hasOneUse(), llvm::hasUnaryFloatFn(), I, llvm::PatternMatch::m_c_FMul(), llvm::PatternMatch::m_FDiv(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::IRBuilderBase::setFastMathFlags(), llvm::User::setOperand(), SI, llvm::SimplifyFDivInst(), X, and Y.
Instruction * InstCombiner::visitFenceInst | ( | FenceInst & | FI | ) |
Definition at line 4043 of file InstCombineCalls.cpp.
References llvm::Instruction::getNextNonDebugInstruction(), and llvm::Instruction::isIdenticalTo().
Instruction * InstCombiner::visitFMul | ( | BinaryOperator & | I | ) |
Definition at line 347 of file InstCombineMulDivRem.cpp.
References C, llvm::Instruction::copyFastMathFlags(), llvm::BinaryOperator::CreateFAddFMF(), llvm::BinaryOperator::CreateFDivFMF(), llvm::BinaryOperator::CreateFMulFMF(), llvm::BinaryOperator::CreateFNegFMF(), llvm::BinaryOperator::CreateFSubFMF(), llvm::Instruction::getFastMathFlags(), llvm::ConstantExpr::getFDiv(), llvm::ConstantExpr::getFMul(), llvm::ConstantExpr::getFNeg(), llvm::User::getOperand(), llvm::Instruction::hasAllowReassoc(), llvm::Instruction::hasNoNaNs(), llvm::Value::hasOneUse(), I, llvm::Instruction::isFast(), llvm::Constant::isFiniteNonZeroFP(), llvm::Constant::isNormalFP(), llvm::Log2(), llvm::PatternMatch::m_c_FMul(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_FAdd(), llvm::PatternMatch::m_FDiv(), llvm::PatternMatch::m_FMul(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_FSub(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_SpecificFP(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::CallBase::setArgOperand(), llvm::SimplifyFMulInst(), llvm::Intrinsic::sqrt, X, llvm::SystemZISD::XC, and Y.
Instruction * InstCombiner::visitFPExt | ( | CastInst & | CI | ) |
Definition at line 1674 of file InstCombineCasts.cpp.
Instruction * InstCombiner::visitFPToSI | ( | FPToSIInst & | FI | ) |
Definition at line 1733 of file InstCombineCasts.cpp.
References llvm::dyn_cast(), llvm::User::getOperand(), and I.
Instruction * InstCombiner::visitFPToUI | ( | FPToUIInst & | FI | ) |
Definition at line 1722 of file InstCombineCasts.cpp.
References llvm::dyn_cast(), llvm::User::getOperand(), and I.
Instruction * InstCombiner::visitFPTrunc | ( | FPTruncInst & | CI | ) |
Definition at line 1525 of file InstCombineCasts.cpp.
References llvm::Intrinsic::ceil, llvm::Instruction::copyFastMathFlags(), llvm::BinaryOperator::Create(), llvm::CallInst::Create(), llvm::BinaryOperator::CreateFDivFMF(), llvm::BinaryOperator::CreateFMulFMF(), llvm::BinaryOperator::CreateFNegFMF(), llvm::CastInst::CreateFPCast(), llvm::dyn_cast(), llvm::Intrinsic::fabs, llvm::Intrinsic::floor, llvm::Intrinsic::getDeclaration(), llvm::Type::getFPMantissaWidth(), getMinimumFPType(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::CastInst::getSrcTy(), llvm::Value::getType(), llvm::Value::hasOneUse(), I, llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::max(), llvm::Intrinsic::nearbyint, llvm::Intrinsic::rint, llvm::Intrinsic::round, shrinkInsertElt(), llvm::Intrinsic::trunc, and X.
Instruction * InstCombiner::visitFree | ( | CallInst & | FI | ) |
Definition at line 2425 of file InstructionCombining.cpp.
References llvm::UndefValue::get(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt1PtrTy(), llvm::ConstantInt::getTrue(), I, and tryToMoveFreeBeforeNullTest().
Instruction * InstCombiner::visitFRem | ( | BinaryOperator & | I | ) |
Definition at line 1358 of file InstCombineMulDivRem.cpp.
References llvm::Instruction::getFastMathFlags(), llvm::User::getOperand(), llvm::SimplifyFRemInst(), and X.
Instruction * InstCombiner::visitFSub | ( | BinaryOperator & | I | ) |
Definition at line 1748 of file InstCombineAddSub.cpp.
References C, llvm::CannotBeNegativeZero(), llvm::BinaryOperator::CreateFAddFMF(), llvm::BinaryOperator::CreateFDivFMF(), llvm::BinaryOperator::CreateFMulFMF(), llvm::BinaryOperator::CreateFNegFMF(), F(), factorizeFAddFSub(), llvm::ConstantFP::get(), llvm::Instruction::getFastMathFlags(), llvm::ConstantExpr::getFNeg(), llvm::ConstantExpr::getFSub(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Instruction::hasAllowReassoc(), llvm::Instruction::hasNoSignedZeros(), I, llvm::PatternMatch::m_c_FAdd(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_FDiv(), llvm::PatternMatch::m_FMul(), llvm::PatternMatch::m_FNeg(), llvm::PatternMatch::m_FPExt(), llvm::PatternMatch::m_FPTrunc(), llvm::PatternMatch::m_FSub(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_PosZeroFP(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), SI, simplify, llvm::SimplifyFSubInst(), X, and Y.
Instruction * InstCombiner::visitGetElementPtrInst | ( | GetElementPtrInst & | GEP | ) |
Definition at line 1554 of file InstructionCombining.cpp.
References llvm::GetElementPtrInst::accumulateConstantOffset(), llvm::PHINode::addIncoming(), llvm::SmallVectorImpl< T >::append(), assert(), C, 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::Type::getArrayNumElements(), 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::getVectorElementType(), 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(), llvm::User::op_begin(), llvm::User::op_end(), llvm::User::operands(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::GetElementPtrInst::setIsInBounds(), llvm::User::setOperand(), llvm::GetElementPtrInst::setSourceElementType(), shouldMergeGEPs(), llvm::SimplifyAddInst(), 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 4763 of file InstCombineCompares.cpp.
References assert(), B, C, canonicalizeCmpWithConstant(), canonicalizeICmpBool(), llvm::APFloatBase::cmpEqual, llvm::APFloatBase::cmpGreaterThan, llvm::APFloatBase::cmpLessThan, llvm::APFloat::compare(), llvm::APFloat::convertFromAPInt(), llvm::APFloat::convertToInteger(), llvm::CmpInst::Create(), llvm::ExtractValueInst::Create(), 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_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::SelectPatternResult::Flavor, foldICmpWithHighBitMask(), foldICmpWithMinMax(), foldVectorCmp(), llvm::ConstantInt::get(), llvm::Constant::getAllOnesValue(), llvm::ConstantExpr::getBitCast(), llvm::IntegerType::getBitWidth(), llvm::getComplexity(), llvm::Type::getFPMantissaWidth(), llvm::ConstantExpr::getFPToSI(), llvm::ConstantExpr::getFPToUI(), llvm::CmpInst::getInversePredicate(), llvm::APFloat::getLargest(), llvm::APInt::getMaxValue(), llvm::APInt::getMinValue(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Type::getScalarSizeInBits(), llvm::APFloat::getSemantics(), llvm::APInt::getSignedMaxValue(), llvm::APInt::getSignedMinValue(), llvm::ConstantExpr::getSIToFP(), llvm::CmpInst::getSwappedPredicate(), llvm::Value::getType(), llvm::ConstantExpr::getUIToFP(), llvm::GetUnderlyingObject(), 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::APFloatBase::IEK_Inf, llvm::detail::ilogb(), llvm::ICmpInst::isEquality(), llvm::FCmpInst::isEquality(), llvm::Type::isIntOrIntVectorTy(), llvm::isKnownToBeAPowerOfTwo(), llvm::APInt::isMaxSignedValue(), llvm::APInt::isMinSignedValue(), llvm::APFloat::isNaN(), llvm::APFloat::isNegative(), llvm::Type::isPointerTy(), llvm::Type::isVectorTy(), llvm::APFloat::isZero(), llvm_unreachable, llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_BitCast(), llvm::PatternMatch::m_Instruction(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_Select(), llvm::PatternMatch::m_SIToFP(), llvm::PatternMatch::m_UAddWithOverflow(), llvm::PatternMatch::m_UIToFP(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), llvm::matchSelectPattern(), llvm::OCF_UNSIGNED_ADD, P, processUMulZExtIdiom(), llvm::APFloatBase::rmNearestTiesToEven, llvm::APFloat::roundToIntegral(), llvm::SimplifyICmpInst(), llvm::SPF_UNKNOWN, std::swap(), swapMayExposeCSEOpportunities(), llvm::ICmpInst::swapOperands(), llvm::Instruction::user_back(), and X.
Instruction * InstCombiner::visitInsertElementInst | ( | InsertElementInst & | IE | ) |
Definition at line 858 of file InstCombineVectorOps.cpp.
References collectShuffleElements(), llvm::dyn_cast(), 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(), hoistInsEltConst(), llvm::ARM_PROC::IE, llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_ExtractElement(), llvm::PatternMatch::m_Value(), llvm::BitmaskEnumDetail::Mask(), llvm::PatternMatch::match(), and llvm::SimplifyInsertElementInst().
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 619 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 420 of file InstCombineInternal.h.
References llvm::MCID::Add, B, C, llvm::computeOverflowForSignedAdd(), llvm::computeOverflowForSignedMul(), llvm::computeOverflowForSignedSub(), llvm::computeOverflowForUnsignedAdd(), llvm::computeOverflowForUnsignedMul(), llvm::computeOverflowForUnsignedSub(), D, llvm::EmitGEPOffset(), From, llvm_unreachable, llvm::NeverOverflows, and willNotOverflow().
Instruction * InstCombiner::visitIntToPtr | ( | IntToPtrInst & | CI | ) |
Definition at line 1752 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(), I, llvm::Type::isVectorTy(), and P.
Instruction * InstCombiner::visitInvokeInst | ( | InvokeInst & | II | ) |
Definition at line 4053 of file InstCombineCalls.cpp.
Instruction * InstCombiner::visitLandingPadInst | ( | LandingPadInst & | LI | ) |
Definition at line 2747 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(), getType(), llvm::Value::getType(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::LandingPadInst::isCatch(), isCatchAll(), llvm::LandingPadInst::isCleanup(), llvm::LandingPadInst::isFilter(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::LandingPadInst::setCleanup(), shorter_filter(), llvm::SmallVectorBase::size(), llvm::Constant::stripPointerCasts(), and llvm::Value::stripPointerCasts().
Instruction * InstCombiner::visitLoadInst | ( | LoadInst & | LI | ) |
Definition at line 992 of file InstCombineLoadStoreAlloca.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), canSimplifyNullLoadOrGEP(), combineLoadToOperationType(), llvm::combineMetadataForCSE(), llvm::SelectInst::Create(), llvm::DefMaxInstsToScan, llvm::FindAvailableLoadedValue(), llvm::UndefValue::get(), llvm::LoadInst::getAlignment(), llvm::Instruction::getDebugLoc(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::LoadInst::getOrdering(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::LoadInst::getPointerAddressSpace(), llvm::LoadInst::getSyncScopeID(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::isSafeToLoadUnconditionally(), llvm::LoadInst::isUnordered(), llvm::NullPointerIsDefined(), replaceGEPIdxWithZero(), llvm::LoadInst::setAlignment(), llvm::LoadInst::setAtomic(), llvm::Instruction::setDebugLoc(), llvm::User::setOperand(), SI, unpackLoadToAggregate(), and llvm::NVPTX::PTXLdStInstCode::V2.
Instruction * InstCombiner::visitLShr | ( | BinaryOperator & | I | ) |
Definition at line 695 of file InstCombineShifts.cpp.
References assert(), llvm::Intrinsic::ctlz, llvm::Intrinsic::ctpop, llvm::Intrinsic::cttz, llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::Constant::getAllOnesValue(), llvm::IntrinsicInst::getIntrinsicID(), llvm::APInt::getLowBitsSet(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), getScalarSizeInBits(), llvm::ConstantInt::getSigned(), getType(), llvm::Value::getType(), llvm::APInt::getZExtValue(), llvm::Value::hasOneUse(), I, llvm::Instruction::isExact(), llvm::Type::isIntegerTy(), llvm::isPowerOf2_32(), llvm::Log2_32(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::BitmaskEnumDetail::Mask(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::Instruction::setIsExact(), llvm::SimplifyLShrInst(), llvm::APInt::ugt(), llvm::APInt::ult(), and X.
Instruction * InstCombiner::visitMul | ( | BinaryOperator & | I | ) |
i1 mul -> i1 and.
Definition at line 128 of file InstCombineMulDivRem.cpp.
References llvm::APInt::abs(), C, llvm::SelectInst::Create(), CreateAdd(), CreateMul(), llvm::BinaryOperator::CreateNeg(), llvm::dyn_cast(), llvm::MipsISD::Ext, llvm::ConstantInt::get(), llvm::APInt::getBitWidth(), getLogBase2(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::ConstantExpr::getShl(), llvm::Value::getType(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), I, llvm::Instruction::isExact(), llvm::Type::isIntOrIntVectorTy(), llvm::APInt::isNegative(), llvm::Constant::isNotMinSignedValue(), llvm::APInt::isPowerOf2(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_c_Mul(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::SimplifyMulInst(), X, and Y.
Instruction * InstCombiner::visitOr | ( | BinaryOperator & | I | ) |
Definition at line 2191 of file InstCombineAndOrXor.cpp.
References B, C, llvm::SelectInst::Create(), D, llvm::dyn_cast(), foldOrToXor(), llvm::ConstantInt::get(), llvm::Value::getName(), llvm::User::getOperand(), llvm::ConstantExpr::getOr(), llvm::ConstantInt::getSigned(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::Value::hasOneUse(), I, llvm::APInt::isAllOnesValue(), llvm::Type::isIntOrIntVectorTy(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_c_Or(), 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(), matchRotate(), SimplifyBSwap(), llvm::SimplifyOrInst(), std::swap(), llvm::Value::takeName(), llvm::NVPTX::PTXLdStInstCode::V2, X, and Y.
Instruction * InstCombiner::visitPHINode | ( | PHINode & | PN | ) |
Definition at line 1122 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(), getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::Value::hasOneUse(), 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 1798 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 2454 of file InstructionCombining.cpp.
References llvm::computeKnownBits(), llvm::KnownBits::getConstant(), llvm::Constant::getIntegerValue(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::Value::getType(), llvm::KnownBits::isConstant(), llvm::Type::isIntegerTy(), and llvm::User::setOperand().
Instruction * InstCombiner::visitSDiv | ( | BinaryOperator & | I | ) |
Definition at line 960 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::getScalarSizeInBits(), llvm::APInt::getSignMask(), llvm::ConstantExpr::getTrunc(), llvm::Value::getType(), llvm::Instruction::isExact(), llvm::Type::isIntOrIntVectorTy(), llvm::isKnownToBeAPowerOfTwo(), llvm::APInt::isNonNegative(), llvm::APInt::isPowerOf2(), llvm::PatternMatch::m_AllOnes(), 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 | ) |
Referenced by canonicalizeSaturatedSubtract().
Instruction * InstCombiner::visitSExt | ( | SExtInst & | CI | ) |
Definition at line 1361 of file InstCombineCasts.cpp.
References assert(), canEvaluateSExtd(), llvm::computeKnownBits(), llvm::ComputeNumSignBits(), llvm::dbgs(), llvm::ConstantInt::get(), llvm::Value::getName(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Value::hasOneUse(), I, llvm::KnownBits::isNonNegative(), LLVM_DEBUG, llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Trunc(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::Instruction::user_back(), and X.
Instruction * InstCombiner::visitShl | ( | BinaryOperator & | I | ) |
Definition at line 590 of file InstCombineShifts.cpp.
References llvm::ComputeNumSignBits(), llvm::BinaryOperator::Create(), CreateMul(), llvm::ConstantInt::get(), llvm::Constant::getAllOnesValue(), llvm::APInt::getHighBitsSet(), getOpcode(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::ConstantExpr::getShl(), llvm::Value::getType(), llvm::APInt::getZExtValue(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), I, llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_Exact(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Shr(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_ZExt(), llvm::BitmaskEnumDetail::Mask(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::SimplifyShlInst(), and X.
Instruction * InstCombiner::visitShuffleVectorInst | ( | ShuffleVectorInst & | SVI | ) |
Definition at line 1591 of file InstCombineVectorOps.cpp.
References assert(), canEvaluateShuffled(), llvm::dyn_cast(), E, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), evaluateInDifferentElementOrder(), llvm::MipsISD::Ext, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), foldIdentityExtractShuffle(), foldSelectShuffle(), foldShuffleWithInsert(), 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::ShuffleVectorInst::getMask(), llvm::Value::getName(), llvm::SequentialType::getNumElements(), llvm::User::getOperand(), llvm::ShuffleVectorInst::getShuffleMask(), llvm::Value::getType(), llvm::ShuffleVectorInst::getType(), llvm::Type::getVectorNumElements(), I, Int32Ty, isShuffleExtractingFromLHS(), isSplat(), llvm::VectorType::isValidElementType(), llvm::BitmaskEnumDetail::Mask(), narrowVectorSelect(), llvm::SmallVectorTemplateBase< T >::push_back(), recognizeIdentityMask(), llvm::User::setOperand(), llvm::SimplifyShuffleVectorInst(), llvm::SmallVectorBase::size(), and llvm::Value::users().
Instruction * InstCombiner::visitSIToFP | ( | CastInst & | CI | ) |
Definition at line 1748 of file InstCombineCasts.cpp.
Instruction * InstCombiner::visitSRem | ( | BinaryOperator & | I | ) |
Definition at line 1285 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::getScalarSizeInBits(), llvm::APInt::getSignMask(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), I, llvm::APInt::isMinSignedValue(), llvm::PatternMatch::m_Negative(), llvm::BitmaskEnumDetail::Mask(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::User::setOperand(), llvm::SimplifySRemInst(), X, and Y.
Instruction * InstCombiner::visitStoreInst | ( | StoreInst & | SI | ) |
Definition at line 1389 of file InstCombineLoadStoreAlloca.cpp.
References llvm::PHINode::addIncoming(), assert(), llvm::BasicBlock::begin(), canSimplifyNullStoreOrGEP(), combineStoreToValueType(), llvm::PHINode::Create(), llvm::dyn_cast(), equivalentAddressValues(), llvm::BasicBlock::front(), GEP, llvm::UndefValue::get(), llvm::Instruction::getAAMetadata(), llvm::StoreInst::getAlignment(), llvm::Instruction::getDebugLoc(), llvm::BasicBlock::getFirstInsertionPt(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::DILocation::getMergedLocation(), llvm::User::getOperand(), llvm::StoreInst::getOrdering(), llvm::getOrEnforceKnownAlignment(), llvm::Instruction::getParent(), llvm::Instruction::getSuccessor(), llvm::StoreInst::getSyncScopeID(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::BasicBlock::hasNPredecessors(), llvm::Value::hasOneUse(), I, llvm::Instruction::isSameOperationAs(), llvm::StoreInst::isUnordered(), llvm::StoreInst::isVolatile(), llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayThrow(), llvm::Instruction::mayWriteToMemory(), llvm::pred_begin(), removeBitcastsFromLoadStoreOnMinMax(), replaceGEPIdxWithZero(), llvm::Instruction::setAAMetadata(), llvm::StoreInst::setAlignment(), llvm::Instruction::setDebugLoc(), llvm::User::setOperand(), SI, and unpackStoreToAggregate().
Instruction * InstCombiner::visitSub | ( | BinaryOperator & | I | ) |
Definition at line 1452 of file InstCombineAddSub.cpp.
References llvm::MCID::Add, llvm::AddOne(), assert(), B, C, llvm::computeKnownBits(), llvm::SelectInst::Create(), CreateAdd(), llvm::BinaryOperator::CreateNeg(), llvm::BinaryOperator::CreateNot(), llvm::CastInst::CreateSExtOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), llvm::MipsISD::Ext, llvm::SelectPatternResult::Flavor, llvm::SelectInst::getFalseValue(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::ConstantExpr::getSub(), llvm::SelectInst::getTrueValue(), llvm::Value::getType(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasNUsesOrMore(), I, llvm::IsFreeToInvert(), llvm::Type::isIntOrIntVectorTy(), llvm::APInt::isMask(), llvm::SelectPatternResult::isMinOrMax(), llvm::Constant::isNotMinSignedValue(), llvm::APInt::isNullValue(), llvm::Constant::isOneValue(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_c_Add(), llvm::PatternMatch::m_c_And(), llvm::PatternMatch::m_c_Mul(), llvm::PatternMatch::m_c_Or(), llvm::PatternMatch::m_c_Xor(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_OneUse(), 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_ZeroInt(), llvm::PatternMatch::m_ZExt(), llvm::PatternMatch::match(), llvm::matchSelectPattern(), llvm::SelectInst::setFalseValue(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::SelectInst::setTrueValue(), SI, llvm::SimplifySubInst(), llvm::SPF_ABS, llvm::SPF_NABS, llvm::SubOne(), std::swap(), X, Y, and llvm::KnownBits::Zero.
Instruction * InstCombiner::visitSwitchInst | ( | SwitchInst & | SI | ) |
Definition at line 2509 of file InstructionCombining.cpp.
References assert(), llvm::SwitchInst::cases(), llvm::computeKnownBits(), llvm::KnownBits::countMinLeadingOnes(), llvm::KnownBits::countMinLeadingZeros(), llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::KnownBits::getBitWidth(), llvm::SwitchInst::getCondition(), llvm::Value::getContext(), llvm::ConstantExpr::getSub(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::max(), llvm::SwitchInst::setCondition(), SI, and llvm::APInt::trunc().
Instruction * InstCombiner::visitTrunc | ( | TruncInst & | CI | ) |
Definition at line 685 of file InstCombineCasts.cpp.
References assert(), C, canEvaluateTruncated(), llvm::computeKnownBits(), llvm::APInt::countPopulation(), llvm::APInt::countTrailingZeros(), llvm::BinaryOperator::Create(), llvm::CastInst::CreateIntegerCast(), llvm::dbgs(), llvm::SelectPatternResult::Flavor, foldVecTruncToExtElt(), llvm::ConstantInt::get(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::ConstantInt::getZExtValue(), llvm::Value::hasOneUse(), I, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLT, llvm::tgtok::In, llvm::APInt::isAllOnesValue(), llvm::ICmpInst::isEquality(), llvm::Type::isIntegerTy(), llvm::APInt::isNullValue(), llvm::APInt::isPowerOf2(), llvm::Type::isVectorTy(), LLVM_DEBUG, llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_c_Or(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Deferred(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_OneUse(), 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(), llvm::max(), llvm::KnownBits::One, shrinkInsertElt(), shrinkSplatShuffle(), SI, llvm::SPF_UNKNOWN, llvm::Value::takeName(), llvm::APInt::trunc(), llvm::APInt::uge(), llvm::APInt::ult(), X, and llvm::KnownBits::Zero.
Instruction * InstCombiner::visitUDiv | ( | BinaryOperator & | I | ) |
Definition at line 866 of file InstCombineMulDivRem.cpp.
References B, llvm::SelectInst::Create(), llvm::CastInst::CreateZExtOrBitCast(), llvm::ConstantInt::get(), llvm::Constant::getAllOnesValue(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Instruction::insertBefore(), llvm::Instruction::isExact(), llvm::Type::isIntOrIntVectorTy(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_Exact(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_Negative(), llvm::PatternMatch::m_NUWMul(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), narrowUDivURem(), llvm::Instruction::setIsExact(), llvm::SimplifyUDivInst(), llvm::SmallVectorBase::size(), llvm::APInt::ushl_ov(), visitUDivOperand(), and X.
Instruction * InstCombiner::visitUIToFP | ( | CastInst & | CI | ) |
Definition at line 1744 of file InstCombineCasts.cpp.
Instruction * InstCombiner::visitURem | ( | BinaryOperator & | I | ) |
Definition at line 1238 of file InstCombineMulDivRem.cpp.
References llvm::MCID::Add, llvm::SelectInst::Create(), llvm::CastInst::CreateZExtOrBitCast(), llvm::Constant::getAllOnesValue(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::isIntOrIntVectorTy(), llvm::isKnownToBeAPowerOfTwo(), llvm::PatternMatch::m_Negative(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), narrowUDivURem(), llvm::SimplifyURemInst(), and X.
Instruction * InstCombiner::visitVACopyInst | ( | VACopyInst & | I | ) |
Definition at line 1814 of file InstCombineCalls.cpp.
References removeTriviallyEmptyRange(), llvm::Intrinsic::vacopy, and llvm::Intrinsic::vaend.
Instruction * InstCombiner::visitVAStartInst | ( | VAStartInst & | I | ) |
Definition at line 1809 of file InstCombineCalls.cpp.
References removeTriviallyEmptyRange(), llvm::Intrinsic::vaend, and llvm::Intrinsic::vastart.
Instruction * InstCombiner::visitXor | ( | BinaryOperator & | I | ) |
Definition at line 2662 of file InstCombineAndOrXor.cpp.
References llvm::MCID::Add, llvm::AddOne(), B, C, llvm::SelectInst::Create(), CreateAdd(), llvm::BinaryOperator::CreateNot(), llvm::dyn_cast(), llvm::SelectPatternResult::Flavor, foldXorToXor(), llvm::ConstantInt::get(), llvm::Instruction::getDebugLoc(), llvm::getInverseMinMaxPred(), llvm::CmpInst::getInversePredicate(), llvm::Value::getName(), llvm::ConstantExpr::getNeg(), llvm::ConstantExpr::getNot(), llvm::Constant::getNullValue(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::Value::hasNUses(), llvm::Value::hasNUsesOrMore(), llvm::Value::hasOneUse(), I, llvm::IsFreeToInvert(), llvm::SelectPatternResult::isMinOrMax(), llvm::APInt::isSignMask(), llvm::APInt::lshr(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_And(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_AShr(), llvm::PatternMatch::m_BinOp(), llvm::PatternMatch::m_c_Add(), llvm::PatternMatch::m_c_And(), llvm::PatternMatch::m_c_Or(), llvm::PatternMatch::m_c_Xor(), llvm::PatternMatch::m_Cmp(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_Deferred(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_Negative(), llvm::PatternMatch::m_NonNegative(), llvm::PatternMatch::m_Not(), llvm::PatternMatch::m_OneUse(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Sub(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::matchSelectPattern(), llvm::User::setOperand(), SimplifyBSwap(), llvm::SimplifyXorInst(), sinkNotIntoXor(), std::swap(), llvm::Value::takeName(), visitMaskedMerge(), X, and Y.
Instruction * InstCombiner::visitZExt | ( | ZExtInst & | CI | ) |
Definition at line 1089 of file InstCombineCasts.cpp.
References assert(), C, canEvaluateZExtd(), llvm::computeKnownBits(), llvm::APInt::countLeadingZeros(), llvm::APInt::countTrailingZeros(), llvm::BinaryOperator::Create(), llvm::CastInst::CreateIntegerCast(), llvm::dbgs(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::Constant::getAllOnesValue(), llvm::APInt::getBitWidth(), llvm::APInt::getHighBitsSet(), llvm::APInt::getLowBitsSet(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::Type::getScalarSizeInBits(), getScalarSizeInBits(), llvm::Value::getType(), llvm::ConstantExpr::getZExt(), llvm::Value::hasOneUse(), llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLT, llvm::tgtok::In, llvm::ICmpInst::isEquality(), llvm::APInt::isPowerOf2(), LLVM_DEBUG, llvm::PatternMatch::m_AllOnes(), 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::PatternMatch::m_ZeroInt(), llvm::MaskedValueIsZero(), llvm::PatternMatch::match(), llvm::replaceAllDbgUsesWith(), llvm::Instruction::user_back(), X, and llvm::KnownBits::Zero.
BuilderTy& llvm::InstCombiner::Builder |
Definition at line 291 of file InstCombineInternal.h.
Referenced by canonicalizeBitCastExtElt(), combineLoadToNewType(), combineLoadToOperationType(), combineStoreToNewValue(), evaluateGEPOffsetExpression(), foldCttzCtlz(), foldUDivShl(), foldVecTruncToExtElt(), getShiftedValue(), optimizeIntegerToVectorInsertions(), optimizeVectorResize(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), removeBitcastsFromLoadStoreOnMinMax(), simplifyAllocaArraySize(), simplifyInvariantGroupIntrinsic(), simplifyValueKnownNonZero(), simplifyX86MaskedLoad(), simplifyX86MaskedStore(), unpackLoadToAggregate(), and unpackStoreToAggregate().
uint64_t llvm::InstCombiner::MaxArraySizeForCombine |
Maximum size of array considered when transforming.
Definition at line 735 of file InstCombineInternal.h.
Referenced by combineInstructionsOverFunction(), unpackLoadToAggregate(), and unpackStoreToAggregate().
InstCombineWorklist& llvm::InstCombiner::Worklist |
A worklist of the instructions that need to be simplified.
Definition at line 286 of file InstCombineInternal.h.
Referenced by getShiftedValue(), and processUMulZExtIdiom().