LLVM  9.0.0svn
Macros | Functions
AMDGPUInstructionSelector.cpp File Reference

This file implements the targeting of the InstructionSelector class for AMDGPU. More...

#include "AMDGPUInstructionSelector.h"
#include "AMDGPUInstrInfo.h"
#include "AMDGPURegisterBankInfo.h"
#include "AMDGPURegisterInfo.h"
#include "AMDGPUSubtarget.h"
#include "AMDGPUTargetMachine.h"
#include "SIMachineFunctionInfo.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
#include "llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h"
#include "llvm/CodeGen/GlobalISel/Utils.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "AMDGPUGenGlobalISel.inc"
Include dependency graph for AMDGPUInstructionSelector.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpu-isel"
 
#define GET_GLOBALISEL_IMPL
 
#define AMDGPUSubtarget   GCNSubtarget
 
#define GET_GLOBALISEL_PREDICATES_INIT
 
#define GET_GLOBALISEL_TEMPORARIES_INIT
 

Functions

static bool isSCC (unsigned Reg, const MachineRegisterInfo &MRI)
 
static int64_t getConstant (const MachineInstr *MI)
 
static unsigned getV_CMPOpcode (CmpInst::Predicate P, unsigned Size)
 
static unsigned getS_CMPOpcode (CmpInst::Predicate P, unsigned Size)
 
static MachineInstrbuildEXP (const TargetInstrInfo &TII, MachineInstr *Insert, unsigned Tgt, unsigned Reg0, unsigned Reg1, unsigned Reg2, unsigned Reg3, unsigned VM, bool Compr, unsigned Enabled, bool Done)
 
static bool isConstant (const MachineInstr &MI)
 

Detailed Description

This file implements the targeting of the InstructionSelector class for AMDGPU.

Todo:
This should be generated by TableGen.

Definition in file AMDGPUInstructionSelector.cpp.

Macro Definition Documentation

◆ AMDGPUSubtarget

Definition at line 39 of file AMDGPUInstructionSelector.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-isel"

◆ GET_GLOBALISEL_IMPL

#define GET_GLOBALISEL_IMPL

Definition at line 38 of file AMDGPUInstructionSelector.cpp.

◆ GET_GLOBALISEL_PREDICATES_INIT

#define GET_GLOBALISEL_PREDICATES_INIT

◆ GET_GLOBALISEL_TEMPORARIES_INIT

#define GET_GLOBALISEL_TEMPORARIES_INIT

Function Documentation

◆ buildEXP()

static MachineInstr* buildEXP ( const TargetInstrInfo TII,
MachineInstr Insert,
unsigned  Tgt,
unsigned  Reg0,
unsigned  Reg1,
unsigned  Reg2,
unsigned  Reg3,
unsigned  VM,
bool  Compr,
unsigned  Enabled,
bool  Done 
)
static

Definition at line 401 of file AMDGPUInstructionSelector.cpp.

◆ getConstant()

static int64_t getConstant ( const MachineInstr MI)
static

Definition at line 157 of file AMDGPUInstructionSelector.cpp.

References add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::RegisterBankInfo::constrainGenericRegister(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineInstr::eraseFromParent(), llvm::MachineInstr::explicit_operands(), llvm::MachineOperand::getCImm(), llvm::SIRegisterInfo::getConstrainedRegClassForOperand(), llvm::MachineInstr::getDebugLoc(), llvm::MachineOperand::getImm(), llvm::MachineFunction::getInfo(), getIntrinsicID(), llvm::MachineRegisterInfo::getLiveInVirtReg(), llvm::MachineInstr::getNumExplicitDefs(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::SIMachineFunctionInfo::getPreloadedValue(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::ConstantInt::getSExtValue(), llvm::AMDGPURegisterInfo::getSubRegFromChannel(), I, llvm::MipsISD::Ins, llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isReg(), llvm::AMDGPUFunctionArgInfo::KERNARG_SEGMENT_PTR, llvm::maxnum(), llvm::minnum(), MRI, llvm::MachineInstr::operands(), llvm::report_fatal_error(), llvm::MachineInstr::setDesc(), Size, and SubReg.

Referenced by EvaluateConstantChrecAtConstant(), llvm::ScalarEvolution::forgetValue(), llvm::ScalarEvolution::getAddExpr(), llvm::SelectionDAG::getAllOnesConstant(), llvm::ScalarEvolution::getConstant(), llvm::ScalarEvolution::getContext(), llvm::ScalarEvolution::getMinMaxExpr(), llvm::ScalarEvolution::getMulExpr(), llvm::ScalarEvolution::getNegativeSCEV(), llvm::ScalarEvolution::getNotSCEV(), llvm::SelectionDAG::getObjectPtrOffset(), llvm::ScalarEvolution::getOffsetOfExpr(), llvm::ScalarEvolution::getOne(), getOtherIncomingValue(), getRangeForAffineARHelper(), llvm::ScalarEvolution::getSignExtendExpr(), llvm::ScalarEvolution::getSizeOfExpr(), llvm::SelectionDAG::getTargetConstant(), llvm::ScalarEvolution::getTruncateExpr(), llvm::ScalarEvolution::getUDivExactExpr(), llvm::ScalarEvolution::getUDivExpr(), llvm::ScalarEvolution::getZero(), llvm::ScalarEvolution::getZeroExtendExpr(), IsKnownPredicateViaMinOrMax(), llvm::ScalarEvolution::isLoopEntryGuardedByCond(), llvm::SelectionDAG::setRoot(), llvm::ScalarEvolution::SimplifyICmpOperands(), SolveQuadraticAddRecRange(), llvm::SelectionDAG::SplitVector(), llvm::SelectionDAG::UnrollVectorOp(), llvm::SelectionDAG::UnrollVectorOverflowOp(), and llvm::SelectionDAG::WidenVector().

◆ getS_CMPOpcode()

static unsigned getS_CMPOpcode ( CmpInst::Predicate  P,
unsigned  Size 
)
static

◆ getV_CMPOpcode()

static unsigned getV_CMPOpcode ( CmpInst::Predicate  P,
unsigned  Size 
)
static

◆ isConstant()

static bool isConstant ( const MachineInstr MI)
static

◆ isSCC()

static bool isSCC ( unsigned  Reg,
const MachineRegisterInfo MRI 
)
static

Definition at line 62 of file AMDGPUInstructionSelector.cpp.

References llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::RegisterBankInfo::constrainGenericRegister(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineInstr::eraseFromParent(), llvm::SIRegisterInfo::getConstrainedRegClassForOperand(), llvm::MachineInstr::getDebugLoc(), llvm::RegisterBank::getID(), llvm::TargetRegisterClass::getID(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClassOrNull(), llvm::MachineRegisterInfo::getRegClassOrRegBank(), llvm::MachineFunction::getRegInfo(), llvm::LLT::getSizeInBits(), llvm::MachineOperand::getSubReg(), llvm::MachineRegisterInfo::getType(), I, llvm::MachineOperand::isDead(), llvm::MachineOperand::isDebug(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isEarlyClobber(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isInternalRead(), llvm::MachineOperand::isKill(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUndef(), llvm_unreachable, MI, MRI, llvm::MachineInstr::operands(), Reg, llvm::MachineInstr::setDesc(), and llvm::MachineRegisterInfo::setRegClass().

Referenced by getS_CMPOpcode().