LLVM API Documentation

LegalizeDAG.cpp File Reference

#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/CommandLine.h"
#include <iostream>
#include <map>

Include dependency graph for LegalizeDAG.cpp:

Go to the source code of this file.

Functions

static unsigned getScalarizedOpcode (unsigned VecOp, MVT::ValueType VT)
static void ComputeTopDownOrdering (SDNode *N, std::vector< SDNode * > &Order, std::map< SDNode *, unsigned > &Visited)
static SDNodeFindCallEndFromCallStart (SDNode *Node)
static SDNodeFindCallStartFromCallEnd (SDNode *Node)

Variables

static cl::opt< bool > ViewLegalizeDAGs ("view-legalize-dags", cl::Hidden, cl::desc("Pop up a window to show dags before legalize"))
TargetLoweringTLI
SelectionDAGDAG
SDOperand LastCALLSEQ_END
bool IsLegalizingCall
TargetLowering::ValueTypeActionImpl ValueTypeActions
std::map< SDOperand, SDOperandLegalizedNodes
std::map< SDOperand, SDOperandPromotedNodes
std::map< SDOperand, std::pair<
SDOperand, SDOperand > > 
ExpandedNodes
std::map< SDOperand, std::pair<
SDOperand, SDOperand > > 
SplitNodes
std::map< SDOperand, SDOperandPackedNodes


Function Documentation

static void ComputeTopDownOrdering ( SDNode N,
std::vector< SDNode * > &  Order,
std::map< SDNode *, unsigned > &  Visited 
) [static]

ComputeTopDownOrdering - Add the specified node to the Order list if it has not been visited yet and if all of its operands have already been visited.

Definition at line 287 of file LegalizeDAG.cpp.

References E, and llvm::SDNode::getNumOperands().

static SDNode* FindCallEndFromCallStart ( SDNode Node  )  [static]

FindCallEndFromCallStart - Given a chained node that is part of a call sequence, find the CALLSEQ_END node that terminates the call sequence.

Definition at line 356 of file LegalizeDAG.cpp.

References llvm::ISD::CALLSEQ_END, E, llvm::SDNode::getOpcode(), Node, llvm::MVT::Other, and llvm::SDNode::use_empty().

static SDNode* FindCallStartFromCallEnd ( SDNode Node  )  [static]

FindCallStartFromCallEnd - Given a chained node that is part of a call sequence, find the CALLSEQ_START node that initiates the call sequence.

Definition at line 396 of file LegalizeDAG.cpp.

References llvm::ISD::CALLSEQ_START, llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), llvm::SDOperand::getValueType(), Node, and llvm::MVT::Other.

static unsigned getScalarizedOpcode ( unsigned  VecOp,
MVT::ValueType  VT 
) [static]

getScalarizedOpcode - Return the scalar opcode that corresponds to the specified vector opcode.

Definition at line 264 of file LegalizeDAG.cpp.

References ADD, AND, llvm::ISD::FADD, llvm::ISD::FDIV, llvm::ISD::FMUL, llvm::ISD::FSUB, llvm::MVT::isInteger(), MUL, OR, llvm::ISD::SDIV, SUB, llvm::ISD::UDIV, llvm::ISD::VADD, llvm::ISD::VAND, llvm::ISD::VMUL, llvm::ISD::VOR, llvm::ISD::VSDIV, llvm::ISD::VSUB, llvm::ISD::VUDIV, llvm::ISD::VXOR, and XOR.


Variable Documentation

SelectionDAG& DAG

Definition at line 51 of file LegalizeDAG.cpp.

std::map<SDOperand, std::pair<SDOperand, SDOperand> > ExpandedNodes

ExpandedNodes - For nodes that need to be expanded this map indicates which which operands are the expanded version of the input. This allows us to avoid expanding the same node more than once.

Definition at line 89 of file LegalizeDAG.cpp.

bool IsLegalizingCall

IsLegalizingCall - This member is used *only* for purposes of providing helpful assertions that a libcall isn't created while another call is being legalized (which could lead to non-serialized call sequences).

Definition at line 63 of file LegalizeDAG.cpp.

SDOperand LastCALLSEQ_END

LastCALLSEQ_END - This keeps track of the CALLSEQ_END node that has been legalized. We use this to ensure that calls are properly serialized against each other, including inserted libcalls.

Definition at line 58 of file LegalizeDAG.cpp.

std::map<SDOperand, SDOperand> LegalizedNodes

LegalizedNodes - For nodes that are of legal width, and that have more than one use, this map indicates what regularized operand to use. This allows us to avoid legalizing the same thing more than once.

Definition at line 79 of file LegalizeDAG.cpp.

std::map<SDOperand, SDOperand> PackedNodes

PackedNodes - For nodes that need to be packed from MVT::Vector types to concrete packed types, this contains the mapping of ones we have already processed to the result.

Definition at line 99 of file LegalizeDAG.cpp.

std::map<SDOperand, SDOperand> PromotedNodes

PromotedNodes - For nodes that are below legal width, and that have more than one use, this map indicates what promoted value to use. This allows us to avoid promoting the same thing more than once.

Definition at line 84 of file LegalizeDAG.cpp.

std::map<SDOperand, std::pair<SDOperand, SDOperand> > SplitNodes

SplitNodes - For vector nodes that need to be split, this map indicates which which operands are the split version of the input. This allows us to avoid splitting the same node more than once.

Definition at line 94 of file LegalizeDAG.cpp.

TargetLowering& TLI

Definition at line 50 of file LegalizeDAG.cpp.

TargetLowering::ValueTypeActionImpl ValueTypeActions

ValueTypeActions - This is a bitvector that contains two bits for each value type, where the two bits correspond to the LegalizeAction enum. This can be queried with "getTypeAction(VT)".

Definition at line 74 of file LegalizeDAG.cpp.

Referenced by SetValueTypeAction().

cl::opt<bool> ViewLegalizeDAGs("view-legalize-dags", cl::Hidden, cl::desc("Pop up a window to show dags before legalize")) [static]