LLVM API Documentation

llvm::SelectionDAGISel Class Reference

#include <SelectionDAGISel.h>

Inheritance diagram for llvm::SelectionDAGISel:
[legend]
Collaboration diagram for llvm::SelectionDAGISel:
[legend]

List of all members.

Public Member Functions

 SelectionDAGISel (TargetMachine &tm, CodeGenOpt::Level OL=CodeGenOpt::Default)
virtual ~SelectionDAGISel ()
TargetLowering & getTargetLowering ()
virtual void getAnalysisUsage (AnalysisUsage &AU) const
virtual bool runOnMachineFunction (MachineFunction &MF)
unsigned MakeReg (EVT VT)
virtual void EmitFunctionEntryCode (Function &Fn, MachineFunction &MF)
virtual void InstructionSelect ()=0
void SelectRootInit ()
virtual bool SelectInlineAsmMemoryOperand (const SDValue &Op, char ConstraintCode, std::vector< SDValue > &OutOps)
virtual bool IsLegalAndProfitableToFold (SDNode *N, SDNode *U, SDNode *Root) const
virtual ScheduleHazardRecognizer * CreateTargetHazardRecognizer ()

Public Attributes

const TargetMachine & TM
TargetLowering & TLI
FunctionLoweringInfo * FuncInfo
MachineFunction * MF
MachineRegisterInfo * RegInfo
SelectionDAG * CurDAG
SelectionDAGLowering * SDL
MachineBasicBlock * BB
AliasAnalysis * AA
GCFunctionInfo * GFI
CodeGenOpt::Level OptLevel

Static Public Attributes

static char ID = 0

Protected Member Functions

void SelectInlineAsmMemoryOperands (std::vector< SDValue > &Ops)
bool CheckAndMask (SDValue LHS, ConstantSDNode *RHS, int64_t DesiredMaskS) const
bool CheckOrMask (SDValue LHS, ConstantSDNode *RHS, int64_t DesiredMaskS) const

Protected Attributes

unsigned DAGSize


Detailed Description

SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruction selectors.

Definition at line 43 of file SelectionDAGISel.h.


Constructor & Destructor Documentation

SelectionDAGISel::SelectionDAGISel ( TargetMachine &  tm,
CodeGenOpt::Level  OL = CodeGenOpt::Default 
) [explicit]

Definition at line 270 of file SelectionDAGISel.cpp.

SelectionDAGISel::~SelectionDAGISel (  )  [virtual]

Definition at line 280 of file SelectionDAGISel.cpp.

References CurDAG, FuncInfo, and SDL.


Member Function Documentation

TargetLowering& llvm::SelectionDAGISel::getTargetLowering (  )  [inline]

Definition at line 62 of file SelectionDAGISel.h.

References TLI.

Referenced by llvm::createDefaultScheduler().

void SelectionDAGISel::getAnalysisUsage ( AnalysisUsage &  AU  )  const [virtual]

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.

For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.

Reimplemented from llvm::MachineFunctionPass.

Definition at line 290 of file SelectionDAGISel.cpp.

References llvm::AnalysisUsage::addPreserved(), llvm::AnalysisUsage::addRequired(), and llvm::MachineFunctionPass::getAnalysisUsage().

bool SelectionDAGISel::runOnMachineFunction ( MachineFunction &  MF  )  [virtual]

unsigned SelectionDAGISel::MakeReg ( EVT  VT  ) 

virtual void llvm::SelectionDAGISel::EmitFunctionEntryCode ( Function &  Fn,
MachineFunction &  MF 
) [inline, virtual]

Definition at line 70 of file SelectionDAGISel.h.

virtual void llvm::SelectionDAGISel::InstructionSelect (  )  [pure virtual]

void llvm::SelectionDAGISel::SelectRootInit (  )  [inline]

Definition at line 73 of file SelectionDAGISel.h.

References llvm::SelectionDAG::AssignTopologicalOrder(), CurDAG, and DAGSize.

virtual bool llvm::SelectionDAGISel::SelectInlineAsmMemoryOperand ( const SDValue &  Op,
char  ConstraintCode,
std::vector< SDValue > &  OutOps 
) [inline, virtual]

SelectInlineAsmMemoryOperand - Select the specified address as a target addressing mode, according to the specified constraint code. If this does not match or is not implemented, return true. The resultant operands (which will appear in the machine instruction) should be added to the OutOps vector.

Definition at line 82 of file SelectionDAGISel.h.

Referenced by SelectInlineAsmMemoryOperands().

bool SelectionDAGISel::IsLegalAndProfitableToFold ( SDNode *  N,
SDNode *  U,
SDNode *  Root 
) const [virtual]

IsLegalAndProfitableToFold - Returns true if the specific operand node N of U can be folded during instruction selection that starts at Root and folding N is profitable.

IsLegalAndProfitableToFold - Returns true if the specific operand node N of U can be folded during instruction selection that starts at Root and folding N is profitable.

Definition at line 1192 of file SelectionDAGISel.cpp.

References findFlagUse(), llvm::MVT::Flag, llvm::SDNode::getNumValues(), llvm::SDNode::getValueType(), isNonImmUse(), llvm::CodeGenOpt::None, OptLevel, and VT.

ScheduleHazardRecognizer * SelectionDAGISel::CreateTargetHazardRecognizer (  )  [virtual]

CreateTargetHazardRecognizer - Return a newly allocated hazard recognizer to use for this target when scheduling the DAG.

Definition at line 1017 of file SelectionDAGISel.cpp.

Referenced by llvm::createTDListDAGScheduler().

void SelectionDAGISel::SelectInlineAsmMemoryOperands ( std::vector< SDValue > &  Ops  )  [protected]

SelectInlineAsmMemoryOperands - Calls to this are automatically generated by tblgen. Others should not call it.

SelectInlineAsmMemoryOperands - Calls to this are automatically generated by tblgen. Others should not call it.

Definition at line 1093 of file SelectionDAGISel.cpp.

References CurDAG, llvm::MVT::Flag, llvm::InlineAsm::getNumOperandRegisters(), llvm::TargetLowering::getPointerTy(), llvm::SelectionDAG::getTargetConstant(), llvm::llvm_report_error(), SelectInlineAsmMemoryOperand(), std::swap(), and TLI.

bool SelectionDAGISel::CheckAndMask ( SDValue  LHS,
ConstantSDNode *  RHS,
int64_t  DesiredMaskS 
) const [protected]

CheckAndMask - The isel is trying to match something like (and X, 255). If the dag combiner simplified the 255, we still want to match. RHS is the actual value in the DAG on the RHS of an AND, and DesiredMaskS is the value specified in the .td file (e.g. 255).

Definition at line 1030 of file SelectionDAGISel.cpp.

References CurDAG, llvm::ConstantSDNode::getAPIntValue(), llvm::SDValue::getValueSizeInBits(), llvm::APInt::intersects(), and llvm::SelectionDAG::MaskedValueIsZero().

bool SelectionDAGISel::CheckOrMask ( SDValue  LHS,
ConstantSDNode *  RHS,
int64_t  DesiredMaskS 
) const [protected]

CheckOrMask - The isel is trying to match something like (or X, 255). If the dag combiner simplified the 255, we still want to match. RHS is the actual value in the DAG on the RHS of an OR, and DesiredMaskS is the value specified in the .td file (e.g. 255).

Definition at line 1059 of file SelectionDAGISel.cpp.

References llvm::SelectionDAG::ComputeMaskedBits(), CurDAG, llvm::ConstantSDNode::getAPIntValue(), llvm::SDValue::getValueSizeInBits(), and llvm::APInt::intersects().


Member Data Documentation

Definition at line 46 of file SelectionDAGISel.h.

Referenced by getTargetLowering(), MakeReg(), and SelectInlineAsmMemoryOperands().

Definition at line 47 of file SelectionDAGISel.h.

Referenced by runOnMachineFunction(), and ~SelectionDAGISel().

Definition at line 49 of file SelectionDAGISel.h.

Referenced by MakeReg(), and runOnMachineFunction().

Definition at line 51 of file SelectionDAGISel.h.

Referenced by runOnMachineFunction(), and ~SelectionDAGISel().

Definition at line 52 of file SelectionDAGISel.h.

Definition at line 53 of file SelectionDAGISel.h.

Referenced by runOnMachineFunction().

Definition at line 54 of file SelectionDAGISel.h.

Referenced by runOnMachineFunction().

Definition at line 55 of file SelectionDAGISel.h.

Referenced by IsLegalAndProfitableToFold().

char SelectionDAGISel::ID = 0 [static]

Definition at line 56 of file SelectionDAGISel.h.

DAGSize - Size of DAG being instruction selected.

Definition at line 101 of file SelectionDAGISel.h.

Referenced by SelectRootInit().


The documentation for this class was generated from the following files: