Skip to content

Commit dcaa29c

Browse files
authored
Revert "[AMDGPU][gfx1250] Add cu-store subtarget feature (#150588)" (#157639)
This reverts commit be17791. This is not necessary for gfx1250 anymore.
1 parent bed9be9 commit dcaa29c

File tree

13 files changed

+9
-141
lines changed

13 files changed

+9
-141
lines changed

llvm/docs/AMDGPUUsage.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,6 @@ For example:
768768
performant than code generated for XNACK replay
769769
disabled.
770770

771-
cu-stores TODO On GFX12.5, controls whether ``scope:SCOPE_CU`` stores may be used.
772-
If disabled, all stores will be done at ``scope:SCOPE_SE`` or greater.
773-
774771
=============== ============================ ==================================================
775772

776773
.. _amdgpu-target-id:
@@ -5114,9 +5111,7 @@ The fields used by CP for code objects before V3 also match those specified in
51145111
and must be 0,
51155112
>454 1 bit ENABLE_SGPR_PRIVATE_SEGMENT
51165113
_SIZE
5117-
455 1 bit USES_CU_STORES GFX12.5: Whether the ``cu-stores`` target attribute is enabled.
5118-
If 0, then all stores are ``SCOPE_SE`` or higher.
5119-
457:456 2 bits Reserved, must be 0.
5114+
457:455 3 bits Reserved, must be 0.
51205115
458 1 bit ENABLE_WAVEFRONT_SIZE32 GFX6-GFX9
51215116
Reserved, must be 0.
51225117
GFX10-GFX11
@@ -18254,8 +18249,6 @@ terminated by an ``.end_amdhsa_kernel`` directive.
1825418249
GFX942)
1825518250
``.amdhsa_user_sgpr_private_segment_size`` 0 GFX6-GFX12 Controls ENABLE_SGPR_PRIVATE_SEGMENT_SIZE in
1825618251
:ref:`amdgpu-amdhsa-kernel-descriptor-v3-table`.
18257-
``.amdhsa_uses_cu_stores`` 0 GFX12.5 Controls USES_CU_STORES in
18258-
:ref:`amdgpu-amdhsa-kernel-descriptor-v3-table`.
1825918252
``.amdhsa_wavefront_size32`` Target GFX10-GFX12 Controls ENABLE_WAVEFRONT_SIZE32 in
1826018253
Feature :ref:`amdgpu-amdhsa-kernel-descriptor-v3-table`.
1826118254
Specific

llvm/include/llvm/Support/AMDHSAKernelDescriptor.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ enum : int32_t {
252252
KERNEL_CODE_PROPERTY(ENABLE_SGPR_DISPATCH_ID, 4, 1),
253253
KERNEL_CODE_PROPERTY(ENABLE_SGPR_FLAT_SCRATCH_INIT, 5, 1),
254254
KERNEL_CODE_PROPERTY(ENABLE_SGPR_PRIVATE_SEGMENT_SIZE, 6, 1),
255-
KERNEL_CODE_PROPERTY(RESERVED0, 7, 2),
256-
KERNEL_CODE_PROPERTY(USES_CU_STORES, 9, 1), // GFX12.5 +cu-stores
255+
KERNEL_CODE_PROPERTY(RESERVED0, 7, 3),
257256
KERNEL_CODE_PROPERTY(ENABLE_WAVEFRONT_SIZE32, 10, 1), // GFX10+
258257
KERNEL_CODE_PROPERTY(USES_DYNAMIC_STACK, 11, 1),
259258
KERNEL_CODE_PROPERTY(RESERVED1, 12, 4),

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,6 @@ def FeatureSafeCUPrefetch : SubtargetFeature<"safe-cu-prefetch",
289289
"VMEM CU scope prefetches do not fail on illegal address"
290290
>;
291291

292-
def FeatureCUStores : SubtargetFeature<"cu-stores",
293-
"HasCUStores",
294-
"true",
295-
"Whether SCOPE_CU stores can be used on GFX12.5"
296-
>;
297-
298292
def FeatureVcmpxExecWARHazard : SubtargetFeature<"vcmpx-exec-war-hazard",
299293
"HasVcmpxExecWARHazard",
300294
"true",
@@ -2042,7 +2036,6 @@ def FeatureISAVersion12_50 : FeatureSet<
20422036
[FeatureGFX12,
20432037
FeatureGFX1250Insts,
20442038
FeatureRequiresAlignedVGPRs,
2045-
FeatureCUStores,
20462039
FeatureAddressableLocalMemorySize327680,
20472040
FeatureCuMode,
20482041
Feature1024AddressableVGPRs,

llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ const MCExpr *AMDGPUAsmPrinter::getAmdhsaKernelCodeProperties(
557557
MCContext &Ctx = MF.getContext();
558558
uint16_t KernelCodeProperties = 0;
559559
const GCNUserSGPRUsageInfo &UserSGPRInfo = MFI.getUserSGPRInfo();
560-
const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
561560

562561
if (UserSGPRInfo.hasPrivateSegmentBuffer()) {
563562
KernelCodeProperties |=
@@ -587,13 +586,10 @@ const MCExpr *AMDGPUAsmPrinter::getAmdhsaKernelCodeProperties(
587586
KernelCodeProperties |=
588587
amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE;
589588
}
590-
if (ST.isWave32()) {
589+
if (MF.getSubtarget<GCNSubtarget>().isWave32()) {
591590
KernelCodeProperties |=
592591
amdhsa::KERNEL_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32;
593592
}
594-
if (isGFX1250(ST) && ST.hasCUStores()) {
595-
KernelCodeProperties |= amdhsa::KERNEL_CODE_PROPERTY_USES_CU_STORES;
596-
}
597593

598594
// CurrentProgramInfo.DynamicCallStack is a MCExpr and could be
599595
// un-evaluatable at this point so it cannot be conditionally checked here.

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6181,12 +6181,6 @@ bool AMDGPUAsmParser::ParseDirectiveAMDHSAKernel() {
61816181
ExprVal, ValRange);
61826182
if (Val)
61836183
ImpliedUserSGPRCount += 1;
6184-
} else if (ID == ".amdhsa_uses_cu_stores") {
6185-
if (!isGFX1250())
6186-
return Error(IDRange.Start, "directive requires gfx12.5", IDRange);
6187-
6188-
PARSE_BITS_ENTRY(KD.kernel_code_properties,
6189-
KERNEL_CODE_PROPERTY_USES_CU_STORES, ExprVal, ValRange);
61906184
} else if (ID == ".amdhsa_wavefront_size32") {
61916185
EXPR_RESOLVE_OR_ERROR(EvaluatableExpr);
61926186
if (IVersion.Major < 10)

llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,9 +2639,6 @@ Expected<bool> AMDGPUDisassembler::decodeKernelDescriptorDirective(
26392639
KERNEL_CODE_PROPERTY_ENABLE_SGPR_FLAT_SCRATCH_INIT);
26402640
PRINT_DIRECTIVE(".amdhsa_user_sgpr_private_segment_size",
26412641
KERNEL_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE);
2642-
if (isGFX1250())
2643-
PRINT_DIRECTIVE(".amdhsa_uses_cu_stores",
2644-
KERNEL_CODE_PROPERTY_USES_CU_STORES);
26452642

26462643
if (TwoByteBuffer & KERNEL_CODE_PROPERTY_RESERVED0)
26472644
return createReservedKDBitsError(KERNEL_CODE_PROPERTY_RESERVED0,

llvm/lib/Target/AMDGPU/GCNSubtarget.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
252252
bool HasVmemPrefInsts = false;
253253
bool HasSafeSmemPrefetch = false;
254254
bool HasSafeCUPrefetch = false;
255-
bool HasCUStores = false;
256255
bool HasVcmpxExecWARHazard = false;
257256
bool HasLdsBranchVmemWARHazard = false;
258257
bool HasNSAtoVMEMBug = false;
@@ -1017,8 +1016,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
10171016

10181017
bool hasSafeCUPrefetch() const { return HasSafeCUPrefetch; }
10191018

1020-
bool hasCUStores() const { return HasCUStores; }
1021-
10221019
// Has s_cmpk_* instructions.
10231020
bool hasSCmpK() const { return getGeneration() < GFX12; }
10241021

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,6 @@ void AMDGPUTargetAsmStreamer::EmitAmdhsaKernelDescriptor(
448448
amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE_SHIFT,
449449
amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_SIZE,
450450
".amdhsa_user_sgpr_private_segment_size");
451-
if (isGFX1250(STI))
452-
PrintField(KD.kernel_code_properties,
453-
amdhsa::KERNEL_CODE_PROPERTY_USES_CU_STORES_SHIFT,
454-
amdhsa::KERNEL_CODE_PROPERTY_USES_CU_STORES,
455-
".amdhsa_uses_cu_stores");
456451
if (IVersion.Major >= 10)
457452
PrintField(KD.kernel_code_properties,
458453
amdhsa::KERNEL_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32_SHIFT,

llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,9 +2657,7 @@ bool SIGfx12CacheControl::finalizeStore(MachineInstr &MI, bool Atomic) const {
26572657

26582658
// GFX12.5 only: Require SCOPE_SE on stores that may hit the scratch address
26592659
// space.
2660-
// We also require SCOPE_SE minimum if we not have the "cu-stores" feature.
2661-
if (Scope == CPol::SCOPE_CU &&
2662-
(!ST.hasCUStores() || TII->mayAccessScratchThroughFlat(MI)))
2660+
if (TII->mayAccessScratchThroughFlat(MI) && Scope == CPol::SCOPE_CU)
26632661
return setScope(MI, CPol::SCOPE_SE);
26642662

26652663
return Changed;

llvm/test/CodeGen/AMDGPU/gfx1250-no-scope-cu-stores.ll

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)