|
LLVM 23.0.0git
|
SI Implementation of TargetInstrInfo. More...
#include "SIInstrInfo.h"#include "AMDGPU.h"#include "AMDGPUInstrInfo.h"#include "AMDGPULaneMaskUtils.h"#include "GCNHazardRecognizer.h"#include "GCNSubtarget.h"#include "SIMachineFunctionInfo.h"#include "Utils/AMDGPUBaseInfo.h"#include "llvm/ADT/STLExtras.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"#include "llvm/CodeGen/LiveIntervals.h"#include "llvm/CodeGen/LiveVariables.h"#include "llvm/CodeGen/MachineCycleAnalysis.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.
Classes | |
| struct | llvm::SIInstrInfo::ThreeAddressUpdates |
| Helper struct for the implementation of 3-address conversion to communicate updates made to instruction operands. More... | |
Namespaces | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
| namespace | 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 |
| #define | GENERATE_RENAMED_GFX9_CASES(OPCODE) |
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 AMDGPU::OpName | ModifierOpNames [] |
SI Implementation of TargetInstrInfo.
Definition in file SIInstrInfo.cpp.
| #define DEBUG_TYPE "si-instr-info" |
Definition at line 41 of file SIInstrInfo.cpp.
| #define GENERATE_RENAMED_GFX9_CASES | ( | OPCODE | ) |
Definition at line 10348 of file SIInstrInfo.cpp.
Referenced by isRenamedInGFX9().
| #define GET_D16ImageDimIntrinsics_IMPL |
Definition at line 47 of file SIInstrInfo.cpp.
| #define GET_ImageDimIntrinsicTable_IMPL |
Definition at line 48 of file SIInstrInfo.cpp.
| #define GET_INSTRINFO_CTOR_DTOR |
Definition at line 43 of file SIInstrInfo.cpp.
| #define GET_RsrcIntrinsics_IMPL |
Definition at line 49 of file SIInstrInfo.cpp.
|
static |
Definition at line 112 of file SIInstrInfo.cpp.
References llvm::all_of(), llvm::SIInstrInfo::isSALU(), llvm::SIInstrInfo::isSDWA(), llvm::SIInstrInfo::isSMRD(), llvm::SIInstrInfo::isVOP1(), llvm::SIInstrInfo::isVOP2(), llvm::SIInstrInfo::isVOP3(), and MI.
Referenced by llvm::SIInstrInfo::isReMaterializableImpl().
|
static |
Definition at line 4510 of file SIInstrInfo.cpp.
References MI.
Referenced by llvm::SIInstrInfo::isSchedulingBoundary().
|
static |
Definition at line 4860 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 5013 of file SIInstrInfo.cpp.
References llvm::MachineOperand::isKill(), llvm::MachineOperand::isUndef(), and MI.
Referenced by llvm::SIInstrInfo::buildShrunkInst().
|
static |
Definition at line 7104 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::AMDGPU::LaneMaskConstants::AndOpc, llvm::AMDGPU::LaneMaskConstants::AndSaveExecOpc, assert(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), DL, llvm::MachineBasicBlock::end(), llvm::AMDGPU::LaneMaskConstants::ExecReg, llvm::AMDGPU::LaneMaskConstants::get(), llvm::MachineBasicBlock::getParent(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getSubtarget(), llvm::getUndefRegState(), I, llvm::Kill, Merge, llvm::SmallVectorTemplateBase< T, bool >::push_back(), RegSize, llvm::MachineRegisterInfo::setSimpleHint(), TII, TRI, and llvm::AMDGPU::LaneMaskConstants::XorTermOpc.
Referenced by loadScalarOperandsFromVGPR().
|
static |
Definition at line 768 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::Implicit, MBB, MI, llvm::ArrayRef< T >::size(), std::swap(), and TII.
Referenced by llvm::SIInstrInfo::copyPhysReg().
|
static |
Definition at line 7351 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::MachineFunction::getRegInfo(), llvm::Hi_32(), llvm::Lo_32(), MBB, MI, and TII.
Referenced by llvm::SIInstrInfo::legalizeOperands().
|
static |
Definition at line 5108 of file SIInstrInfo.cpp.
Referenced by llvm::SIInstrInfo::legalizeOperandsVOP2(), and llvm::SIInstrInfo::verifyInstruction().
|
static |
Definition at line 11057 of file SIInstrInfo.cpp.
Referenced by llvm::SIInstrInfo::optimizeCompareInstr().
|
static |
Definition at line 10471 of file SIInstrInfo.cpp.
References getRegOrUndef(), llvm::getRegSequenceSubReg(), MI, llvm::TargetInstrInfo::RegSubRegPair::Reg, and llvm::TargetInstrInfo::RegSubRegPair::SubReg.
Referenced by llvm::getVRegSubRegDef().
Definition at line 1846 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::getVectorRegSpillRestoreOpcode().
Definition at line 1655 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::getVectorRegSpillSaveOpcode().
|
static |
Definition at line 4159 of file SIInstrInfo.cpp.
References DefMI, getFoldableImm(), llvm::MachineInstr::getMF(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), and llvm::MachineOperand::isReg().
|
static |
Definition at line 4145 of file SIInstrInfo.cpp.
References DefMI, llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::SIInstrInfo::isFoldableCopy(), and Reg.
Referenced by getFoldableImm(), llvm::SIInstrInfo::optimizeCompareInstr(), and setsSCCIfResultIsZero().
Definition at line 1517 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::getIndirectRegWriteMovRelPseudo().
Definition at line 1550 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::getIndirectRegWriteMovRelPseudo().
Definition at line 1484 of file SIInstrInfo.cpp.
References llvm_unreachable.
Referenced by llvm::SIInstrInfo::getIndirectRegWriteMovRelPseudo().
|
static |
Definition at line 3629 of file SIInstrInfo.cpp.
References llvm_unreachable, and Opc.
Referenced by llvm::SIInstrInfo::foldImmediate().
|
static |
Definition at line 4180 of file SIInstrInfo.cpp.
References llvm_unreachable, and Opc.
|
static |
Definition at line 3663 of file SIInstrInfo.cpp.
References llvm_unreachable, and Opc.
Referenced by llvm::SIInstrInfo::foldImmediate().
Definition at line 77 of file SIInstrInfo.cpp.
References N.
Referenced by llvm::SIInstrInfo::areLoadsFromSameBasePtr().
|
static |
Definition at line 10452 of file SIInstrInfo.cpp.
References assert(), llvm::getRegSubRegPair(), llvm::MachineOperand::isReg(), and llvm::MachineOperand::isUndef().
Referenced by followSubRegDef(), and llvm::getRegSequenceSubReg().
Definition at line 1774 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::loadRegFromStackSlot().
Definition at line 1583 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::storeRegToStackSlot().
Definition at line 1809 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::getVectorRegSpillRestoreOpcode().
Definition at line 1618 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::getVectorRegSpillSaveOpcode().
Definition at line 1881 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::getVectorRegSpillRestoreOpcode().
Definition at line 1690 of file SIInstrInfo.cpp.
References llvm_unreachable, and Size.
Referenced by llvm::SIInstrInfo::getVectorRegSpillSaveOpcode().
|
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 648 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), contains(), llvm::Define, DL, E(), llvm::SIRegisterInfo::getHWRegIndex(), llvm::getKillRegState(), llvm::MachineOperand::getReg(), llvm::SIRegisterInfo::getRegPressureLimit(), I, llvm::Implicit, llvm::MachineOperand::isImm(), llvm::MachineOperand::isReg(), llvm::Kill, MBB, MI, and TII.
Referenced by llvm::SIInstrInfo::copyPhysReg().
|
static |
Definition at line 5152 of file SIInstrInfo.cpp.
References llvm::MachineOperand::isFI(), and llvm::MachineOperand::isReg().
Referenced by llvm::SIInstrInfo::verifyInstruction().
|
static |
Definition at line 10355 of file SIInstrInfo.cpp.
References GENERATE_RENAMED_GFX9_CASES.
Referenced by llvm::SIInstrInfo::pseudoToMCOpcode().
|
static |
Definition at line 10969 of file SIInstrInfo.cpp.
References MBB.
Definition at line 358 of file SIInstrInfo.cpp.
References Opc.
Referenced by llvm::SIInstrInfo::getMemOperandsWithOffsetWidth().
|
static |
Definition at line 5156 of file SIInstrInfo.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::Register::isPhysical(), and TRI.
Referenced by llvm::SIInstrInfo::verifyInstruction().
|
static |
Definition at line 7244 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::DominatorTreeBase< NodeT, IsPostDom >::addNewBlock(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::DominatorTreeBase< NodeT, IsPostDom >::changeImmediateDominator(), llvm::MachineRegisterInfo::clearKillFlags(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineRegisterInfo::createVirtualRegister(), DL, emitLoadScalarOpsFromVGPRLoop(), llvm::AMDGPU::LaneMaskConstants::ExecReg, llvm::First, llvm::AMDGPU::LaneMaskConstants::get(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), I, llvm::MachineFunction::insert(), llvm::Kill, llvm::MachineBasicBlock::LQR_Dead, MBB, MBBI, MI, llvm::AMDGPU::LaneMaskConstants::MovOpc, llvm::DominatorTreeBase< NodeT, IsPostDom >::properlyDominates(), llvm::MachineBasicBlock::splice(), llvm::MachineBasicBlock::successors(), TII, llvm::MachineBasicBlock::transferSuccessorsAndUpdatePHIs(), and TRI.
Referenced by llvm::SIInstrInfo::legalizeOperands().
|
static |
Definition at line 4033 of file SIInstrInfo.cpp.
References E(), I, and llvm::ArrayRef< T >::size().
|
static |
Definition at line 536 of file SIInstrInfo.cpp.
References llvm::ArrayRef< T >::front(), llvm::getUnderlyingObject(), llvm::MachineInstr::hasOneMemOperand(), llvm::isa(), and llvm::MachineInstr::memoperands_begin().
Referenced by llvm::RISCVInstrInfo::shouldClusterMemOps(), and 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(), and llvm::SDNode::getOperand().
Referenced by llvm::SIInstrInfo::areLoadsFromSameBasePtr().
|
static |
Definition at line 4044 of file SIInstrInfo.cpp.
References llvm::LocationSize::getValue(), and llvm::LocationSize::hasValue().
|
static |
Definition at line 3306 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 631 of file SIInstrInfo.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::CallingConv::C, DL, llvm::DS_Error, llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::getKillRegState(), MBB, MI, and TII.
Referenced by llvm::SIInstrInfo::copyPhysReg().
|
static |
Definition at line 11070 of file SIInstrInfo.cpp.
References getFoldableImm(), llvm::MachineOperand::getImm(), llvm::MachineOperand::isDead(), and llvm::MachineOperand::isImm().
Referenced by llvm::SIInstrInfo::optimizeCompareInstr().
|
static |
Definition at line 5130 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 10304 of file SIInstrInfo.cpp.
References llvm::AMDGPUSubtarget::GFX10, llvm::SIEncodingFamily::GFX10, llvm::AMDGPUSubtarget::GFX11, llvm::SIEncodingFamily::GFX11, llvm::SIEncodingFamily::GFX1170, llvm::AMDGPUSubtarget::GFX12, llvm::SIEncodingFamily::GFX12, llvm::SIEncodingFamily::GFX1250, llvm::AMDGPUSubtarget::GFX13, llvm::SIEncodingFamily::GFX13, llvm::AMDGPUSubtarget::GFX9, llvm_unreachable, llvm::AMDGPUSubtarget::SEA_ISLANDS, llvm::SIEncodingFamily::SI, llvm::AMDGPUSubtarget::SOUTHERN_ISLANDS, llvm::SIEncodingFamily::VI, and llvm::AMDGPUSubtarget::VOLCANIC_ISLANDS.
Referenced by llvm::SIInstrInfo::pseudoToMCOpcode().
|
static |
Definition at line 2854 of file SIInstrInfo.cpp.
References llvm::MachineOperand::getImm(), llvm::MachineOperand::getTargetFlags(), MI, llvm::MachineOperand::setImm(), and llvm::MachineOperand::setTargetFlags().
Referenced by llvm::SIInstrInfo::commuteInstructionImpl().
|
static |
Definition at line 2825 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, Reg, llvm::MachineOperand::setSubReg(), and llvm::MachineOperand::setTargetFlags().
Referenced by llvm::SIInstrInfo::commuteInstructionImpl().
|
static |
Definition at line 4168 of file SIInstrInfo.cpp.
References AbstractManglingParser< Derived, Alloc >::NumOps, 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 3576 of file SIInstrInfo.cpp.
Referenced by llvm::SIInstrInfo::hasAnyModifiersSet(), and llvm::SIInstrInfo::removeModOperands().