LLVM API Documentation

DAGCombiner.cpp File Reference

#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>

Include dependency graph for DAGCombiner.cpp:

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 Documentation

#define DEBUG_TYPE   "dagcombine"

Definition at line 15 of file DAGCombiner.cpp.


Function Documentation

static SDValue combineSelectAndUse ( SDNode *  N,
SDValue  Slct,
SDValue  OtherOp,
SelectionDAG &  DAG,
const TargetLowering &  TLI,
bool  LegalOperations 
) [static]

static SDValue combineShlAddConstant ( DebugLoc  DL,
SDValue  N0,
SDValue  N1,
SelectionDAG &  DAG 
) [static]

static bool ExtendUsesToFormExtLoad ( SDNode *  N,
SDValue  N0,
unsigned  ExtOpc,
SmallVector< SDNode *, 4 > &  ExtendNodes,
const TargetLowering &  TLI 
) [static]

static bool FindBaseOffset ( SDValue  Ptr,
SDValue &  Base,
int64_t &  Offset 
) [static]

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().

static SDNode* getBuildPairElt ( SDNode *  N,
unsigned  i 
) [static]

static SDValue getInputChainForNode ( SDNode *  N  )  [static]

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]

static unsigned InferAlignment ( SDValue  Ptr,
SelectionDAG &  DAG 
) [static]

static char isNegatibleForFree ( SDValue  Op,
bool  LegalOperations,
unsigned  Depth = 0 
) [static]

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]

static bool isSetCCEquivalent ( SDValue  N,
SDValue &  LHS,
SDValue &  RHS,
SDValue &  CC 
) [static]

static bool MatchRotateHalf ( SDValue  Op,
SDValue &  Shift,
SDValue &  Mask 
) [static]

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"   
)


Variable Documentation

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]

DAGCombiner& DC

Definition at line 271 of file DAGCombiner.cpp.

bool Fast

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.

Definition at line 52 of file DAGCombiner.cpp.

std::vector<SDNode*> WorkList