LLVM API Documentation
#include "llvm/CodeGen/SelectionDAG.h"#include "llvm/DerivedTypes.h"#include "llvm/LLVMContext.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/PseudoSourceValue.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/ErrorHandling.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") | |
| STATISTIC (OpsNarrowed,"Number of load/op/store narrowed") | |
| 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 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 19 of file DAGCombiner.cpp.
| static SDValue combineShlAddConstant | ( | DebugLoc | DL, | |
| SDValue | N0, | |||
| SDValue | N1, | |||
| SelectionDAG & | DAG | |||
| ) | [static] |
Definition at line 941 of file DAGCombiner.cpp.
References llvm::X86ISD::ADD, llvm::dyn_cast(), llvm::SDValue::getDebugLoc(), llvm::SDValue::getNode(), llvm::SelectionDAG::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 2908 of file DAGCombiner.cpp.
References llvm::ISD::ANY_EXTEND, llvm::ISD::CopyToReg, llvm::SDValue::getNode(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SDUse::getResNo(), llvm::SDValue::getResNo(), llvm::SDUse::getUser(), 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 6072 of file DAGCombiner.cpp.
References llvm::X86ISD::ADD, llvm::CallingConv::C, llvm::SDValue::getOpcode(), and llvm::SDValue::getOperand().
Definition at line 3660 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 834 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 387 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_unreachable, 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 4802 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 331 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().
Definition at line 491 of file DAGCombiner.cpp.
References llvm::SDValue::getNode(), llvm::SDNode::hasOneUse(), and isSetCCEquivalent().
Definition at line 467 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 2047 of file DAGCombiner.cpp.
References llvm::ISD::AND, llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::PPCISD::SHL, and llvm::PPCISD::SRL.
| STATISTIC | ( | OpsNarrowed | , | |
| "Number of load/op/store narrowed" | ||||
| ) |
| 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 71 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 60 of file DAGCombiner.cpp.
Referenced by llvm::SPUTargetLowering::PerformDAGCombine(), and llvm::TargetLowering::SimplifySetCC().
| DAGCombiner& DC |
Definition at line 281 of file DAGCombiner.cpp.
Definition at line 64 of file DAGCombiner.cpp.
Definition at line 65 of file DAGCombiner.cpp.
Definition at line 62 of file DAGCombiner.cpp.
Definition at line 63 of file DAGCombiner.cpp.
| const TargetLowering& TLI |
Definition at line 61 of file DAGCombiner.cpp.
Definition at line 68 of file DAGCombiner.cpp.
Referenced by AddBlockAndPredsToSet(), llvm::MachOWriter::InitMem(), llvm::LiveVariables::MarkVirtRegAliveInBlock(), llvm::SUnit::setDepthDirty(), and llvm::SUnit::setHeightDirty().