LLVM API Documentation

llvm::SelectionDAGLowering Class Reference

#include <SelectionDAGBuild.h>

Collaboration diagram for llvm::SelectionDAGLowering:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SelectionDAGLowering (SelectionDAG &dag, TargetLowering &tli, FunctionLoweringInfo &funcinfo)
void init (GCFunctionInfo *gfi, AliasAnalysis &aa)
void clear ()
SDValue getRoot ()
SDValue getControlRoot ()
void CopyValueToVirtualRegister (Value *V, unsigned Reg)
void visit (Instruction &I)
void visit (unsigned Opcode, User &I)
void setCurrentBasicBlock (MachineBasicBlock *MBB)
SDValue getValue (const Value *V)
void setValue (const Value *V, SDValue NewN)
void GetRegistersForValue (SDISelAsmOperandInfo &OpInfo, std::set< unsigned > &OutputRegs, std::set< unsigned > &InputRegs)
void FindMergedConditions (Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, unsigned Opc)
 FindMergedConditions - If Cond is an expression like.
bool ShouldEmitAsBranches (const std::vector< CaseBlock > &Cases)
bool isExportableFromCurrentBlock (Value *V, const BasicBlock *FromBB)
void ExportFromCurrentBlock (Value *V)
void LowerCallTo (CallSite CS, SDValue Callee, bool IsTailCall, MachineBasicBlock *LandingPad=NULL)
void visitSwitchCase (CaseBlock &CB)
void visitBitTestHeader (BitTestBlock &B)
void visitBitTestCase (MachineBasicBlock *NextMBB, unsigned Reg, BitTestCase &B)
 visitBitTestCase - this function produces one "bit test"
void visitJumpTable (JumpTable &JT)
 visitJumpTable - Emit JumpTable node in the current MBB
void visitJumpTableHeader (JumpTable &JT, JumpTableHeader &JTH)

Public Attributes

TargetLoweringTLI
SelectionDAGDAG
const TargetDataTD
AliasAnalysisAA
std::vector< CaseBlock > SwitchCases
std::vector< JumpTableBlock > JTCases
std::vector< BitTestBlock > BitTestCases
std::vector< std::pair
< MachineInstr *, unsigned > > 
PHINodesToUpdate
DenseMap< Constant *, unsignedConstantsOut
FunctionLoweringInfoFuncInfo
GCFunctionInfoGFI
 GFI - Garbage collection metadata for the function.

Classes

struct  BitTestBlock
struct  BitTestCase
struct  Case
struct  CaseBits
struct  CaseBitsCmp
struct  CaseBlock
struct  CaseCmp
struct  CaseRec
struct  JumpTable
struct  JumpTableHeader


Detailed Description

SelectionDAGLowering - This is the common target-independent lowering implementation that is parameterized by a TargetLowering object. Also, targets can overload any lowering method.

Definition at line 164 of file SelectionDAGBuild.h.


Constructor & Destructor Documentation

llvm::SelectionDAGLowering::SelectionDAGLowering ( SelectionDAG dag,
TargetLowering tli,
FunctionLoweringInfo funcinfo 
) [inline]

Definition at line 357 of file SelectionDAGBuild.h.


Member Function Documentation

void SelectionDAGLowering::init ( GCFunctionInfo gfi,
AliasAnalysis aa 
)

void SelectionDAGLowering::clear (  ) 

clear - Clear out the curret SelectionDAG and the associated state and prepare this SelectionDAGLowering object to be used for a new block. This doesn't clear out information about additional blocks that are needed to complete switch lowering or PHI node updating; that information is cleared out as it is consumed.

clear - Clear out the curret SelectionDAG and the associated state and prepare this SelectionDAGLowering object to be used for a new block. This doesn't clear out information about additional blocks that are needed to complete switch lowering or PHI node updating; that information is cleared out as it is consumed.

Definition at line 697 of file SelectionDAGBuild.cpp.

References llvm::SelectionDAG::clear(), and DAG.

SDValue SelectionDAGLowering::getRoot (  ) 

getRoot - Return the current virtual root of the Selection DAG, flushing any PendingLoad items. This must be done before emitting a store or any other node that may need to be ordered after any prior load instructions.

getRoot - Return the current virtual root of the Selection DAG, flushing any PendingLoad items. This must be done before emitting a store or any other node that may need to be ordered after any prior load instructions.

Definition at line 709 of file SelectionDAGBuild.cpp.

References DAG, llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getRoot(), llvm::MVT::Other, Root, llvm::SelectionDAG::setRoot(), and llvm::ISD::TokenFactor.

Referenced by LowerCallTo().

SDValue SelectionDAGLowering::getControlRoot (  ) 

getControlRoot - Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports items. It is necessary to do this before emitting a terminator instruction.

getControlRoot - Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports items. It is necessary to do this before emitting a terminator instruction.

Definition at line 732 of file SelectionDAGBuild.cpp.

References DAG, llvm::ISD::EntryToken, llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SelectionDAG::getRoot(), llvm::MVT::Other, Root, llvm::SelectionDAG::setRoot(), and llvm::ISD::TokenFactor.

Referenced by LowerCallTo(), visitBitTestCase(), visitBitTestHeader(), visitJumpTable(), visitJumpTableHeader(), and visitSwitchCase().

void SelectionDAGLowering::CopyValueToVirtualRegister ( Value V,
unsigned  Reg 
)

void SelectionDAGLowering::visit ( Instruction I  ) 

Definition at line 759 of file SelectionDAGBuild.cpp.

References llvm::Instruction::getOpcode().

Referenced by getValue().

void SelectionDAGLowering::visit ( unsigned  Opcode,
User I 
)

Definition at line 763 of file SelectionDAGBuild.cpp.

void llvm::SelectionDAGLowering::setCurrentBasicBlock ( MachineBasicBlock MBB  )  [inline]

Definition at line 391 of file SelectionDAGBuild.h.

SDValue SelectionDAGLowering::getValue ( const Value V  ) 

void llvm::SelectionDAGLowering::setValue ( const Value V,
SDValue  NewN 
) [inline]

Definition at line 395 of file SelectionDAGBuild.h.

References llvm::SDValue::getNode().

Referenced by LowerCallTo().

void SelectionDAGLowering::GetRegistersForValue ( SDISelAsmOperandInfo OpInfo,
std::set< unsigned > &  OutputRegs,
std::set< unsigned > &  InputRegs 
)

void SelectionDAGLowering::FindMergedConditions ( Value Cond,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
MachineBasicBlock CurBB,
unsigned  Opc 
)

FindMergedConditions - If Cond is an expression like.

Definition at line 1000 of file SelectionDAGBuild.cpp.

References And(), BB, BBI, llvm::MachineFunction::CreateMachineBasicBlock(), DAG, llvm::dyn_cast(), llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::FiniteOnlyFPMath(), llvm::MachineBasicBlock::getBasicBlock(), llvm::SelectionDAG::getMachineFunction(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::Instruction::getParent(), llvm::ConstantInt::getTrue(), llvm::Value::hasOneUse(), IC, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, InBlock(), llvm::MachineFunction::insert(), isExportableFromCurrentBlock(), MF, llvm::APIntOps::Or(), llvm::ISD::SETEQ, llvm::ISD::SETFALSE, llvm::ISD::SETGE, llvm::ISD::SETGT, llvm::ISD::SETLE, llvm::ISD::SETLT, llvm::ISD::SETNE, llvm::ISD::SETO, llvm::ISD::SETOEQ, llvm::ISD::SETOGE, llvm::ISD::SETOGT, llvm::ISD::SETOLE, llvm::ISD::SETOLT, llvm::ISD::SETONE, llvm::ISD::SETTRUE, llvm::ISD::SETUEQ, llvm::ISD::SETUGE, llvm::ISD::SETUGT, llvm::ISD::SETULE, llvm::ISD::SETULT, llvm::ISD::SETUNE, llvm::ISD::SETUO, and SwitchCases.

bool SelectionDAGLowering::ShouldEmitAsBranches ( const std::vector< CaseBlock > &  Cases  ) 

If the set of cases should be emitted as a series of branches, return true. If we should emit this as a bunch of and/or'd together conditions, return false.

Definition at line 1127 of file SelectionDAGBuild.cpp.

bool SelectionDAGLowering::isExportableFromCurrentBlock ( Value V,
const BasicBlock FromBB 
)

void SelectionDAGLowering::ExportFromCurrentBlock ( Value V  ) 

ExportFromCurrentBlock - If this condition isn't known to be exported from the current basic block, add it to ValueMap now so that we'll get a CopyTo/FromReg.

Definition at line 955 of file SelectionDAGBuild.cpp.

References CopyValueToVirtualRegister(), FuncInfo, llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::FunctionLoweringInfo::isExportedInst(), and Reg.

void SelectionDAGLowering::LowerCallTo ( CallSite  CS,
SDValue  Callee,
bool  IsTailCall,
MachineBasicBlock LandingPad = NULL 
)

void SelectionDAGLowering::visitSwitchCase ( CaseBlock &  CB  ) 

void SelectionDAGLowering::visitBitTestHeader ( BitTestBlock &  B  ) 

void SelectionDAGLowering::visitBitTestCase ( MachineBasicBlock NextMBB,
unsigned  Reg,
BitTestCase &  B 
)

void SelectionDAGLowering::visitJumpTable ( JumpTable JT  ) 

void SelectionDAGLowering::visitJumpTableHeader ( JumpTable JT,
JumpTableHeader &  JTH 
)


Member Data Documentation

Definition at line 331 of file SelectionDAGBuild.h.

Referenced by init().

Definition at line 332 of file SelectionDAGBuild.h.

Referenced by init().

SwitchCases - Vector of CaseBlock structures used to communicate SwitchInst code generation information.

Definition at line 336 of file SelectionDAGBuild.h.

Referenced by FindMergedConditions().

std::vector<JumpTableBlock> llvm::SelectionDAGLowering::JTCases

JTCases - Vector of JumpTable structures used to communicate SwitchInst code generation information.

Definition at line 339 of file SelectionDAGBuild.h.

std::vector<BitTestBlock> llvm::SelectionDAGLowering::BitTestCases

BitTestCases - Vector of BitTestBlock structures used to communicate SwitchInst code generation information.

Definition at line 342 of file SelectionDAGBuild.h.

Definition at line 344 of file SelectionDAGBuild.h.

Definition at line 348 of file SelectionDAGBuild.h.

FuncInfo - Information about the function as a whole.

Definition at line 352 of file SelectionDAGBuild.h.

Referenced by ExportFromCurrentBlock(), getValue(), isExportableFromCurrentBlock(), visitBitTestHeader(), and visitJumpTableHeader().

GFI - Garbage collection metadata for the function.

Definition at line 355 of file SelectionDAGBuild.h.

Referenced by init().


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



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.