LLVM  6.0.0svn
Public Types | Public Member Functions | List of all members
llvm::DAGTypeLegalizer Class Reference

This takes an arbitrary SelectionDAG as input and hacks on it until only value types the target machine can handle are left. More...

#include "CodeGen/SelectionDAG/LegalizeTypes.h"

Public Types

enum  NodeIdFlags { ReadyToProcess = 0, NewNode = -1, Unanalyzed = -2, Processed = -3 }
 This pass uses the NodeId on the SDNodes to hold information about the state of the node. More...
 

Public Member Functions

 DAGTypeLegalizer (SelectionDAG &dag)
 
bool run ()
 This is the main entry point for the type legalizer. More...
 
void NoteDeletion (SDNode *Old, SDNode *New)
 
SelectionDAGgetDAG () const
 

Detailed Description

This takes an arbitrary SelectionDAG as input and hacks on it until only value types the target machine can handle are left.

This involves promoting small sizes to large sizes or splitting up large values into small values.

Definition at line 32 of file LegalizeTypes.h.

Member Enumeration Documentation

◆ NodeIdFlags

This pass uses the NodeId on the SDNodes to hold information about the state of the node.

The enum has all the values.

Enumerator
ReadyToProcess 

All operands have been processed, so this node is ready to be handled.

NewNode 

This is a new node, not before seen, that was created in the process of legalizing some other node.

Unanalyzed 

This node's ID needs to be set to the number of its unprocessed operands.

Processed 

This is a node that has already been processed.

Definition at line 38 of file LegalizeTypes.h.

Constructor & Destructor Documentation

◆ DAGTypeLegalizer()

llvm::DAGTypeLegalizer::DAGTypeLegalizer ( SelectionDAG dag)
inlineexplicit

Member Function Documentation

◆ getDAG()

SelectionDAG& llvm::DAGTypeLegalizer::getDAG ( ) const
inline

◆ NoteDeletion()

void llvm::DAGTypeLegalizer::NoteDeletion ( SDNode Old,
SDNode New 
)
inline

Definition at line 149 of file LegalizeTypes.h.

References llvm::SDNode::getNumValues().

Referenced by run().

◆ run()

bool DAGTypeLegalizer::run ( )

This is the main entry point for the type legalizer.

This does a top-down traversal of the dag, legalizing types as it goes. Returns "true" if it made any changes.

Definition at line 193 of file LegalizeTypes.cpp.

References llvm::SelectionDAG::allnodes(), llvm::ISD::ANY_EXTEND, llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::back(), llvm::ISD::BITCAST, llvm::pdb::Bool, Callee, llvm::TargetLoweringBase::Custom, llvm::SelectionDAG::DAGUpdateListener, llvm::dbgs(), DEBUG, llvm::NVPTXISD::Dummy, llvm::SDNode::dump(), E, llvm::SmallVectorBase::empty(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::empty(), EnableExpensiveChecks, llvm::ISD::EXTRACT_ELEMENT, first, getDAG(), llvm::EVT::getEVTString(), llvm::TargetLoweringBase::getExtendForContent(), llvm::EVT::getIntegerVT(), llvm::MVT::getIntegerVT(), llvm::SDValue::getNode(), llvm::SDNode::getNodeId(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SelectionDAG::getRoot(), llvm::SDValue::getScalarValueSizeInBits(), llvm::EVT::getSizeInBits(), llvm::EVT::getTypeForEVT(), llvm::SDValue::getValueSizeInBits(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), llvm::EVT::getVectorElementCount(), llvm::EVT::getVectorElementType(), llvm::EVT::getVectorNumElements(), llvm::EVT::getVectorVT(), llvm::MipsISD::Hi, I, llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), llvm::TargetLoweringBase::ArgListEntry::IsSExt, llvm::TargetLoweringBase::isTypeLegal(), llvm::EVT::isVector(), llvm::TargetLoweringBase::ArgListEntry::IsZExt, llvm_unreachable, llvm::MipsISD::Lo, llvm::Log2_32_Ceil(), N, NewNode, llvm::NextPowerOf2(), llvm::TargetLoweringBase::ArgListEntry::Node, llvm::None, NoteDeletion(), llvm::SDNode::op_begin(), llvm::ISD::OR, llvm::MVT::Other, llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::pop_back(), Processed, ReadyToProcess, llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::remove(), llvm::SelectionDAG::RemoveDeadNodes(), Results, llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::TargetLowering::CallLoweringInfo::setDebugLoc(), llvm::TargetLowering::CallLoweringInfo::setLibCallee(), llvm::SDValue::setNode(), llvm::SDNode::setNodeId(), llvm::SelectionDAG::setRoot(), llvm::TargetLowering::CallLoweringInfo::setZExtResult(), llvm::ISD::SHL, llvm::SmallVectorTemplateCommon< T >::size(), llvm::ISD::SRL, llvm::SPII::Store, llvm::ISD::TRUNCATE, llvm::TargetLoweringBase::ArgListEntry::Ty, llvm::TargetLoweringBase::TypeExpandFloat, llvm::TargetLoweringBase::TypeExpandInteger, llvm::TargetLoweringBase::TypeLegal, llvm::TargetLoweringBase::TypePromoteFloat, llvm::TargetLoweringBase::TypePromoteInteger, llvm::TargetLoweringBase::TypeScalarizeVector, llvm::TargetLoweringBase::TypeSoftenFloat, llvm::TargetLoweringBase::TypeSplitVector, llvm::TargetLoweringBase::TypeWidenVector, Unanalyzed, llvm::SelectionDAG::UpdateNodeOperands(), llvm::SDNode::use_begin(), llvm::SDValue::use_empty(), llvm::SDNode::use_end(), and llvm::ISD::ZERO_EXTEND.


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