[llvm] b35d0a6 - [AMDGPU] Add switch to enable architected SGPRs.
Christudasan Devadasan via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 13 08:41:24 PST 2023
Author: Christudasan Devadasan
Date: 2023-02-13T22:10:54+05:30
New Revision: b35d0a6834f8d648ef03a15fba43847b99863a60
URL: https://github.com/llvm/llvm-project/commit/b35d0a6834f8d648ef03a15fba43847b99863a60
DIFF: https://github.com/llvm/llvm-project/commit/b35d0a6834f8d648ef03a15fba43847b99863a60.diff
LOG: [AMDGPU] Add switch to enable architected SGPRs.
Reviewed By: rampitec, foad
Differential Revision: https://reviews.llvm.org/D143706
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/lib/Target/AMDGPU/GCNSubtarget.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 9cc1a4c84a799..b8eb57169cee9 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -866,6 +866,12 @@ def FeatureArchitectedFlatScratch : SubtargetFeature<"architected-flat-scratch",
"Flat Scratch register is a readonly SPI initialized architected register"
>;
+def FeatureArchitectedSGPRs : SubtargetFeature<"architected-sgprs",
+ "HasArchitectedSGPRs",
+ "true",
+ "Enable the architected SGPRs"
+>;
+
// Dummy feature used to disable assembler instructions.
def FeatureDisable : SubtargetFeature<"",
"FeatureDisable","true",
diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
index 4177a8307ad8e..cb712b205e166 100644
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -175,6 +175,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
bool ScalarFlatScratchInsts = false;
bool HasArchitectedFlatScratch = false;
bool EnableFlatScratch = false;
+ bool HasArchitectedSGPRs = false;
bool AddNoCarryInsts = false;
bool HasUnpackedD16VMem = false;
bool LDSMisalignedBug = false;
@@ -1132,6 +1133,9 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
/// In this case it is readonly.
bool flatScratchIsArchitected() const { return HasArchitectedFlatScratch; }
+ /// \returns true if the architected SGPRs are enabled.
+ bool hasArchitectedSGPRs() const { return HasArchitectedSGPRs; }
+
/// \returns true if the machine has merged shaders in which s0-s7 are
/// reserved by the hardware and user SGPRs start at s8
bool hasMergedShaders() const {
More information about the llvm-commits
mailing list