LLVM
15.0.0git
|
#include "SIInstrInfo.h"
#include "AMDGPU.h"
#include "AMDGPUInstrInfo.h"
#include "GCNHazardRecognizer.h"
#include "GCNSubtarget.h"
#include "SIMachineFunctionInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineScheduler.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/MC/MCContext.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h"
#include "AMDGPUGenInstrInfo.inc"
#include "AMDGPUGenSearchableTables.inc"
Go to the source code of this file.
Namespaces | |
llvm | |
This is an optimization pass for GlobalISel generic memory operations. | |
llvm::AMDGPU | |
Macros | |
#define | DEBUG_TYPE "si-instr-info" |
#define | GET_INSTRINFO_CTOR_DTOR |
#define | GET_D16ImageDimIntrinsics_IMPL |
#define | GET_ImageDimIntrinsicTable_IMPL |
#define | GET_RsrcIntrinsics_IMPL |
Enumerations | |
enum | SIEncodingFamily { SI = 0, VI = 1, SDWA = 2, SDWA9 = 3, GFX80 = 4, GFX9 = 5, GFX10 = 6, SDWA10 = 7, GFX90A = 8, GFX940 = 9, GFX11 = 10 } |
Variables | |
static cl::opt< unsigned > | BranchOffsetBits ("amdgpu-s-branch-bits", cl::ReallyHidden, cl::init(16), cl::desc("Restrict range of branch instructions (DEBUG)")) |
static cl::opt< bool > | Fix16BitCopies ("amdgpu-fix-16-bit-physreg-copies", cl::desc("Fix copies between 32 and 16 bit registers by extending to 32 bit"), cl::init(true), cl::ReallyHidden) |
static constexpr unsigned | ModifierOpNames [] |
SI Implementation of TargetInstrInfo.
Definition in file SIInstrInfo.cpp.
Definition at line 36 of file SIInstrInfo.cpp.
#define GET_D16ImageDimIntrinsics_IMPL |
Definition at line 46 of file SIInstrInfo.cpp.
#define GET_ImageDimIntrinsicTable_IMPL |
Definition at line 47 of file SIInstrInfo.cpp.
#define GET_INSTRINFO_CTOR_DTOR |
Definition at line 38 of file SIInstrInfo.cpp.
#define GET_RsrcIntrinsics_IMPL |
Definition at line 48 of file SIInstrInfo.cpp.
enum SIEncodingFamily |
Enumerator | |
---|---|
SI | |
VI | |
SDWA | |
SDWA9 | |
GFX80 | |
GFX9 | |
GFX10 | |
SDWA10 | |
GFX90A | |
GFX940 | |
GFX11 |
Definition at line 7859 of file SIInstrInfo.cpp.
|
static |
Definition at line 4767 of file SIInstrInfo.cpp.
References llvm::SIInstrFlags::DS, llvm::SIRegisterInfo::getProperlyAlignedRC(), llvm::SIRegisterInfo::getRegClass(), llvm::MCInstrDesc::mayLoad(), llvm::MCInstrDesc::mayStore(), llvm::SIInstrFlags::MIMG, MRI, llvm::MachineRegisterInfo::reservedRegsFrozen(), llvm::MCInstrDesc::TSFlags, and llvm::SIInstrFlags::VGPRSpill.
Referenced by llvm::SIInstrInfo::getOpRegClass(), and llvm::SIInstrInfo::getRegClass().
|
static |
Definition at line 3454 of file SIInstrInfo.cpp.
References MI.
Referenced by llvm::SIInstrInfo::isSchedulingBoundary().
|
static |
Definition at line 3707 of file SIInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getType(), llvm_unreachable, llvm::MachineOperand::MO_Immediate, and llvm::MachineOperand::MO_Register.
Referenced by llvm::SIInstrInfo::verifyInstruction().
|
static |
Definition at line 3839 of file SIInstrInfo.cpp.
References llvm::MachineOperand::isKill(), llvm::MachineOperand::isUndef(), and MI.
Referenced by llvm::SIInstrInfo::buildShrunkInst().
|
static |
Definition at line 5474 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), DL, llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::TargetRegisterInfo::getRegClass(), llvm::TargetRegisterInfo::getRegSizeInBits(), llvm::MachineFunction::getSubtarget(), llvm::getUndefRegState(), I, llvm::MachineOperand::isUndef(), llvm::RegState::Kill, Merge, MRI, RegSize, llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setReg(), llvm::MachineRegisterInfo::setSimpleHint(), TII, and TRI.
|
static |
Definition at line 666 of file SIInstrInfo.cpp.
References llvm::MachineInstr::addOperand(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MachineOperand::CreateReg(), DL, llvm::SIRegisterInfo::getChannelFromSubReg(), llvm::SIRegisterInfo::getRegSplitParts(), llvm::SIRegisterInfo::getSubRegFromChannel(), I, llvm::RegState::Implicit, MBB, MI, llvm::ArrayRef< T >::size(), std::swap(), and TII.
Referenced by llvm::SIInstrInfo::copyPhysReg().
|
static |
Definition at line 5670 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), MBB, MI, MRI, and TII.
|
static |
Definition at line 3931 of file SIInstrInfo.cpp.
References llvm::M0(), and MI.
Referenced by llvm::SIInstrInfo::legalizeOperandsVOP2(), and llvm::SIInstrInfo::verifyInstruction().
|
static |
Definition at line 7993 of file SIInstrInfo.cpp.
References getRegOrUndef(), llvm::getRegSequenceSubReg(), MI, llvm::TargetInstrInfo::RegSubRegPair::Reg, and llvm::TargetInstrInfo::RegSubRegPair::SubReg.
Referenced by llvm::getVRegSubRegDef().
|
static |
Definition at line 1630 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::loadRegFromStackSlot().
|
static |
Definition at line 1463 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::storeRegToStackSlot().
|
static |
Definition at line 1657 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::loadRegFromStackSlot().
|
static |
Definition at line 1490 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::storeRegToStackSlot().
|
static |
Definition at line 3225 of file SIInstrInfo.cpp.
References DefMI, getFoldableImm(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::RISCVMatInt::Imm, llvm::MachineOperand::isReg(), and MRI.
|
static |
Definition at line 3211 of file SIInstrInfo.cpp.
References llvm::tgtok::Def, DefMI, llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::RISCVMatInt::Imm, llvm::SIInstrInfo::isFoldableCopy(), and MRI.
Referenced by llvm::SIInstrInfo::convertToThreeAddress(), getFoldableImm(), and llvm::SIInstrInfo::optimizeCompareInstr().
|
static |
Definition at line 1355 of file SIInstrInfo.cpp.
References llvm_unreachable, and llvm::ARMII::VecSize.
Referenced by llvm::SIInstrInfo::getIndirectRegWriteMovRelPseudo().
|
static |
Definition at line 1376 of file SIInstrInfo.cpp.
References llvm_unreachable, and llvm::ARMII::VecSize.
Referenced by llvm::SIInstrInfo::getIndirectRegWriteMovRelPseudo().
|
static |
Definition at line 1334 of file SIInstrInfo.cpp.
References llvm_unreachable, and llvm::ARMII::VecSize.
Referenced by llvm::SIInstrInfo::getIndirectRegWriteMovRelPseudo().
|
static |
Definition at line 77 of file SIInstrInfo.cpp.
Referenced by llvm::SIInstrInfo::areLoadsFromSameBasePtr().
|
static |
Definition at line 7974 of file SIInstrInfo.cpp.
References assert(), llvm::getRegSubRegPair(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::isUndef().
Referenced by followSubRegDef(), and llvm::getRegSequenceSubReg().
|
static |
Definition at line 1576 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::loadRegFromStackSlot().
|
static |
Definition at line 1409 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::storeRegToStackSlot().
|
static |
Definition at line 1603 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::loadRegFromStackSlot().
|
static |
Definition at line 1436 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::storeRegToStackSlot().
|
static |
Handle copying from SGPR to AGPR, or from AGPR to AGPR on GFX908.
It is not possible to have a direct copy in these cases on GFX908, so an intermediate VGPR copy is required.
Definition at line 556 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::MachineBasicBlock::begin(), Builder, llvm::BuildMI(), contains(), llvm::tgtok::Def, llvm::RegState::Define, DL, E, llvm::RegScavenger::enterBasicBlock(), llvm::RegScavenger::FindUnusedReg(), llvm::RegScavenger::forward(), llvm::SIRegisterInfo::getHWRegIndex(), llvm::MachineFunction::getInfo(), llvm::getKillRegState(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::SIRegisterInfo::getRegPressureLimit(), I, llvm::RegState::Implicit, llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), llvm::MachineRegisterInfo::isReserved(), llvm::RegState::Kill, MBB, MI, llvm::RegScavenger::scavengeRegister(), llvm::MachineOperand::setIsKill(), llvm::RegScavenger::setRegUsed(), and TII.
Referenced by llvm::SIInstrInfo::copyPhysReg().
|
static |
Definition at line 285 of file SIInstrInfo.cpp.
Referenced by llvm::SIInstrInfo::getMemOperandsWithOffsetWidth().
|
static |
Definition at line 3973 of file SIInstrInfo.cpp.
References llvm::MachineOperand::getReg(), llvm::MCRegisterInfo::isSubRegister(), SubReg, and TRI.
Referenced by llvm::SIInstrInfo::verifyInstruction().
|
static |
Definition at line 5584 of file SIInstrInfo.cpp.
Referenced by llvm::SIInstrInfo::legalizeOperands().
|
static |
Definition at line 3118 of file SIInstrInfo.cpp.
References E, I, and llvm::ArrayRef< T >::size().
|
static |
Definition at line 453 of file SIInstrInfo.cpp.
References llvm::ArrayRef< T >::front(), llvm::getUnderlyingObject(), llvm::MachineInstr::hasOneMemOperand(), llvm::MachineOperand::isIdenticalTo(), and llvm::MachineInstr::memoperands_begin().
Referenced by llvm::SIInstrInfo::shouldClusterMemOps().
Returns true if both nodes have the same value for the given operand Op
, or if both nodes do not have this operand.
Definition at line 86 of file SIInstrInfo.cpp.
References llvm::SDNode::getMachineOpcode(), llvm::AMDGPU::getNamedOperandIdx(), and llvm::SDNode::getOperand().
Referenced by llvm::SIInstrInfo::areLoadsFromSameBasePtr().
Definition at line 3129 of file SIInstrInfo.cpp.
|
static |
Definition at line 2642 of file SIInstrInfo.cpp.
References llvm::MachineOperand::isKill(), llvm::MachineOperand::isUndef(), llvm::MachineOperand::setIsKill(), and llvm::MachineOperand::setIsUndef().
Referenced by llvm::SIInstrInfo::insertBranch(), and llvm::SIInstrInfo::insertSelect().
|
static |
Definition at line 539 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::LLVMContext::diagnose(), DL, llvm::DS_Error, llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::getKillRegState(), llvm::MachineBasicBlock::getParent(), MBB, MI, llvm::AMDGPU::SendMsg::Msg, and TII.
Referenced by llvm::SIInstrInfo::copyPhysReg().
|
static |
Definition at line 134 of file SIInstrInfo.cpp.
References llvm::Register::isVirtual(), MI, MRI, and llvm::MachineRegisterInfo::use_nodbg_instructions().
Referenced by llvm::SIInstrInfo::isIgnorableUse().
|
static |
Definition at line 3953 of file SIInstrInfo.cpp.
References llvm::SIInstrInfo::isSALU(), llvm::SIInstrInfo::isSMRD(), llvm::SIInstrInfo::isVALU(), and MI.
Referenced by llvm::SIInstrInfo::verifyInstruction().
|
static |
Definition at line 7873 of file SIInstrInfo.cpp.
References llvm::AMDGPUSubtarget::GFX10, GFX10, llvm::AMDGPUSubtarget::GFX11, GFX11, llvm::AMDGPUSubtarget::GFX9, llvm_unreachable, llvm::AMDGPUSubtarget::SEA_ISLANDS, SI, llvm::AMDGPUSubtarget::SOUTHERN_ISLANDS, VI, and llvm::AMDGPUSubtarget::VOLCANIC_ISLANDS.
Referenced by llvm::SIInstrInfo::pseudoToMCOpcode().
|
static |
Definition at line 2254 of file SIInstrInfo.cpp.
References llvm::MachineOperand::ChangeToFrameIndex(), llvm::MachineOperand::ChangeToGA(), llvm::MachineOperand::ChangeToImmediate(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getImm(), llvm::MachineOperand::getIndex(), llvm::MachineOperand::getOffset(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::getTargetFlags(), IsDead, llvm::MachineOperand::isDead(), llvm::MachineOperand::isDebug(), llvm::MachineOperand::isFI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isUndef(), MI, llvm::MachineOperand::setSubReg(), llvm::MachineOperand::setTargetFlags(), and SubReg.
Referenced by llvm::SIInstrInfo::commuteInstructionImpl().
|
static |
Definition at line 3234 of file SIInstrInfo.cpp.
References I, MI, and llvm::LiveVariables::replaceKillInstruction().
Referenced by llvm::SIInstrInfo::convertToThreeAddress().
|
static |
Referenced by llvm::SIInstrInfo::isBranchOffsetInRange().
|
static |
Referenced by llvm::SIInstrInfo::copyPhysReg().
|
staticconstexpr |
Definition at line 2890 of file SIInstrInfo.cpp.
Referenced by llvm::SIInstrInfo::hasAnyModifiersSet(), and llvm::SIInstrInfo::removeModOperands().