Skip to content

Commit 6997465

Browse files
authored
[AMDGPU] Initial support for gfx1250 target. (#144965)
This is just a stub for now.
1 parent 64fe323 commit 6997465

File tree

25 files changed

+149
-5
lines changed

25 files changed

+149
-5
lines changed

clang/include/clang/Basic/OffloadArch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ enum class OffloadArch {
9898
GFX12_GENERIC,
9999
GFX1200,
100100
GFX1201,
101+
GFX1250,
101102
AMDGCNSPIRV,
102103
Generic, // A processor model named 'generic' if the target backend defines a
103104
// public one.

clang/lib/Basic/OffloadArch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static const OffloadArchToStringMap ArchNames[] = {
8686
{OffloadArch::GFX12_GENERIC, "gfx12-generic", "compute_amdgcn"},
8787
GFX(1200), // gfx1200
8888
GFX(1201), // gfx1201
89+
GFX(1250), // gfx1250
8990
{OffloadArch::AMDGCNSPIRV, "amdgcnspirv", "compute_amdgcn"},
9091
// Intel CPUs
9192
{OffloadArch::GRANITERAPIDS, "graniterapids", ""},

clang/lib/Basic/Targets/NVPTX.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions &Opts,
238238
case OffloadArch::GFX12_GENERIC:
239239
case OffloadArch::GFX1200:
240240
case OffloadArch::GFX1201:
241+
case OffloadArch::GFX1250:
241242
case OffloadArch::AMDGCNSPIRV:
242243
case OffloadArch::Generic:
243244
case OffloadArch::GRANITERAPIDS:

clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,7 @@ void CGOpenMPRuntimeGPU::processRequiresDirective(const OMPRequiresDecl *D) {
23312331
case OffloadArch::GFX12_GENERIC:
23322332
case OffloadArch::GFX1200:
23332333
case OffloadArch::GFX1201:
2334+
case OffloadArch::GFX1250:
23342335
case OffloadArch::AMDGCNSPIRV:
23352336
case OffloadArch::Generic:
23362337
case OffloadArch::GRANITERAPIDS:

clang/test/CodeGenOpenCL/amdgpu-features.cl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1153 -emit-llvm -o - %s | FileCheck --check-prefix=GFX1153 %s
5353
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1200 -emit-llvm -o - %s | FileCheck --check-prefix=GFX1200 %s
5454
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1201 -emit-llvm -o - %s | FileCheck --check-prefix=GFX1201 %s
55+
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1250 -emit-llvm -o - %s | FileCheck --check-prefix=GFX1250 %s
5556

5657
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx1103 -target-feature +wavefrontsize64 -emit-llvm -o - %s | FileCheck --check-prefix=GFX1103-W64 %s
5758

@@ -107,6 +108,7 @@
107108
// GFX1153: "target-features"="+16-bit-insts,+atomic-fadd-rtn-insts,+ci-insts,+dl-insts,+dot10-insts,+dot12-insts,+dot5-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize32"
108109
// GFX1200: "target-features"="+16-bit-insts,+atomic-buffer-global-pk-add-f16-insts,+atomic-buffer-pk-add-bf16-inst,+atomic-ds-pk-add-16-insts,+atomic-fadd-rtn-insts,+atomic-flat-pk-add-16-insts,+atomic-global-pk-add-bf16-inst,+ci-insts,+dl-insts,+dot10-insts,+dot11-insts,+dot12-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+fp8-conversion-insts,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx12-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize32"
109110
// GFX1201: "target-features"="+16-bit-insts,+atomic-buffer-global-pk-add-f16-insts,+atomic-buffer-pk-add-bf16-inst,+atomic-ds-pk-add-16-insts,+atomic-fadd-rtn-insts,+atomic-flat-pk-add-16-insts,+atomic-global-pk-add-bf16-inst,+ci-insts,+dl-insts,+dot10-insts,+dot11-insts,+dot12-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+fp8-conversion-insts,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx12-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize32"
111+
// GFX1250: "target-features"="+16-bit-insts,+ashr-pk-insts,+atomic-buffer-global-pk-add-f16-insts,+atomic-buffer-pk-add-bf16-inst,+atomic-ds-pk-add-16-insts,+atomic-fadd-rtn-insts,+atomic-flat-pk-add-16-insts,+atomic-global-pk-add-bf16-inst,+bitop3-insts,+ci-insts,+dl-insts,+dot7-insts,+dot8-insts,+dpp,+fp8-conversion-insts,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx12-insts,+gfx1250-insts,+gfx8-insts,+gfx9-insts,+permlane16-swap,+prng-inst,+setprio-inc-wg-inst,+wavefrontsize32"
110112

111113
// GFX1103-W64: "target-features"="+16-bit-insts,+atomic-fadd-rtn-insts,+ci-insts,+dl-insts,+dot10-insts,+dot12-insts,+dot5-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize64"
112114

clang/test/Driver/amdgpu-macros.cl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1153 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,FAST_FMAF %s -DWAVEFRONT_SIZE=32 -DCPU=gfx1153 -DFAMILY=GFX11
131131
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1200 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,FAST_FMAF %s -DWAVEFRONT_SIZE=32 -DCPU=gfx1200 -DFAMILY=GFX12
132132
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1201 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,FAST_FMAF %s -DWAVEFRONT_SIZE=32 -DCPU=gfx1201 -DFAMILY=GFX12
133+
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1250 %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,FAST_FMAF %s -DWAVEFRONT_SIZE=32 -DCPU=gfx1250 -DFAMILY=GFX12
133134

134135
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx9-generic %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,FAST_FMAF %s -DWAVEFRONT_SIZE=64 -DCPU=gfx9_generic -DFAMILY=GFX9
135136
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx9-4-generic %s 2>&1 | FileCheck --check-prefixes=ARCH-GCN,FAST_FMAF %s -DWAVEFRONT_SIZE=64 -DCPU=gfx9_4_generic -DFAMILY=GFX9
@@ -177,13 +178,19 @@
177178
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx906 -mcumode \
178179
// RUN: %s 2>&1 | FileCheck --check-prefix=CUMODE-ON %s
179180
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx906 -mno-cumode \
180-
// RUN: %s 2>&1 | FileCheck --check-prefixes=CUMODE-ON,WARN-CUMODE %s
181+
// RUN: %s 2>&1 | FileCheck -DMCPU=gfx906 --check-prefixes=CUMODE-ON,WARN-CUMODE %s
181182
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1030 \
182183
// RUN: %s 2>&1 | FileCheck --check-prefix=CUMODE-OFF %s
183184
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1030 -mcumode \
184185
// RUN: %s 2>&1 | FileCheck --check-prefix=CUMODE-ON %s
185186
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1030 -mno-cumode \
186187
// RUN: %s 2>&1 | FileCheck --check-prefix=CUMODE-OFF %s
187-
// WARN-CUMODE-DAG: warning: ignoring '-mno-cumode' option as it is not currently supported for processor 'gfx906' [-Woption-ignored]
188+
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1250 \
189+
// RUN: %s 2>&1 | FileCheck --check-prefix=CUMODE-ON %s
190+
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1250 -mcumode \
191+
// RUN: %s 2>&1 | FileCheck --check-prefix=CUMODE-ON %s
192+
// RUN: %clang -E -dM -target amdgcn -mcpu=gfx1250 -mno-cumode \
193+
// RUN: %s 2>&1 | FileCheck -DMCPU=gfx1250 --check-prefixes=CUMODE-ON,WARN-CUMODE %s
194+
// WARN-CUMODE-DAG: warning: ignoring '-mno-cumode' option as it is not currently supported for processor '[[MCPU]]' [-Woption-ignored]
188195
// CUMODE-ON-DAG: #define __AMDGCN_CUMODE__ 1
189196
// CUMODE-OFF-DAG: #define __AMDGCN_CUMODE__ 0

clang/test/Driver/amdgpu-mcpu.cl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
// RUN: %clang -### -target amdgcn -mcpu=gfx1153 %s 2>&1 | FileCheck --check-prefix=GFX1153 %s
116116
// RUN: %clang -### -target amdgcn -mcpu=gfx1200 %s 2>&1 | FileCheck --check-prefix=GFX1200 %s
117117
// RUN: %clang -### -target amdgcn -mcpu=gfx1201 %s 2>&1 | FileCheck --check-prefix=GFX1201 %s
118+
// RUN: %clang -### -target amdgcn -mcpu=gfx1250 %s 2>&1 | FileCheck --check-prefix=GFX1250 %s
118119

119120
// RUN: %clang -### -target amdgcn -mcpu=gfx9-generic %s 2>&1 | FileCheck --check-prefix=GFX9_GENERIC %s
120121
// RUN: %clang -### -target amdgcn -mcpu=gfx9-4-generic %s 2>&1 | FileCheck --check-prefix=GFX9_4_GENERIC %s
@@ -169,6 +170,7 @@
169170
// GFX1153: "-target-cpu" "gfx1153"
170171
// GFX1200: "-target-cpu" "gfx1200"
171172
// GFX1201: "-target-cpu" "gfx1201"
173+
// GFX1250: "-target-cpu" "gfx1250"
172174

173175
// GFX9_GENERIC: "-target-cpu" "gfx9-generic"
174176
// GFX9_4_GENERIC: "-target-cpu" "gfx9-4-generic"

clang/test/Misc/target-invalid-cpu-note/amdgcn.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
// CHECK-SAME: {{^}}, gfx1153
6969
// CHECK-SAME: {{^}}, gfx1200
7070
// CHECK-SAME: {{^}}, gfx1201
71+
// CHECK-SAME: {{^}}, gfx1250
7172
// CHECK-SAME: {{^}}, gfx9-generic
7273
// CHECK-SAME: {{^}}, gfx10-1-generic
7374
// CHECK-SAME: {{^}}, gfx10-3-generic

clang/test/Misc/target-invalid-cpu-note/nvptx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,6 @@
8383
// CHECK-SAME: {{^}}, gfx12-generic
8484
// CHECK-SAME: {{^}}, gfx1200
8585
// CHECK-SAME: {{^}}, gfx1201
86+
// CHECK-SAME: {{^}}, gfx1250
8687
// CHECK-SAME: {{^}}, amdgcnspirv
8788
// CHECK-SAME: {{$}}

llvm/docs/AMDGPUUsage.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,13 @@ Every processor supports every OS ABI (see :ref:`amdgpu-os`) with the following
531531
work-item Add product
532532
IDs names.
533533

534+
``gfx1250`` ``amdgcn`` APU - Architected *TBA*
535+
flat
536+
scratch .. TODO::
537+
- Packed
538+
work-item Add product
539+
IDs names.
540+
534541
=========== =============== ============ ===== ================= =============== =============== ======================
535542

536543
Generic processors allow execution of a single code object on any of the processors that
@@ -2265,7 +2272,7 @@ The AMDGPU backend uses the following ELF header:
22652272
``EF_AMDGPU_MACH_AMDGCN_GFX1101`` 0x046 ``gfx1101``
22662273
``EF_AMDGPU_MACH_AMDGCN_GFX1102`` 0x047 ``gfx1102``
22672274
``EF_AMDGPU_MACH_AMDGCN_GFX1200`` 0x048 ``gfx1200``
2268-
*reserved* 0x049 Reserved.
2275+
``EF_AMDGPU_MACH_AMDGCN_GFX1250`` 0x049 ``gfx1250``
22692276
``EF_AMDGPU_MACH_AMDGCN_GFX1151`` 0x04a ``gfx1151``
22702277
*reserved* 0x04b Reserved.
22712278
``EF_AMDGPU_MACH_AMDGCN_GFX942`` 0x04c ``gfx942``

0 commit comments

Comments
 (0)