summaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2020-03-04 10:51:10 -0800
committerMarge Bot <[email protected]>2020-03-10 16:01:39 +0000
commit752b9985bed171a39bb439421d0e2cd8d0ab82aa (patch)
treeb7743907be8ad1cbae4994de6ebfb2057568ac7b /src/freedreno
parent64ae2ef8bbc63750346345e331750f0e0c643103 (diff)
freedreno/ir3: add simplified stall estimation
Doesn't take into account stalls that result from a register written in a different block, etc. But this should be more useful than just using number of (ss)'s by trying to estimate how costly a given sync is. Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/ir3/ir3.c12
-rw-r--r--src/freedreno/ir3/ir3.h3
2 files changed, 14 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 0dbe9bba460..bf842701868 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -911,6 +911,8 @@ void * ir3_assemble(struct ir3 *shader, struct ir3_info *info,
ptr = dwords = calloc(4, info->sizedwords);
foreach_block (block, &shader->block_list) {
+ unsigned sfu_delay = 0;
+
foreach_instr (instr, &block->instr_list) {
int ret = emit[opc_cat(instr->opc)](instr, dwords, info);
if (ret)
@@ -925,11 +927,19 @@ void * ir3_assemble(struct ir3 *shader, struct ir3_info *info,
info->nops_count += 1 + instr->repeat;
dwords += 2;
- if (instr->flags & IR3_INSTR_SS)
+ if (instr->flags & IR3_INSTR_SS) {
info->ss++;
+ info->sstall += sfu_delay;
+ }
if (instr->flags & IR3_INSTR_SY)
info->sy++;
+
+ if (is_sfu(instr)) {
+ sfu_delay = 10;
+ } else if (sfu_delay > 0) {
+ sfu_delay--;
+ }
}
}
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h
index b66d8e2d6fd..1a3edbc4530 100644
--- a/src/freedreno/ir3/ir3.h
+++ b/src/freedreno/ir3/ir3.h
@@ -59,6 +59,9 @@ struct ir3_info {
/* number of sync bits: */
uint16_t ss, sy;
+ /* estimate of number of cycles stalled on (ss) */
+ uint16_t sstall;
+
uint16_t last_baryf; /* instruction # of last varying fetch */
};