LLVM API Documentation

X86ISelDAGToDAG.cpp File Reference

#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86ISelLowering.h"
#include "X86MachineFunctionInfo.h"
#include "X86RegisterInfo.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
#include "llvm/GlobalValue.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/Support/CFG.h"
#include "llvm/Type.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "X86GenDAGISel.inc"

Include dependency graph for X86ISelDAGToDAG.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "x86-isel"

Functions

 STATISTIC (NumLoadMoved,"Number of loads moved below TokenFactor")
static SDNodefindFlagUse (SDNode *N)
static void findNonImmUse (SDNode *Use, SDNode *Def, SDNode *ImmedUse, SDNode *Root, bool &found, SmallPtrSet< SDNode *, 16 > &Visited)
static bool isNonImmUse (SDNode *Root, SDNode *Def, SDNode *ImmedUse)
static void MoveBelowTokenFactor (SelectionDAG *CurDAG, SDValue Load, SDValue Store, SDValue TF)
static bool isRMWLoad (SDValue N, SDValue Chain, SDValue Address, SDValue &Load)
static void MoveBelowCallSeqStart (SelectionDAG *CurDAG, SDValue Load, SDValue Call, SDValue Chain)
static bool isCalleeLoad (SDValue Callee, SDValue &Chain)
static SDNodeFindCallStartFromCall (SDNode *Node)
FunctionPassllvm::createX86ISelDag (X86TargetMachine &TM, bool Fast)


Define Documentation

#define DEBUG_TYPE   "x86-isel"

Definition at line 15 of file X86ISelDAGToDAG.cpp.


Function Documentation

static SDNode* FindCallStartFromCall ( SDNode Node  )  [static]

static SDNode* findFlagUse ( SDNode N  )  [static]

findFlagUse - Return use of MVT::Flag value produced by the specified SDNode.

Definition at line 242 of file X86ISelDAGToDAG.cpp.

References E, llvm::SDValue::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOperand(), llvm::SDValue::getResNo(), I, Op, llvm::SDNode::use_begin(), and llvm::SDNode::use_end().

static void findNonImmUse ( SDNode Use,
SDNode Def,
SDNode ImmedUse,
SDNode Root,
bool &  found,
SmallPtrSet< SDNode *, 16 > &  Visited 
) [static]

findNonImmUse - Return true by reference in "found" if "Use" is an non-immediate use of "Def". This function recursively traversing up the operand chain ignoring certain nodes.

Definition at line 258 of file X86ISelDAGToDAG.cpp.

References llvm::SDValue::getNode(), llvm::SDNode::getNodeId(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), and llvm::SmallPtrSet< PtrType, SmallSize >::insert().

Referenced by isNonImmUse().

static bool isCalleeLoad ( SDValue  Callee,
SDValue Chain 
) [static]

isCalleeLoad - Return true if call address is a load and it can be moved below CALLSEQ_START and the chains leading up to the call. Return the CALLSEQ_START by reference as a second output.

Definition at line 455 of file X86ISelDAGToDAG.cpp.

References llvm::ISD::CALLSEQ_START, llvm::dyn_cast(), llvm::LSBaseSDNode::getAddressingMode(), llvm::LoadSDNode::getExtensionType(), llvm::SDValue::getNode(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), llvm::SDValue::hasOneUse(), llvm::MemSDNode::isVolatile(), llvm::ISD::NON_EXTLOAD, and llvm::ISD::UNINDEXED.

static bool isNonImmUse ( SDNode Root,
SDNode Def,
SDNode ImmedUse 
) [inline, static]

isNonImmUse - Start searching from Root up the DAG to check is Def can be reached. Return true if that's the case. However, ignore direct uses by ImmedUse (which would be U in the example illustrated in IsLegalAndProfitableToFold) and by Root (which can happen in the store case). FIXME: to be really generic, we should allow direct use by any node that is being folded. But realisticly since we only fold loads which have one non-chain use, we only need to watch out for load/op/store and load/op/cmp case where the root (store / cmp) may reach the load via its chain operand.

Definition at line 291 of file X86ISelDAGToDAG.cpp.

References findNonImmUse(), and Visited.

static bool isRMWLoad ( SDValue  N,
SDValue  Chain,
SDValue  Address,
SDValue Load 
) [static]

static void MoveBelowCallSeqStart ( SelectionDAG CurDAG,
SDValue  Load,
SDValue  Call,
SDValue  Chain 
) [static]

MoveBelowCallSeqStart - Replace CALLSEQ_START operand with load's chain operand and move load below the call's chain operand.

Definition at line 434 of file X86ISelDAGToDAG.cpp.

References llvm::SmallVectorImpl< T >::clear(), llvm::SDValue::getNode(), llvm::SDNode::getNumOperands(), llvm::SDValue::getOperand(), llvm::SmallVectorImpl< T >::push_back(), llvm::SmallVectorImpl< T >::size(), and llvm::SelectionDAG::UpdateNodeOperands().

static void MoveBelowTokenFactor ( SelectionDAG CurDAG,
SDValue  Load,
SDValue  Store,
SDValue  TF 
) [static]

MoveBelowTokenFactor - Replace TokenFactor operand with load's chain operand and move load below the TokenFactor. Replace store's chain operand with load's chain result.

Definition at line 392 of file X86ISelDAGToDAG.cpp.

References llvm::SDValue::getNode(), llvm::SDNode::getNumOperands(), llvm::SDValue::getOperand(), llvm::SDValue::getValue(), llvm::SmallVectorImpl< T >::push_back(), llvm::SmallVectorImpl< T >::size(), and llvm::SelectionDAG::UpdateNodeOperands().

STATISTIC ( NumLoadMoved  ,
"Number of loads moved below TokenFactor"   
)


Variable Documentation

struct { ... } Base

enum { ... } BaseType

CurBB - Current BB being isel'd.

Definition at line 121 of file X86ISelDAGToDAG.cpp.

Referenced by LowerPartSelect().

int32_t Disp

Definition at line 68 of file X86ISelDAGToDAG.cpp.

const char* ES

Definition at line 71 of file X86ISelDAGToDAG.cpp.

Referenced by llvm::AsmPrinter::EmitConstantPool().

Definition at line 69 of file X86ISelDAGToDAG.cpp.

Referenced by AnalyzeGlobal(), llvm::CloneModule(), llvm::ComputeMaskedBits(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCompareInstruction(), createSlotTracker(), llvm::AsmPrinter::doFinalization(), llvm::ExecutionEngine::emitGlobals(), EnforceKnownAlignment(), evaluateICmpRelation(), ExtractTypeInfo(), findUsedValues(), fitsInAddressMode(), llvm::GlobalAlias::getAliasedGlobal(), llvm::MachineModuleInfo::getAnchoredDescriptors(), llvm::GetConstantStringInfo(), llvm::ExecutionEngine::getConstantValue(), llvm::DbgStopPointInst::getDirectory(), llvm::DbgStopPointInst::getFileName(), llvm::ProgramInfo::getFunction(), getGlobalVariable(), getGlobalVariablesUsing(), getModuleFromVal(), getNextStopPoint(), llvm::Module::getOrInsertGlobal(), GetStringLengthH(), getSymTab(), llvm::SelectionDAGLowering::getValue(), llvm::Mangler::getValueName(), isKnownNonNull(), isMemSrcFromString(), isObjectSmallerThan(), isSafeToLoadUnconditionally(), isStringValue(), llvm::SelectionDAG::isVerifiedDebugInfoDesc(), lle_X_atexit(), lle_X_atoi(), lle_X_cos(), lle_X_exp(), lle_X_floor(), lle_X_log(), lle_X_pow(), lle_X_sin(), lle_X_sqrt(), LLVMGetNextGlobal(), LLVMGetPreviousGlobal(), LowerCALL(), LowerGlobalAddress(), LowerGLOBALADDRESS(), llvm::AlphaTargetLowering::LowerOperation(), PointsToConstantGlobal(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), RemoveDeadConstant(), llvm::GlobalAlias::resolveAliasedGlobal(), ResolveAliases(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), llvm::SourceFunctionInfo::SourceFunctionInfo(), llvm::DbgInfoIntrinsic::StripCast(), StripDebugInfo(), WriteAsOperandInternal(), and WriteModuleInfo().

Definition at line 234 of file X86ISelDAGToDAG.cpp.

bool isRIPRel

Definition at line 65 of file X86ISelDAGToDAG.cpp.

int JT

bool OptForSize

OptForSize - If true, selector should try to optimize for code size instead of performance.

Definition at line 125 of file X86ISelDAGToDAG.cpp.

Definition at line 61 of file X86ISelDAGToDAG.cpp.

Referenced by llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::addRegisterKilled(), llvm::CCState::AllocateReg(), llvm::RegScavenger::backward(), llvm::ScheduleDAGInstrs::BuildSchedGraph(), CheckForPhysRegDependency(), llvm::ARMInstrInfo::convertToThreeAddress(), llvm::X86InstrInfo::determineREX(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::ScheduleDAG::EmitCrossRCCopy(), llvm::X86RegisterInfo::emitFrameMoves(), llvm::XCoreRegisterInfo::emitPrologue(), llvm::X86RegisterInfo::emitPrologue(), llvm::SPURegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), llvm::ARMRegisterInfo::emitPrologue(), llvm::SelectionDAGLowering::ExportFromCurrentBlock(), findScratchRegister(), llvm::RegScavenger::FindUnusedReg(), llvm::RegScavenger::forward(), getFPReg(), llvm::RegisterSDNode::getReg(), llvm::FastISel::getRegForValue(), llvm::LiveIntervals::getVNInfoSourceReg(), isLiveInButUnusedBefore(), LowerCALL(), llvm::PPCRegisterInfo::lowerCRSpilling(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::X86IntelAsmPrinter::printAsmMRegister(), llvm::X86ATTAsmPrinter::printAsmMRegister(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::ARMRegisterInfo::processFunctionBeforeCalleeSavedScan(), llvm::X86InstrInfo::restoreCalleeSavedRegisters(), llvm::ARMInstrInfo::restoreCalleeSavedRegisters(), llvm::X86InstrInfo::spillCalleeSavedRegisters(), and llvm::ARMInstrInfo::spillCalleeSavedRegisters().

Subtarget - Keep a pointer to the X86Subtarget around so that we can make the right decision when generating code for different targets.

Definition at line 117 of file X86ISelDAGToDAG.cpp.

TM - Keep a reference to X86TargetMachine.

Definition at line 109 of file X86ISelDAGToDAG.cpp.

X86Lowering - This object fully describes how to lower LLVM code to an X86-specific SelectionDAG.

Definition at line 113 of file X86ISelDAGToDAG.cpp.




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