|
LLVM
5.0.0
|
#include "llvm/ADT/SetVector.h"#include "llvm/ADT/SmallBitVector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/SelectionDAG.h"#include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"#include "llvm/CodeGen/SelectionDAGTargetInfo.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/LLVMContext.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/KnownBits.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetLowering.h"#include "llvm/Target/TargetOptions.h"#include "llvm/Target/TargetRegisterInfo.h"#include "llvm/Target/TargetSubtargetInfo.h"#include <algorithm>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "dagcombine" |
Functions | |
| STATISTIC (NodesCombined,"Number of dag nodes combined") | |
| STATISTIC (PreIndexedNodes,"Number of pre-indexed nodes created") | |
| STATISTIC (PostIndexedNodes,"Number of post-indexed nodes created") | |
| STATISTIC (OpsNarrowed,"Number of load/op/store narrowed") | |
| STATISTIC (LdStFP2Int,"Number of fp load/store pairs transformed to int") | |
| STATISTIC (SlicedLoads,"Number of load sliced") | |
| static char | isNegatibleForFree (SDValue Op, bool LegalOperations, const TargetLowering &TLI, const TargetOptions *Options, unsigned Depth=0) |
| Return 1 if we can compute the negated form of the specified expression for the same cost as the expression itself, or 2 if we can compute the negated form more cheaply than the expression itself. More... | |
| static SDValue | GetNegatedExpression (SDValue Op, SelectionDAG &DAG, bool LegalOperations, unsigned Depth=0) |
| If isNegatibleForFree returns true, return the newly negated expression. More... | |
| static void | zeroExtendToMatch (APInt &LHS, APInt &RHS, unsigned Offset=0) |
| static SDNode * | isConstantFPBuildVectorOrConstantFP (SDValue N) |
| static bool | isConstantOrConstantVector (SDValue N, bool NoOpaques=false) |
| static bool | isNullConstantOrNullSplatConstant (SDValue N) |
| static bool | isOneConstantOrOneSplatConstant (SDValue N) |
| static bool | isAllOnesConstantOrAllOnesSplatConstant (SDValue N) |
| static bool | isAnyConstantBuildVector (const SDNode *N) |
| static SDValue | getInputChainForNode (SDNode *N) |
| Given a node, return its input chain if it has one, otherwise return a null sd operand. More... | |
| static ConstantSDNode * | getAsNonOpaqueConstant (SDValue N) |
If N is a ConstantSDNode with isOpaque() == false return it casted to a ConstantSDNode pointer else nullptr. More... | |
| static SDValue | getAsCarry (const TargetLowering &TLI, SDValue V) |
| static SDValue | tryFoldToZero (const SDLoc &DL, const TargetLowering &TLI, EVT VT, SelectionDAG &DAG, bool LegalOperations, bool LegalTypes) |
| static bool | isDivRemLibcallAvailable (SDNode *Node, bool isSigned, const TargetLowering &TLI) |
| Return true if divmod libcall is available. More... | |
| static SDValue | simplifyDivRem (SDNode *N, SelectionDAG &DAG) |
| static bool | isBSwapHWordElement (SDValue N, MutableArrayRef< SDNode * > Parts) |
| Return true if the specified node is an element that makes up a 32-bit packed halfword byteswap. More... | |
| static bool | matchRotateSub (SDValue Pos, SDValue Neg, unsigned EltSize) |
| static bool | sumMatchConstant (SDValue Left, SDValue Right, unsigned Sum, SelectionDAG &DAG, const SDLoc &DL) |
| static SDValue | combineMinNumMaxNum (const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode CC, const TargetLowering &TLI, SelectionDAG &DAG) |
| Generate Min/Max node. More... | |
| static std::pair< SDValue, SDValue > | SplitVSETCC (const SDNode *N, SelectionDAG &DAG) |
| static SDValue | ConvertSelectToConcatVector (SDNode *N, SelectionDAG &DAG) |
| static SDNode * | tryToFoldExtendOfConstant (SDNode *N, const TargetLowering &TLI, SelectionDAG &DAG, bool LegalTypes, bool LegalOperations) |
| Try to fold a sext/zext/aext dag node into a ConstantSDNode or a build_vector of constants. More... | |
| static bool | ExtendUsesToFormExtLoad (SDNode *N, SDValue N0, unsigned ExtOpc, SmallVectorImpl< SDNode * > &ExtendNodes, const TargetLowering &TLI) |
| static bool | isTruncateOf (SelectionDAG &DAG, SDValue N, SDValue &Op, KnownBits &Known) |
| static SDNode * | getBuildPairElt (SDNode *N, unsigned i) |
| static unsigned | getPPCf128HiElementSelector (const SelectionDAG &DAG) |
| static SDValue | foldBitcastedFPLogic (SDNode *N, SelectionDAG &DAG, const TargetLowering &TLI) |
| static bool | isContractable (SDNode *N) |
| static bool | isFMulNegTwo (SDValue &N) |
| static bool | CanCombineFCOPYSIGN_EXTEND_ROUND (SDNode *N) |
| copysign(x, fp_extend(y)) -> copysign(x, y) copysign(x, fp_round(y)) -> copysign(x, y) More... | |
| static SDValue | FoldIntToFPToInt (SDNode *N, SelectionDAG &DAG) |
| static bool | canFoldInAddressingMode (SDNode *N, SDNode *Use, SelectionDAG &DAG, const TargetLowering &TLI) |
| Return true if 'Use' is a load or a store that uses N as its base pointer and that N may be folded in the load / store addressing mode. More... | |
| static bool | areUsedBitsDense (const APInt &UsedBits) |
Check that all bits set in UsedBits form a dense region, i.e., UsedBits looks like 0..0 1..1 0..0. More... | |
| static bool | areSlicesNextToEachOther (const LoadedSlice &First, const LoadedSlice &Second) |
Check whether or not First and Second are next to each other in memory. More... | |
| static void | adjustCostForPairing (SmallVectorImpl< LoadedSlice > &LoadedSlices, LoadedSlice::Cost &GlobalLSCost) |
Adjust the GlobalLSCost according to the target paring capabilities and the layout of the slices. More... | |
| static bool | isSlicingProfitable (SmallVectorImpl< LoadedSlice > &LoadedSlices, const APInt &UsedBits, bool ForCodeSize) |
| Check the profitability of all involved LoadedSlice. More... | |
| static std::pair< unsigned, unsigned > | CheckForMaskedLoad (SDValue V, SDValue Ptr, SDValue Chain) |
| Check to see if V is (and load (ptr), imm), where the load is having specific bytes cleared out. More... | |
| static SDNode * | ShrinkLoadReplaceStoreWithStore (const std::pair< unsigned, unsigned > &MaskInfo, SDValue IVal, StoreSDNode *St, DAGCombiner *DC) |
| Check to see if IVal is something that provides a value as specified by MaskInfo. More... | |
| static SDValue | combineConcatVectorOfScalars (SDNode *N, SelectionDAG &DAG) |
| static SDValue | combineConcatVectorOfExtracts (SDNode *N, SelectionDAG &DAG) |
| static SDValue | narrowExtractedVectorBinOp (SDNode *Extract, SelectionDAG &DAG) |
| If we are extracting a subvector produced by a wide binary operator with at at least one operand that was the result of a vector concatenation, then try to use the narrow vector operands directly to avoid the concatenation and extraction. More... | |
| static SDValue | narrowExtractedVectorLoad (SDNode *Extract, SelectionDAG &DAG) |
| If we are extracting a subvector from a wide vector load, convert to a narrow load to eliminate the extraction: (extract_subvector (load wide vector)) –> (load narrow vector) More... | |
| static SDValue | simplifyShuffleOperandRecursively (SmallBitVector &UsedElements, SDValue V, SelectionDAG &DAG) |
| static SDValue | simplifyShuffleOperands (ShuffleVectorSDNode *SVN, SDValue N0, SDValue N1, SelectionDAG &DAG) |
| static SDValue | partitionShuffleOfConcats (SDNode *N, SelectionDAG &DAG) |
| static SDValue | combineShuffleOfScalars (ShuffleVectorSDNode *SVN, SelectionDAG &DAG, const TargetLowering &TLI) |
| static SDValue | combineShuffleToVectorExtend (ShuffleVectorSDNode *SVN, SelectionDAG &DAG, const TargetLowering &TLI, bool LegalOperations) |
| static SDValue | combineTruncationShuffle (ShuffleVectorSDNode *SVN, SelectionDAG &DAG) |
| static SDValue | combineShuffleOfSplat (ArrayRef< int > UserMask, ShuffleVectorSDNode *Splat, SelectionDAG &DAG) |
| static bool | findBaseOffset (SDValue Ptr, SDValue &Base, int64_t &Offset, const GlobalValue *&GV, const void *&CV) |
| Return true if base is a frame index, which is known not to alias with anything but itself. More... | |
| #define DEBUG_TYPE "dagcombine" |
Definition at line 47 of file DAGCombiner.cpp.
|
static |
Adjust the GlobalLSCost according to the target paring capabilities and the layout of the slices.
GlobalLSCost should account for at least as many loads as there is in the slices in LoadedSlices. Definition at line 11785 of file DAGCombiner.cpp.
References areSlicesNextToEachOther(), assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::parallel::sort().
Referenced by isSlicingProfitable().
|
static |
Check whether or not First and Second are next to each other in memory.
This means that there is no hole between the bits loaded by First and the bits loaded by Second.
Definition at line 11770 of file DAGCombiner.cpp.
References areUsedBitsDense(), and assert().
Referenced by adjustCostForPairing().
Check that all bits set in UsedBits form a dense region, i.e., UsedBits looks like 0..0 1..1 0..0.
Definition at line 11753 of file DAGCombiner.cpp.
References llvm::APInt::countLeadingZeros(), llvm::APInt::countTrailingZeros(), llvm::APInt::getActiveBits(), llvm::APInt::isAllOnesValue(), llvm::APInt::lshr(), and llvm::APInt::trunc().
Referenced by areSlicesNextToEachOther(), and isSlicingProfitable().
copysign(x, fp_extend(y)) -> copysign(x, y) copysign(x, fp_round(y)) -> copysign(x, y)
Definition at line 10196 of file DAGCombiner.cpp.
References llvm::MVT::f128, llvm::ISD::FP_EXTEND, llvm::ISD::FP_ROUND, llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), and llvm::SDNode::getValueType().
|
static |
Return true if 'Use' is a load or a store that uses N as its base pointer and that N may be folded in the load / store addressing mode.
Definition at line 10896 of file DAGCombiner.cpp.
References llvm::ISD::ADD, llvm::dyn_cast(), llvm::MemSDNode::getAddressSpace(), llvm::LoadSDNode::getBasePtr(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::MemSDNode::getMemoryVT(), llvm::SDValue::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::ConstantSDNode::getSExtValue(), llvm::EVT::getTypeForEVT(), llvm::LSBaseSDNode::isIndexed(), llvm::TargetLoweringBase::isLegalAddressingMode(), N, llvm::ARM_MB::ST, and llvm::ISD::SUB.
|
static |
Check to see if V is (and load (ptr), imm), where the load is having specific bytes cleared out.
If so, return the byte size being masked out and the shift amount.
Definition at line 11993 of file DAGCombiner.cpp.
References llvm::ISD::AND, llvm::countLeadingZeros(), llvm::countTrailingOnes(), llvm::countTrailingZeros(), llvm::LoadSDNode::getBasePtr(), llvm::SDValue::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getValueSizeInBits(), llvm::SDValue::getValueType(), llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::ISD::isNormalLoad(), llvm::ARM_MB::LD, llvm::SDNode::op_values(), Ptr, and llvm::ISD::TokenFactor.
|
static |
Definition at line 14506 of file DAGCombiner.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::ISD::BITCAST, llvm::ISD::EXTRACT_SUBVECTOR, llvm::SelectionDAG::getBitcast(), llvm::SDValue::getConstantOperandVal(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), llvm::TargetLoweringBase::isShuffleMaskLegal(), llvm::SDValue::isUndef(), llvm::BitmaskEnumDetail::Mask(), llvm::SDNode::ops(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
|
static |
Definition at line 14441 of file DAGCombiner.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), llvm::ISD::BITCAST, llvm::DL, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getContext(), llvm::EVT::getFloatingPointVT(), llvm::EVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorVT(), llvm::EVT::isFloatingPoint(), llvm::EVT::isInteger(), llvm::TargetLoweringBase::isTypeLegal(), llvm::SDValue::isUndef(), llvm::EVT::isVector(), llvm::SDNode::ops(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::ISD::UNDEF.
|
static |
Generate Min/Max node.
Definition at line 6013 of file DAGCombiner.cpp.
References llvm::ISD::FMAXNUM, llvm::ISD::FMINNUM, llvm::SelectionDAG::getNode(), llvm::TargetLoweringBase::isOperationLegal(), llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, and llvm::ISD::SETULT.
|
static |
Definition at line 15096 of file DAGCombiner.cpp.
References llvm::EVT::bitsLT(), llvm::ISD::BUILD_VECTOR, llvm::SelectionDAG::getBuildVector(), llvm::ShuffleVectorSDNode::getMask(), llvm::SDValue::getNode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::EVT::getScalarType(), llvm::SelectionDAG::getSExtOrTrunc(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::SDNode::hasOneUse(), llvm::SmallSet< T, N, C >::insert(), isAnyConstantBuildVector(), llvm::ISD::isBuildVectorAllZeros(), llvm::EVT::isInteger(), llvm::SDValue::isUndef(), llvm::TargetLoweringBase::isZExtFree(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::ISD::SCALAR_TO_VECTOR.
|
static |
Definition at line 15275 of file DAGCombiner.cpp.
References assert(), llvm::ShuffleVectorSDNode::getMask(), llvm::SDNode::getOperand(), llvm::SDNode::getValueType(), llvm::SelectionDAG::getVectorShuffle(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 15162 of file DAGCombiner.cpp.
References llvm::ISD::ANY_EXTEND_VECTOR_INREG, llvm::SelectionDAG::getAnyExtendVectorInReg(), llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::EVT::getIntegerVT(), llvm::ShuffleVectorSDNode::getMask(), llvm::SDNode::getOperand(), llvm::EVT::getScalarSizeInBits(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::EVT::getVectorVT(), llvm::DataLayout::isBigEndian(), llvm::EVT::isInteger(), llvm::TargetLoweringBase::isOperationLegalOrCustom(), and llvm::BitmaskEnumDetail::Mask().
|
static |
Definition at line 15212 of file DAGCombiner.cpp.
References llvm::ISD::ANY_EXTEND_VECTOR_INREG, llvm::ISD::BITCAST, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getDataLayout(), llvm::ShuffleVectorSDNode::getMask(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::EVT::getScalarSizeInBits(), llvm::SDValue::getScalarValueSizeInBits(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::DataLayout::isBigEndian(), llvm::EVT::isInteger(), llvm::BitmaskEnumDetail::Mask(), llvm::ISD::SIGN_EXTEND_VECTOR_INREG, and llvm::ISD::ZERO_EXTEND_VECTOR_INREG.
|
static |
Definition at line 6320 of file DAGCombiner.cpp.
References assert(), llvm::ISD::BUILD_VECTOR, llvm::ISD::CONCAT_VECTORS, llvm::DL, llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getNumOperands(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::ConstantSDNode::isNullValue(), and llvm::SDNode::isUndef().
|
static |
Definition at line 6873 of file DAGCombiner.cpp.
References llvm::ISD::ANY_EXTEND, llvm::ISD::CopyToReg, llvm::SDValue::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getResNo(), llvm::SDUse::getResNo(), llvm::SDUse::getUser(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::ISD::isSignedIntSetCC(), llvm::TargetLoweringBase::isTruncateFree(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::ISD::SETCC, llvm::SmallVectorTemplateCommon< T >::size(), llvm::SDNode::use_begin(), llvm::SDNode::use_end(), and llvm::ISD::ZERO_EXTEND.
|
static |
Return true if base is a frame index, which is known not to alias with anything but itself.
Provides base object and offset as results.
Definition at line 16711 of file DAGCombiner.cpp.
References llvm::ISD::ADD, G, llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getSExtValue(), and Ptr.
|
static |
Definition at line 8495 of file DAGCombiner.cpp.
References llvm::ISD::AND, llvm::ISD::BITCAST, llvm::dyn_cast(), llvm::ISD::FABS, llvm::ISD::FNEG, llvm::ConstantSDNode::getAPIntValue(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::APInt::getSignMask(), llvm::EVT::getSizeInBits(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::TargetLoweringBase::hasBitPreservingFPLogic(), llvm::EVT::isFloatingPoint(), llvm::EVT::isVector(), and llvm::ISD::XOR.
|
static |
Definition at line 10353 of file DAGCombiner.cpp.
References llvm::SelectionDAG::EVTToAPFloatSemantics(), llvm::ISD::FP_TO_SINT, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::EVT::getScalarSizeInBits(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), fuzzer::min(), llvm::APFloatBase::semanticsPrecision(), llvm::ISD::SIGN_EXTEND, llvm::ISD::SINT_TO_FP, llvm::ISD::TRUNCATE, llvm::ISD::UINT_TO_FP, and llvm::ISD::ZERO_EXTEND.
|
static |
Definition at line 1986 of file DAGCombiner.cpp.
References llvm::ISD::ADDCARRY, llvm::ISD::AND, llvm::TargetLoweringBase::getBooleanContents(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getResNo(), llvm::SDValue::getValueType(), llvm::isOneConstant(), llvm::ISD::SUBCARRY, llvm::ISD::TRUNCATE, llvm::ISD::UADDO, llvm::ISD::USUBO, llvm::ISD::ZERO_EXTEND, and llvm::TargetLoweringBase::ZeroOrOneBooleanContent.
|
static |
If N is a ConstantSDNode with isOpaque() == false return it casted to a ConstantSDNode pointer else nullptr.
Definition at line 1788 of file DAGCombiner.cpp.
References llvm::dyn_cast(), llvm::ConstantSDNode::isOpaque(), and N.
Definition at line 8455 of file DAGCombiner.cpp.
References llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::SDValue::getResNo(), and llvm::ISD::MERGE_VALUES.
Given a node, return its input chain if it has one, otherwise return a null sd operand.
Definition at line 1597 of file DAGCombiner.cpp.
References llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), llvm::SDValue::getValueType(), and llvm::MVT::Other.
|
static |
If isNegatibleForFree returns true, return the newly negated expression.
Definition at line 684 of file DAGCombiner.cpp.
References assert(), llvm::APFloat::changeSign(), llvm::ISD::ConstantFP, llvm::Depth, llvm::ISD::FADD, llvm::ISD::FDIV, Flags, llvm::ISD::FMUL, llvm::ISD::FNEG, llvm::ISD::FP_EXTEND, llvm::ISD::FP_ROUND, llvm::ISD::FSIN, llvm::ISD::FSUB, llvm::SelectionDAG::getConstantFP(), llvm::SDNode::getFlags(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getTarget(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueType(), llvm::SDValue::hasOneUse(), llvm::TargetOptions::HonorSignDependentRoundingFPMath(), isNegatibleForFree(), llvm_unreachable(), llvm::TargetMachine::Options, and llvm::TargetOptions::UnsafeFPMath.
|
static |
Definition at line 8489 of file DAGCombiner.cpp.
References llvm::SelectionDAG::getDataLayout(), and llvm::DataLayout::isBigEndian().
Definition at line 861 of file DAGCombiner.cpp.
References llvm::SDValue::getScalarValueSizeInBits(), and llvm::isConstOrConstSplat().
Definition at line 871 of file DAGCombiner.cpp.
References llvm::ISD::isBuildVectorOfConstantFPSDNodes(), and llvm::ISD::isBuildVectorOfConstantSDNodes().
Referenced by combineShuffleOfScalars().
|
static |
Return true if the specified node is an element that makes up a 32-bit packed halfword byteswap.
((x & 0x000000ff) << 8) | ((x & 0x0000ff00) >> 8) | ((x & 0x00ff0000) << 8) | ((x & 0xff000000) >> 8)
Definition at line 4078 of file DAGCombiner.cpp.
References llvm::ISD::AND, C, llvm::dyn_cast(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ConstantSDNode::getZExtValue(), llvm::SDNode::hasOneUse(), llvm::ISD::SHL, and llvm::ISD::SRL.
Definition at line 811 of file DAGCombiner.cpp.
References llvm::SDValue::getNode(), and llvm::ISD::isBuildVectorOfConstantFPSDNodes().
Definition at line 822 of file DAGCombiner.cpp.
References llvm::ISD::BUILD_VECTOR, llvm::dyn_cast(), llvm::ConstantSDNode::getAPIntValue(), llvm::APInt::getBitWidth(), llvm::SDValue::getOpcode(), llvm::SDValue::getScalarValueSizeInBits(), llvm::ConstantSDNode::isOpaque(), llvm::SDValue::isUndef(), and llvm::SDNode::op_values().
Definition at line 8913 of file DAGCombiner.cpp.
References F, llvm::SDNode::getFlags(), llvm::SDNodeFlags::hasAllowContract(), and llvm::SDNodeFlags::hasUnsafeAlgebra().
|
static |
Return true if divmod libcall is available.
Definition at line 2654 of file DAGCombiner.cpp.
References llvm::TargetLoweringBase::getLibcallName(), llvm::EVT::getSimpleVT(), llvm::SDNode::getValueType(), llvm::MVT::i128, llvm::MVT::i16, llvm::MVT::i32, llvm::MVT::i64, llvm::MVT::i8, llvm::EVT::isSimple(), llvm::RTLIB::SDIVREM_I128, llvm::RTLIB::SDIVREM_I16, llvm::RTLIB::SDIVREM_I32, llvm::RTLIB::SDIVREM_I64, llvm::RTLIB::SDIVREM_I8, llvm::MVT::SimpleTy, llvm::RTLIB::UDIVREM_I128, llvm::RTLIB::UDIVREM_I16, llvm::RTLIB::UDIVREM_I32, llvm::RTLIB::UDIVREM_I64, and llvm::RTLIB::UDIVREM_I8.
Definition at line 9492 of file DAGCombiner.cpp.
References llvm::ISD::FMUL, llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), and llvm::isConstOrConstSplatFP().
|
static |
Return 1 if we can compute the negated form of the specified expression for the same cost as the expression itself, or 2 if we can compute the negated form more cheaply than the expression itself.
Definition at line 613 of file DAGCombiner.cpp.
References llvm::ISD::ConstantFP, llvm::Depth, llvm::ISD::FADD, llvm::ISD::FDIV, llvm::ISD::FMUL, llvm::ISD::FNEG, llvm::ISD::FP_EXTEND, llvm::ISD::FP_ROUND, llvm::ISD::FSIN, llvm::ISD::FSUB, llvm::SDNode::getFlags(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueType(), llvm::SDNodeFlags::hasNoSignedZeros(), llvm::SDValue::hasOneUse(), llvm::TargetLoweringBase::isFPImmLegal(), llvm::TargetLoweringBase::isOperationLegal(), llvm::TargetLoweringBase::isOperationLegalOrCustom(), llvm::neg(), and llvm::TargetOptions::UnsafeFPMath.
Referenced by GetNegatedExpression().
Definition at line 842 of file DAGCombiner.cpp.
References llvm::isConstOrConstSplat().
Definition at line 851 of file DAGCombiner.cpp.
References llvm::SDValue::getScalarValueSizeInBits(), and llvm::isConstOrConstSplat().
|
static |
Check the profitability of all involved LoadedSlice.
Currently, it is considered profitable if there is exactly two involved slices (1) which are (2) next to each other in memory, and whose cost (
Note: The order of the elements in LoadedSlices may be modified, but not the elements themselves.
FIXME: When the cost model will be mature enough, we can relax constraints (1) and (2).
Definition at line 11853 of file DAGCombiner.cpp.
References adjustCostForPairing(), areUsedBitsDense(), and llvm::SmallVectorTemplateCommon< T >::size().
|
static |
Definition at line 7339 of file DAGCombiner.cpp.
References assert(), llvm::SelectionDAG::computeKnownBits(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::MVT::i1, llvm::isNullConstant(), llvm::ISD::SETCC, llvm::ISD::SETNE, llvm::ISD::TRUNCATE, and llvm::KnownBits::Zero.
Definition at line 4476 of file DAGCombiner.cpp.
References llvm::ISD::ADD, llvm::ISD::AND, llvm::ConstantSDNode::getAPIntValue(), llvm::APInt::getLoBits(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::isConstOrConstSplat(), llvm::isPowerOf2_64(), llvm::Log2_64(), and llvm::ISD::SUB.
|
static |
If we are extracting a subvector produced by a wide binary operator with at at least one operand that was the result of a vector concatenation, then try to use the narrow vector operands directly to avoid the concatenation and extraction.
Definition at line 14743 of file DAGCombiner.cpp.
References llvm::ISD::AND, assert(), llvm::ISD::BITCAST, llvm::ISD::CONCAT_VECTORS, llvm::DL, llvm::dyn_cast(), llvm::ISD::EXTRACT_SUBVECTOR, llvm::SelectionDAG::getBitcast(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getNode(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::EVT::getScalarType(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueSizeInBits(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::EVT::getVectorVT(), llvm::EVT::isVector(), llvm::ISD::OR, and llvm::ISD::XOR.
|
static |
If we are extracting a subvector from a wide vector load, convert to a narrow load to eliminate the extraction: (extract_subvector (load wide vector)) –> (load narrow vector)
Definition at line 14835 of file DAGCombiner.cpp.
References llvm::DL, llvm::dyn_cast(), llvm::MemSDNode::getChain(), llvm::SelectionDAG::getDataLayout(), llvm::LoadSDNode::getExtensionType(), llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getMachineFunction(), llvm::MachineFunction::getMachineMemOperand(), llvm::SelectionDAG::getMemBasePlusOffset(), llvm::MemSDNode::getMemOperand(), llvm::SDNode::getOperand(), llvm::EVT::getScalarType(), llvm::EVT::getStoreSize(), llvm::SDNode::getValueType(), llvm::SDNode::hasOneUse(), llvm::DataLayout::isBigEndian(), llvm::MemSDNode::isVolatile(), and llvm::SelectionDAG::makeEquivalentMemoryOrdering().
|
static |
Definition at line 15018 of file DAGCombiner.cpp.
References llvm::all_of(), llvm::ISD::CONCAT_VECTORS, llvm::ShuffleVectorSDNode::getMask(), llvm::ShuffleVectorSDNode::getMaskElt(), llvm::SelectionDAG::getNode(), llvm::SDValue::getNumOperands(), llvm::SDValue::getOperand(), llvm::SDNode::getOperand(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), I, llvm::SDValue::isUndef(), llvm::makeArrayRef(), and N.
|
static |
Check to see if IVal is something that provides a value as specified by MaskInfo.
If so, replace the specified store with a narrower store of truncated IVal.
Definition at line 12068 of file DAGCombiner.cpp.
References llvm::ISD::ADD, llvm::DL, llvm::MemSDNode::getAlignment(), llvm::StoreSDNode::getBasePtr(), llvm::MemSDNode::getChain(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getDataLayout(), llvm::MVT::getIntegerVT(), llvm::SelectionDAG::getNode(), llvm::MemSDNode::getPointerInfo(), llvm::SelectionDAG::getStore(), llvm::EVT::getStoreSize(), llvm::SDValue::getValueSizeInBits(), llvm::SDValue::getValueType(), llvm::MachinePointerInfo::getWithOffset(), llvm::DataLayout::isLittleEndian(), llvm::SelectionDAG::MaskedValueIsZero(), llvm::MinAlign(), Ptr, llvm::ISD::SRL, and llvm::ISD::TRUNCATE.
|
static |
Definition at line 2742 of file DAGCombiner.cpp.
References llvm::DL, llvm::SelectionDAG::getConstant(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SelectionDAG::getUNDEF(), llvm::SDNode::getValueType(), llvm::SDValue::isUndef(), and llvm::SelectionDAG::isUndef().
|
static |
Definition at line 14930 of file DAGCombiner.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), llvm::ISD::CONCAT_VECTORS, llvm::DL, llvm::dyn_cast(), llvm::SelectionDAG::getNode(), llvm::SDNode::getNumOperands(), llvm::SDValue::getOpcode(), llvm::SDNode::getOperand(), llvm::SelectionDAG::getUNDEF(), llvm::SDValue::getValueType(), llvm::EVT::getVectorNumElements(), llvm::ISD::INSERT_SUBVECTOR, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and llvm::SmallBitVector::reset().
Referenced by simplifyShuffleOperands().
|
static |
Definition at line 14997 of file DAGCombiner.cpp.
References llvm::ShuffleVectorSDNode::getMask(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::SelectionDAG::getVectorShuffle(), and simplifyShuffleOperandRecursively().
|
static |
Definition at line 6302 of file DAGCombiner.cpp.
References llvm::DL, llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SelectionDAG::GetSplitDestVTs(), llvm::SDNode::getValueType(), llvm::MipsISD::Hi, llvm::MipsISD::Lo, and llvm::SelectionDAG::SplitVectorOperand().
| STATISTIC | ( | NodesCombined | , |
| "Number of dag nodes combined" | |||
| ) |
| STATISTIC | ( | PreIndexedNodes | , |
| "Number of pre-indexed nodes created" | |||
| ) |
| STATISTIC | ( | PostIndexedNodes | , |
| "Number of post-indexed nodes created" | |||
| ) |
| STATISTIC | ( | OpsNarrowed | , |
| "Number of load/op/store narrowed" | |||
| ) |
| STATISTIC | ( | LdStFP2Int | , |
| "Number of fp load/store pairs transformed to int" | |||
| ) |
| STATISTIC | ( | SlicedLoads | , |
| "Number of load sliced" | |||
| ) |
|
static |
Definition at line 4597 of file DAGCombiner.cpp.
References llvm::ISD::ADD, llvm::SelectionDAG::FoldConstantArithmetic(), llvm::SDValue::getNode(), llvm::SDValue::getValueType(), llvm::ConstantSDNode::getZExtValue(), and llvm::isConstOrConstSplat().
|
static |
Definition at line 2277 of file DAGCombiner.cpp.
References llvm::ISD::BUILD_VECTOR, llvm::SelectionDAG::getConstant(), llvm::TargetLoweringBase::isOperationLegal(), and llvm::EVT::isVector().
|
static |
Try to fold a sext/zext/aext dag node into a ConstantSDNode or a build_vector of constants.
This function is called by the DAGCombiner when visiting sext/zext/aext dag nodes (see for example method DAGCombiner::visitSIGN_EXTEND). Vector extends are not folded if operations are legal; this is to avoid introducing illegal build_vector dag nodes.
Definition at line 6815 of file DAGCombiner.cpp.
References llvm::ISD::ANY_EXTEND, assert(), C, llvm::DL, llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::EVT::getScalarSizeInBits(), llvm::EVT::getScalarType(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getUNDEF(), llvm::SDNode::getValueType(), llvm::EVT::getVectorNumElements(), llvm::ISD::isBuildVectorOfConstantSDNodes(), llvm::TargetLoweringBase::isTypeLegal(), llvm::SDNode::isUndef(), llvm::EVT::isVector(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::APInt::sext(), llvm::ISD::SIGN_EXTEND, llvm::ISD::SIGN_EXTEND_VECTOR_INREG, llvm::ISD::ZERO_EXTEND, llvm::ISD::ZERO_EXTEND_VECTOR_INREG, and llvm::APInt::zext().
Definition at line 764 of file DAGCombiner.cpp.
References llvm::tgtok::Bits, llvm::APInt::getBitWidth(), llvm::max(), and llvm::APInt::zextOrSelf().
1.8.6