aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2019-08-29 17:15:46 +0200
committerConnor Abbott <[email protected]>2019-09-05 12:21:35 +0200
commit5dadbabb47c317f58a3b939d08e8e50745d92990 (patch)
treecd2c4e4a9d70605a8518a8adaa1dead773a1bf86 /src/amd/common
parent5cc7cc5f171079919dbe26f8e7a4d4eb53d119bb (diff)
radv/radeonsi: Don't count read-only data when reporting code size
We usually use these counts as a simple way to figure out if a change reduces the number of instructions or shrinks an instruction. However, since .rodata sections aren't executed, we shouldn't be counting their size for this analysis. Make the linker return the total executable size, and use it to report the more useful size in both drivers. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_rtld.c4
-rw-r--r--src/amd/common/ac_rtld.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/common/ac_rtld.c b/src/amd/common/ac_rtld.c
index a1bb51a8a88..7c35e72543d 100644
--- a/src/amd/common/ac_rtld.c
+++ b/src/amd/common/ac_rtld.c
@@ -271,6 +271,7 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
uint64_t pasted_text_size = 0;
uint64_t rx_align = 1;
uint64_t rx_size = 0;
+ uint64_t exec_size = 0;
#define report_if(cond) \
do { \
@@ -370,6 +371,8 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
if (!strcmp(s->name, ".text"))
s->is_pasted_text = true;
+
+ exec_size += shdr->sh_size;
}
if (s->is_pasted_text) {
@@ -438,6 +441,7 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
}
binary->rx_size += rx_size;
+ binary->exec_size = exec_size;
if (i.info->chip_class >= GFX10) {
/* In gfx10, the SQ fetches up to 3 cache lines of 16 dwords
diff --git a/src/amd/common/ac_rtld.h b/src/amd/common/ac_rtld.h
index 55faaa011db..2246cf1208a 100644
--- a/src/amd/common/ac_rtld.h
+++ b/src/amd/common/ac_rtld.h
@@ -57,6 +57,9 @@ struct ac_rtld_binary {
/* Required buffer sizes, currently read/executable only. */
uint64_t rx_size;
+ /* Size of executable code, for reporting purposes. */
+ uint64_t exec_size;
+
uint64_t rx_end_markers;
unsigned num_parts;