LLVM 20.0.0git
|
This file implements the targeting of the InstructionSelector class for AMDGPU. More...
#include "AMDGPUInstructionSelector.h"
#include "AMDGPU.h"
#include "AMDGPUGlobalISelUtils.h"
#include "AMDGPUInstrInfo.h"
#include "AMDGPURegisterBankInfo.h"
#include "AMDGPUTargetMachine.h"
#include "SIMachineFunctionInfo.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h"
#include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
#include "llvm/CodeGen/GlobalISel/MIPatternMatch.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include <optional>
#include "AMDGPUGenGlobalISel.inc"
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 |
This file implements the targeting of the InstructionSelector class for AMDGPU.
Definition in file AMDGPUInstructionSelector.cpp.
#define AMDGPUSubtarget GCNSubtarget |
Definition at line 38 of file AMDGPUInstructionSelector.cpp.
#define DEBUG_TYPE "amdgpu-isel" |
Definition at line 32 of file AMDGPUInstructionSelector.cpp.
#define GET_GLOBALISEL_IMPL |
Definition at line 37 of file AMDGPUInstructionSelector.cpp.
#define GET_GLOBALISEL_PREDICATES_INIT |
#define GET_GLOBALISEL_TEMPORARIES_INIT |
|
static |
Definition at line 5368 of file AMDGPUInstructionSelector.cpp.
References llvm::MachineInstrBuilder::addImm().
|
static |
Definition at line 3648 of file AMDGPUInstructionSelector.cpp.
References BitOp3_Op(), llvm::getSrcRegIgnoringCopies(), I, LHS, llvm::MIPatternMatch::m_AllOnesInt(), llvm::PatternMatch::m_Not(), llvm::MIPatternMatch::m_Reg(), llvm::PatternMatch::m_ZeroInt(), MI, llvm::MIPatternMatch::mi_match(), MRI, and RHS.
Referenced by BitOp3_Op().
|
static |
Definition at line 5417 of file AMDGPUInstructionSelector.cpp.
References B, buildRSRC(), llvm::Hi_32(), MRI, and TII.
|
static |
Definition at line 5426 of file AMDGPUInstructionSelector.cpp.
References B, buildRSRC(), llvm::Hi_32(), MRI, and TII.
|
static |
Definition at line 4279 of file AMDGPUInstructionSelector.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), B, llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::SIRegisterInfo::getSubRegFromChannel(), llvm_unreachable, MRI, and llvm::SmallVectorBase< Size_T >::size().
Referenced by selectWMMAModsNegAbs().
|
static |
Return a resource descriptor for use with an arbitrary 64-bit pointer.
If BasePtr
is not valid, a null base pointer will be used.
Definition at line 5374 of file AMDGPUInstructionSelector.cpp.
Referenced by buildAddr64RSrc(), and buildOffsetSrc().
|
static |
Return the register to use for the index value, and the subregister to use for the indirectly accessed register.
Definition at line 3083 of file AMDGPUInstructionSelector.cpp.
References assert(), llvm::AMDGPU::getBaseWithConstantOffset(), MRI, llvm::Offset, llvm::ArrayRef< T >::size(), and TRI.
|
static |
Get an immediate that must be 32-bits, and treated as zero extended.
Definition at line 5646 of file AMDGPUInstructionSelector.cpp.
References llvm::getIConstantVRegSExtVal(), llvm::Lo_32(), and MRI.
Definition at line 292 of file AMDGPUInstructionSelector.cpp.
References llvm_unreachable.
unsigned getNamedBarrierOp | ( | bool | HasInlineConst, |
Intrinsic::ID | IntrID | ||
) |
Definition at line 5834 of file AMDGPUInstructionSelector.cpp.
References llvm_unreachable.
|
static |
Definition at line 1116 of file AMDGPUInstructionSelector.cpp.
References llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm_unreachable, P, Select, and Size.
|
static |
Definition at line 70 of file AMDGPUInstructionSelector.cpp.
Definition at line 1730 of file AMDGPUInstructionSelector.cpp.
References llvm_unreachable.
|
static |
Definition at line 2780 of file AMDGPUInstructionSelector.cpp.
References MI.
Referenced by arePointersCompatible(), llvm::buildModuleSummaryIndex(), llvm::MDBuilder::createTBAANode(), llvm::HexagonInstrInfo::expandPostRAPseudo(), llvm::slpvectorizer::BoUpSLP::findReusedOrderedScalars(), getMemcpyLoadsAndStores(), isSimpleVIDSequence(), and tryFoldHelper().
|
static |
Definition at line 2622 of file AMDGPUInstructionSelector.cpp.
References assert(), llvm::LLT::fixed_vector(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getShuffleMask(), llvm::MIPatternMatch::m_GLShr(), llvm::MIPatternMatch::m_GTrunc(), llvm::MIPatternMatch::m_Reg(), llvm::MIPatternMatch::m_SpecificICst(), llvm::MIPatternMatch::mi_match(), MRI, stripBitCast(), and stripCopy().
Referenced by buildRegSequence16().
|
static |
Definition at line 1466 of file AMDGPUInstructionSelector.cpp.
References llvm::RegisterBank::getID(), isLaneMaskFromSameBlock(), LHS, llvm::MIPatternMatch::m_GAnd(), llvm::MIPatternMatch::m_Reg(), MBB, MI, llvm::MIPatternMatch::mi_match(), MRI, and RHS.
Referenced by isLaneMaskFromSameBlock().
|
static |
Definition at line 5092 of file AMDGPUInstructionSelector.cpp.
References Addr, and llvm::MachineInstr::NoUWrap.
|
static |
Definition at line 2877 of file AMDGPUInstructionSelector.cpp.
References isVCmpResult(), MI, and MRI.
Referenced by isVCmpResult().
|
static |
Match a zero extend from a 32-bit value to 64-bits.
Definition at line 3374 of file AMDGPUInstructionSelector.cpp.
References assert(), llvm::getDefIgnoringCopies(), llvm::MIPatternMatch::m_GZExt(), llvm::MIPatternMatch::m_Reg(), llvm::PatternMatch::m_ZeroInt(), llvm::MIPatternMatch::mi_match(), MRI, and llvm::LLT::scalar().
Definition at line 1913 of file AMDGPUInstructionSelector.cpp.
|
static |
Definition at line 4307 of file AMDGPUInstructionSelector.cpp.
References assert(), buildRegSequence(), llvm::MIPatternMatch::m_GFabs(), llvm::MIPatternMatch::m_Reg(), llvm::MIPatternMatch::mi_match(), MRI, llvm::SISrcMods::NEG, llvm::SISrcMods::NEG_HI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
Size
bits will be an inline immediate. Definition at line 2441 of file AMDGPUInstructionSelector.cpp.
References Size.
|
static |
Definition at line 2615 of file AMDGPUInstructionSelector.cpp.
References llvm::MIPatternMatch::m_GBitcast(), llvm::MIPatternMatch::m_Reg(), llvm::MIPatternMatch::mi_match(), and MRI.
Referenced by isExtractHiElt().
|
static |
Definition at line 2611 of file AMDGPUInstructionSelector.cpp.
References llvm::getDefSrcRegIgnoringCopies(), and MRI.
Referenced by isExtractHiElt().