Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
intel/fs/copy-prop: Purge unused ACPs
Browse files Browse the repository at this point in the history
If the destination of an ACP entry exists only within this block, then
there's no need to keep it for dataflow analysis.  We can delete it from
the out_acp table and avoid growing the bitsets any bigger than we
absolutely have to.  This reduces the maximum number of global ACP
entries in the vs-isnan-dvec with software fp64 on Kaby Lake from 8630
to 3942 and takes the execution time of the piglit vs-isnan-dvec test
from about 1:16.2 on an unoptimized debug build (what we run in CI) with
NIR_VALIDATE=0 to about 56.4 seconds.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
  • Loading branch information
gfxstrand committed May 10, 2019
1 parent 0b6da5b commit 20bbc17
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/intel/compiler/brw_fs_copy_propagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,25 @@ fs_visitor::opt_copy_propagation()
foreach_block (block, cfg) {
progress = opt_copy_propagation_local(copy_prop_ctx, block,
out_acp[block->num]) || progress;

/* If the destination of an ACP entry exists only within this block,
* then there's no need to keep it for dataflow analysis. We can delete
* it from the out_acp table and avoid growing the bitsets any bigger
* than we absolutely have to.
*
* Because nothing in opt_copy_propagation_local touches the block
* start/end IPs and opt_copy_propagation_local is incapable of
* extending the live range of an ACP destination beyond the block,
* it's safe to use the liveness information in this way.
*/
for (unsigned a = 0; a < ACP_HASH_SIZE; a++) {
foreach_in_list_safe(acp_entry, entry, &out_acp[block->num][a]) {
assert(entry->dst.file == VGRF);
if (block->start_ip <= virtual_grf_start[entry->dst.nr] &&
virtual_grf_end[entry->dst.nr] <= block->end_ip)
entry->remove();
}
}
}

/* Do dataflow analysis for those available copies. */
Expand Down

0 comments on commit 20bbc17

Please sign in to comment.