LLVM  4.0.0
Functions | Variables
SIISelLowering.cpp File Reference

Custom DAG lowering for SI. More...

#include "AMDGPU.h"
#include "AMDGPUIntrinsicInfo.h"
#include "AMDGPUSubtarget.h"
#include "SIDefines.h"
#include "SIISelLowering.h"
#include "SIInstrInfo.h"
#include "SIMachineFunctionInfo.h"
#include "SIRegisterInfo.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Function.h"
Include dependency graph for SIISelLowering.cpp:

Go to the source code of this file.

Functions

static unsigned findFirstFreeSGPR (CCState &CCInfo)
 
static bool isFlatGlobalAddrSpace (unsigned AS)
 
static MachineBasicBlock::iterator emitLoadM0FromVGPRLoop (const SIInstrInfo *TII, MachineRegisterInfo &MRI, MachineBasicBlock &OrigBB, MachineBasicBlock &LoopBB, const DebugLoc &DL, const MachineOperand &IdxReg, unsigned InitReg, unsigned ResultReg, unsigned PhiReg, unsigned InitSaveExecReg, int Offset, bool UseGPRIdxMode)
 
static MachineBasicBlock::iterator loadM0FromVGPR (const SIInstrInfo *TII, MachineBasicBlock &MBB, MachineInstr &MI, unsigned InitResultReg, unsigned PhiReg, int Offset, bool UseGPRIdxMode)
 
static std::pair< unsigned, int > computeIndirectRegAndOffset (const SIRegisterInfo &TRI, const TargetRegisterClass *SuperRC, unsigned VecReg, int Offset)
 
static bool setM0ToIndexFromSGPR (const SIInstrInfo *TII, MachineRegisterInfo &MRI, MachineInstr &MI, int Offset, bool UseGPRIdxMode, bool IsIndirectSrc)
 
static MachineBasicBlockemitIndirectSrc (MachineInstr &MI, MachineBasicBlock &MBB, const SISubtarget &ST)
 
static unsigned getMOVRELDPseudo (const TargetRegisterClass *VecRC)
 
static MachineBasicBlockemitIndirectDst (MachineInstr &MI, MachineBasicBlock &MBB, const SISubtarget &ST)
 
static SDNodefindUser (SDValue Value, unsigned Opcode)
 Helper function for LowerBRCOND. More...
 
static SDValue buildPCRelGlobalAddress (SelectionDAG &DAG, const GlobalValue *GV, SDLoc DL, unsigned Offset, EVT PtrVT, unsigned GAFlags=SIInstrInfo::MO_NONE)
 
static SDValue emitNonHSAIntrinsicError (SelectionDAG &DAG, SDLoc DL, EVT VT)
 
static SDValue emitRemovedIntrinsicError (SelectionDAG &DAG, SDLoc DL, EVT VT)
 
static SDValue getFPBinOp (SelectionDAG &DAG, unsigned Opcode, const SDLoc &SL, EVT VT, SDValue A, SDValue B, SDValue GlueChain)
 
static SDValue getFPTernOp (SelectionDAG &DAG, unsigned Opcode, const SDLoc &SL, EVT VT, SDValue A, SDValue B, SDValue C, SDValue GlueChain)
 
static bool canFoldOffset (unsigned OffsetSize, unsigned AS, const SISubtarget &STI)
 Return true if the given offset Size in bytes can be folded into the immediate offsets of a memory instruction for the given address space. More...
 
static bool bitOpWithConstantIsReducible (unsigned Opc, uint32_t Val)
 
static unsigned minMaxOpcToMin3Max3Opc (unsigned Opc)
 
static SDValue performIntMed3ImmCombine (SelectionDAG &DAG, const SDLoc &SL, SDValue Op0, SDValue Op1, bool Signed)
 
static bool isKnownNeverSNan (SelectionDAG &DAG, SDValue Op)
 
static SDValue performFPMed3ImmCombine (SelectionDAG &DAG, const SDLoc &SL, SDValue Op0, SDValue Op1)
 
static unsigned SubIdx2Lane (unsigned Idx)
 Helper function for adjustWritemask. More...
 
static bool isFrameIndexOp (SDValue Op)
 
static SDValue buildSMovImm32 (SelectionDAG &DAG, const SDLoc &DL, uint64_t Val)
 

Variables

static cl::opt< boolEnableVGPRIndexMode ("amdgpu-vgpr-index-mode", cl::desc("Use GPR indexing mode instead of movrel for vector indexing"), cl::init(false))
 

Detailed Description

Custom DAG lowering for SI.

Definition in file SIISelLowering.cpp.

Function Documentation

static bool bitOpWithConstantIsReducible ( unsigned  Opc,
uint32_t  Val 
)
static

Definition at line 3508 of file SIISelLowering.cpp.

References llvm::ISD::AND, llvm::ISD::OR, and llvm::ISD::XOR.

static SDValue buildPCRelGlobalAddress ( SelectionDAG DAG,
const GlobalValue GV,
SDLoc  DL,
unsigned  Offset,
EVT  PtrVT,
unsigned  GAFlags = SIInstrInfo::MO_NONE 
)
static
static SDValue buildSMovImm32 ( SelectionDAG DAG,
const SDLoc DL,
uint64_t  Val 
)
static
static bool canFoldOffset ( unsigned  OffsetSize,
unsigned  AS,
const SISubtarget STI 
)
static

Return true if the given offset Size in bytes can be folded into the immediate offsets of a memory instruction for the given address space.

Definition at line 3413 of file SIISelLowering.cpp.

References AMDGPUAS::CONSTANT_ADDRESS, llvm::AMDGPUSubtarget::getGeneration(), AMDGPUAS::GLOBAL_ADDRESS, llvm::isUInt< 16 >(), llvm::isUInt< 8 >(), AMDGPUAS::LOCAL_ADDRESS, AMDGPUAS::PRIVATE_ADDRESS, AMDGPUAS::REGION_ADDRESS, and llvm::AMDGPUSubtarget::VOLCANIC_ISLANDS.

static std::pair<unsigned, int> computeIndirectRegAndOffset ( const SIRegisterInfo TRI,
const TargetRegisterClass SuperRC,
unsigned  VecReg,
int  Offset 
)
static

Definition at line 1435 of file SIISelLowering.cpp.

References llvm::TargetRegisterClass::getSize().

Referenced by emitIndirectDst(), and emitIndirectSrc().

static MachineBasicBlock* emitIndirectDst ( MachineInstr MI,
MachineBasicBlock MBB,
const SISubtarget ST 
)
static
static MachineBasicBlock* emitIndirectSrc ( MachineInstr MI,
MachineBasicBlock MBB,
const SISubtarget ST 
)
static
static MachineBasicBlock::iterator emitLoadM0FromVGPRLoop ( const SIInstrInfo TII,
MachineRegisterInfo MRI,
MachineBasicBlock OrigBB,
MachineBasicBlock LoopBB,
const DebugLoc DL,
const MachineOperand IdxReg,
unsigned  InitReg,
unsigned  ResultReg,
unsigned  PhiReg,
unsigned  InitSaveExecReg,
int  Offset,
bool  UseGPRIdxMode 
)
static
static SDValue emitNonHSAIntrinsicError ( SelectionDAG DAG,
SDLoc  DL,
EVT  VT 
)
static
static SDValue emitRemovedIntrinsicError ( SelectionDAG DAG,
SDLoc  DL,
EVT  VT 
)
static
static unsigned findFirstFreeSGPR ( CCState CCInfo)
static
static SDNode* findUser ( SDValue  Value,
unsigned  Opcode 
)
static

Helper function for LowerBRCOND.

Definition at line 1920 of file SIISelLowering.cpp.

References E, llvm::SDValue::getNode(), I, llvm::SDNode::use_begin(), and llvm::SDNode::use_end().

static SDValue getFPBinOp ( SelectionDAG DAG,
unsigned  Opcode,
const SDLoc SL,
EVT  VT,
SDValue  A,
SDValue  B,
SDValue  GlueChain 
)
static
static SDValue getFPTernOp ( SelectionDAG DAG,
unsigned  Opcode,
const SDLoc SL,
EVT  VT,
SDValue  A,
SDValue  B,
SDValue  C,
SDValue  GlueChain 
)
static
static unsigned getMOVRELDPseudo ( const TargetRegisterClass VecRC)
static

Definition at line 1589 of file SIISelLowering.cpp.

References llvm::TargetRegisterClass::getSize(), and llvm_unreachable.

Referenced by emitIndirectDst().

static bool isFlatGlobalAddrSpace ( unsigned  AS)
static
static bool isFrameIndexOp ( SDValue  Op)
static
static bool isKnownNeverSNan ( SelectionDAG DAG,
SDValue  Op 
)
static
static MachineBasicBlock::iterator loadM0FromVGPR ( const SIInstrInfo TII,
MachineBasicBlock MBB,
MachineInstr MI,
unsigned  InitResultReg,
unsigned  PhiReg,
int  Offset,
bool  UseGPRIdxMode 
)
static
static unsigned minMaxOpcToMin3Max3Opc ( unsigned  Opc)
static
static SDValue performFPMed3ImmCombine ( SelectionDAG DAG,
const SDLoc SL,
SDValue  Op0,
SDValue  Op1 
)
static
static SDValue performIntMed3ImmCombine ( SelectionDAG DAG,
const SDLoc SL,
SDValue  Op0,
SDValue  Op1,
bool  Signed 
)
static
static bool setM0ToIndexFromSGPR ( const SIInstrInfo TII,
MachineRegisterInfo MRI,
MachineInstr MI,
int  Offset,
bool  UseGPRIdxMode,
bool  IsIndirectSrc 
)
static
static unsigned SubIdx2Lane ( unsigned  Idx)
static

Helper function for adjustWritemask.

Definition at line 4178 of file SIISelLowering.cpp.

Variable Documentation

cl::opt<bool> EnableVGPRIndexMode("amdgpu-vgpr-index-mode", cl::desc("Use GPR indexing mode instead of movrel for vector indexing"), cl::init(false))
static

Referenced by emitIndirectDst(), and emitIndirectSrc().