LLVM API Documentation
#include "llvm/CodeGen/SelectionDAG.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Target/TargetData.h"#include "llvm/Target/TargetFrameInfo.h"#include "llvm/Target/TargetLowering.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetOptions.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/Statistic.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/MathExtras.h"#include <algorithm>#include <set>
Go to the source code of this file.
Defines | |
| #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") | |
| static char | isNegatibleForFree (SDValue Op, bool LegalOperations, unsigned Depth=0) |
| static SDValue | GetNegatedExpression (SDValue Op, SelectionDAG &DAG, bool LegalOperations, unsigned Depth=0) |
| static bool | isSetCCEquivalent (SDValue N, SDValue &LHS, SDValue &RHS, SDValue &CC) |
| static bool | isOneUseSetCC (SDValue N) |
| static SDValue | getInputChainForNode (SDNode *N) |
| static SDValue | combineShlAddConstant (DebugLoc DL, SDValue N0, SDValue N1, SelectionDAG &DAG) |
| static SDValue | combineSelectAndUse (SDNode *N, SDValue Slct, SDValue OtherOp, SelectionDAG &DAG, const TargetLowering &TLI, bool LegalOperations) |
| static bool | MatchRotateHalf (SDValue Op, SDValue &Shift, SDValue &Mask) |
| MatchRotateHalf - Match "(X shl/srl V1) & V2" where V2 may not be present. | |
| static bool | ExtendUsesToFormExtLoad (SDNode *N, SDValue N0, unsigned ExtOpc, SmallVector< SDNode *, 4 > &ExtendNodes, const TargetLowering &TLI) |
| static SDNode * | getBuildPairElt (SDNode *N, unsigned i) |
| static unsigned | InferAlignment (SDValue Ptr, SelectionDAG &DAG) |
| static bool | FindBaseOffset (SDValue Ptr, SDValue &Base, int64_t &Offset) |
Variables | |
| static cl::opt< bool > | CombinerAA ("combiner-alias-analysis", cl::Hidden, cl::desc("Turn on alias analysis during testing")) |
| static cl::opt< bool > | CombinerGlobalAA ("combiner-global-alias-analysis", cl::Hidden, cl::desc("Include global information in alias analysis")) |
| #define DEBUG_TYPE "dagcombine" |
Definition at line 15 of file DAGCombiner.cpp.
| static SDValue combineSelectAndUse | ( | SDNode * | N, | |
| SDValue | Slct, | |||
| SDValue | OtherOp, | |||
| SelectionDAG & | DAG, | |||
| const TargetLowering & | TLI, | |||
| bool | LegalOperations | |||
| ) | [static] |
Definition at line 946 of file DAGCombiner.cpp.
References llvm::X86ISD::ADD, llvm::ISD::Constant, llvm::SDNode::getDebugLoc(), llvm::SDValue::getDebugLoc(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getOperand(), llvm::SelectionDAG::getSelectCC(), llvm::SelectionDAG::getSetCC(), llvm::ISD::getSetCCInverse(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::TargetLowering::isCondCodeLegal(), llvm::MVT::isInteger(), LHS, RHS, llvm::ISD::SELECT, llvm::ISD::SELECT_CC, llvm::X86ISD::SETCC, llvm::ISD::SETCC_INVALID, llvm::X86ISD::SUB, and std::swap().
| static SDValue combineShlAddConstant | ( | DebugLoc | DL, | |
| SDValue | N0, | |||
| SDValue | N1, | |||
| SelectionDAG & | DAG | |||
| ) | [static] |
Definition at line 924 of file DAGCombiner.cpp.
References llvm::X86ISD::ADD, llvm::dyn_cast(), llvm::SDValue::getDebugLoc(), llvm::SelectionDAG::getNode(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueType(), llvm::SDNode::hasOneUse(), and llvm::PPCISD::SHL.
| static bool ExtendUsesToFormExtLoad | ( | SDNode * | N, | |
| SDValue | N0, | |||
| unsigned | ExtOpc, | |||
| SmallVector< SDNode *, 4 > & | ExtendNodes, | |||
| const TargetLowering & | TLI | |||
| ) | [static] |
Definition at line 2948 of file DAGCombiner.cpp.
References llvm::ISD::CopyToReg, llvm::SDValue::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SDValue::getResNo(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::ISD::isSignedIntSetCC(), llvm::TargetLowering::isTruncateFree(), llvm::SmallVectorImpl< T >::push_back(), llvm::X86ISD::SETCC, llvm::SmallVectorImpl< T >::size(), llvm::SDNode::use_begin(), llvm::SDNode::use_end(), and llvm::ISD::ZERO_EXTEND.
FindBaseOffset - Return true if base is known not to alias with anything but itself. Provides base object and offset as results.
Definition at line 5921 of file DAGCombiner.cpp.
References llvm::X86ISD::ADD, llvm::CallingConv::C, llvm::SDValue::getOpcode(), and llvm::SDValue::getOperand().
Definition at line 3655 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.
getInputChainForNode - Given a node, return its input chain if it has one, otherwise return a null sd operand.
Definition at line 822 of file DAGCombiner.cpp.
References llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), and llvm::SDValue::getValueType().
| static SDValue GetNegatedExpression | ( | SDValue | Op, | |
| SelectionDAG & | DAG, | |||
| bool | LegalOperations, | |||
| unsigned | Depth = 0 | |||
| ) | [static] |
GetNegatedExpression - If isNegatibleForFree returns true, this function returns the newly negated expression.
Definition at line 377 of file DAGCombiner.cpp.
References llvm::APFloat::changeSign(), llvm::ISD::ConstantFP, 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::SelectionDAG::getConstantFP(), llvm::SDValue::getDebugLoc(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueType(), llvm::SDValue::hasOneUse(), llvm::HonorSignDependentRoundingFPMath(), isNegatibleForFree(), llvm::UnsafeFPMath, and V.
| static unsigned InferAlignment | ( | SDValue | Ptr, | |
| SelectionDAG & | DAG | |||
| ) | [static] |
InferAlignment - If we can infer some alignment information from this pointer, return it.
Definition at line 4724 of file DAGCombiner.cpp.
References llvm::X86ISD::ADD, FI, FrameIdx, llvm::SDValue::getConstantOperandVal(), llvm::TargetMachine::getFrameInfo(), llvm::MachineFunction::getFrameInfo(), llvm::SelectionDAG::getMachineFunction(), llvm::MachineFrameInfo::getObjectAlignment(), llvm::MachineFrameInfo::getObjectOffset(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::TargetFrameInfo::getStackAlignment(), llvm::SelectionDAG::getTarget(), llvm::MachineFrameInfo::isFixedObjectIndex(), and llvm::MinAlign().
isNegatibleForFree - 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 321 of file DAGCombiner.cpp.
References llvm::ISD::ConstantFP, 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::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::getValueType(), llvm::SDValue::hasOneUse(), llvm::HonorSignDependentRoundingFPMath(), llvm::MVT::ppcf128, llvm::UnsafeFPMath, and V.
Referenced by GetNegatedExpression().
| static bool isOneUseSetCC | ( | SDValue | N | ) | [static] |
Definition at line 481 of file DAGCombiner.cpp.
References llvm::SDValue::getNode(), llvm::SDNode::hasOneUse(), and isSetCCEquivalent().
Definition at line 457 of file DAGCombiner.cpp.
References llvm::ISD::Constant, llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::ISD::SELECT_CC, and llvm::ISD::SETCC.
Referenced by isOneUseSetCC().
MatchRotateHalf - Match "(X shl/srl V1) & V2" where V2 may not be present.
Definition at line 2099 of file DAGCombiner.cpp.
References llvm::ISD::AND, llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::PPCISD::SHL, and llvm::PPCISD::SRL.
| STATISTIC | ( | PostIndexedNodes | , | |
| "Number of post-indexed nodes created" | ||||
| ) |
| STATISTIC | ( | PreIndexedNodes | , | |
| "Number of pre-indexed nodes created" | ||||
| ) |
| STATISTIC | ( | NodesCombined | , | |
| "Number of dag nodes combined" | ||||
| ) |
Definition at line 62 of file DAGCombiner.cpp.
Referenced by llvm::AliasSet::mergeSetIn(), and llvm::SplitBlockPredecessors().
cl::opt<bool> CombinerAA("combiner-alias-analysis", cl::Hidden, cl::desc("Turn on alias analysis during testing")) [static] |
cl::opt<bool> CombinerGlobalAA("combiner-global-alias-analysis", cl::Hidden, cl::desc("Include global information in alias analysis")) [static] |
Definition at line 51 of file DAGCombiner.cpp.
Referenced by llvm::SPUTargetLowering::PerformDAGCombine(), and llvm::TargetLowering::SimplifySetCC().
| DAGCombiner& DC |
Definition at line 271 of file DAGCombiner.cpp.
| bool Fast |
Definition at line 56 of file DAGCombiner.cpp.
Referenced by ChangeCalleesToFastCall(), and llvm::X86TargetLowering::X86TargetLowering().
| bool LegalOperations |
Definition at line 54 of file DAGCombiner.cpp.
| bool LegalTypes |
Definition at line 55 of file DAGCombiner.cpp.
Definition at line 53 of file DAGCombiner.cpp.
| const TargetLowering& TLI |
Definition at line 52 of file DAGCombiner.cpp.
Definition at line 59 of file DAGCombiner.cpp.
Referenced by AddBlockAndPredsToSet(), llvm::MachOWriter::InitMem(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), llvm::SUnit::setDepthDirty(), and llvm::SUnit::setHeightDirty().