[PATCH] D122367: [AMDGPU] [NFC] Introduce subtargets check for MI hardware.
Mahesha S via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 24 17:13:36 PDT 2022
hsmhsm updated this revision to Diff 418090.
hsmhsm added a comment.
Fix review comments by Stas.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122367/new/
https://reviews.llvm.org/D122367
Files:
llvm/lib/Target/AMDGPU/GCNSubtarget.h
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
Index: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -697,7 +697,7 @@
// On GFX908, in order to guarantee copying between AGPRs, we need a scratch
// VGPR available at all times.
- if (ST.hasMAIInsts() && !ST.hasGFX90AInsts()) {
+ if (ST.isGFX908Subtarget()) {
reserveRegisterTuples(Reserved, AMDGPU::VGPR32);
}
Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -551,8 +551,7 @@
RegScavenger &RS,
Register ImpDefSuperReg = Register(),
Register ImpUseSuperReg = Register()) {
- assert((TII.getSubtarget().hasMAIInsts() &&
- !TII.getSubtarget().hasGFX90AInsts()) &&
+ assert(TII.getSubtarget().isGFX908Subtarget() &&
"Expected GFX908 subtarget.");
assert((AMDGPU::SReg_32RegClass.contains(SrcReg) ||
Index: llvm/lib/Target/AMDGPU/GCNSubtarget.h
===================================================================
--- llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -990,6 +990,12 @@
// hasGFX90AInsts is also true.
bool hasGFX940Insts() const { return GFX940Insts; }
+ bool isGFX908Subtarget() const { return HasMAIInsts && !GFX90AInsts; };
+
+ bool isGFX90ASubtarget() const { return GFX90AInsts && !GFX940Insts; };
+
+ bool isGFX940Subtarget() const { return GFX940Insts; };
+
/// Return the maximum number of waves per SIMD for kernels using \p SGPRs
/// SGPRs
unsigned getOccupancyWithNumSGPRs(unsigned SGPRs) const;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122367.418090.patch
Type: text/x-patch
Size: 1828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220325/56329b0d/attachment.bin>
More information about the llvm-commits
mailing list