aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2024-01-03 16:18:43 +0000
committerAndrew Stubbs <ams@codesourcery.com>2024-01-08 09:57:09 +0000
commitc5c3aab38132ea34dc1ee69d93fded787e6ac7a4 (patch)
tree1aa6ace919a27d86fa86426c0d78b1b454264a05 /gcc
parent4d31d6606201b339825c370c2e1969b2dcd17f39 (diff)
downloadgcc-c5c3aab38132ea34dc1ee69d93fded787e6ac7a4.zip
gcc-c5c3aab38132ea34dc1ee69d93fded787e6ac7a4.tar.gz
gcc-c5c3aab38132ea34dc1ee69d93fded787e6ac7a4.tar.bz2
amdgcn: Don't double-count AVGPRs
CDNA2 devices have VGPRs and AVGPRs combined into a single hardware register file (they're seperate in CDNA1). I originally thought they were counted separately in the vgpr_count and agpr_count metadata fields, and therefore mkoffload had to account for this when passing the values to libgomp. However, that wasn't the case, and this code should have been removed when I corrected the calculations in gcn.cc. Fixing the error now. gcc/ChangeLog: * config/gcn/mkoffload.cc (isa_has_combined_avgprs): Delete. (process_asm): Don't count avgprs.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/gcn/mkoffload.cc29
1 files changed, 0 insertions, 29 deletions
diff --git a/gcc/config/gcn/mkoffload.cc b/gcc/config/gcn/mkoffload.cc
index 3341c0d..03cd040 100644
--- a/gcc/config/gcn/mkoffload.cc
+++ b/gcc/config/gcn/mkoffload.cc
@@ -471,26 +471,6 @@ copy_early_debug_info (const char *infile, const char *outfile)
return true;
}
-/* CDNA2 devices have twice as many VGPRs compared to older devices,
- but the AVGPRS are allocated from the same pool. */
-
-static int
-isa_has_combined_avgprs (int isa)
-{
- switch (isa)
- {
- case EF_AMDGPU_MACH_AMDGCN_GFX803:
- case EF_AMDGPU_MACH_AMDGCN_GFX900:
- case EF_AMDGPU_MACH_AMDGCN_GFX906:
- case EF_AMDGPU_MACH_AMDGCN_GFX908:
- case EF_AMDGPU_MACH_AMDGCN_GFX1030:
- return false;
- case EF_AMDGPU_MACH_AMDGCN_GFX90a:
- return true;
- }
- fatal_error (input_location, "unhandled ISA in isa_has_combined_avgprs");
-}
-
/* Parse an input assembler file, extract the offload tables etc.,
and output (1) the assembler code, minus the tables (which can contain
problematic relocations), and (2) a C file with the offload tables
@@ -516,7 +496,6 @@ process_asm (FILE *in, FILE *out, FILE *cfile)
{
int sgpr_count;
int vgpr_count;
- int avgpr_count;
char *kernel_name;
} regcount = { -1, -1, NULL };
@@ -564,12 +543,6 @@ process_asm (FILE *in, FILE *out, FILE *cfile)
gcc_assert (regcount.kernel_name);
break;
}
- else if (sscanf (buf, " .agpr_count: %d\n",
- &regcount.avgpr_count) == 1)
- {
- gcc_assert (regcount.kernel_name);
- break;
- }
break;
}
@@ -712,8 +685,6 @@ process_asm (FILE *in, FILE *out, FILE *cfile)
{
sgpr_count = regcounts[j].sgpr_count;
vgpr_count = regcounts[j].vgpr_count;
- if (isa_has_combined_avgprs (elf_arch))
- vgpr_count += regcounts[j].avgpr_count;
break;
}