intel/compiler: Update block IPs once in dead_code_eliminate

Performance improvement in
dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13 for n=30:

release build (w/Fedora build flags): -7.79% ± 0.25%
Meson -Dbuildtype=debugoptimized:     -5.10% ± 0.40%

The difference in the debugoptimized build is the calls to
inst_is_in_block(block, this) still exist on each call to remove().

v2: Only update each block's IP data once instead of once per block.
Suggested by Emma.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>
This commit is contained in:
Ian Romanick
2021-06-28 19:02:40 -07:00
parent 8ca1bc5f94
commit f3f3817307

View File

@@ -121,7 +121,7 @@ fs_visitor::dead_code_eliminate()
flag_live[0] &= ~inst->flags_written(); flag_live[0] &= ~inst->flags_written();
if (inst->opcode == BRW_OPCODE_NOP) { if (inst->opcode == BRW_OPCODE_NOP) {
inst->remove(block); inst->remove(block, true);
continue; continue;
} }
@@ -139,6 +139,8 @@ fs_visitor::dead_code_eliminate()
} }
} }
cfg->adjust_block_ips();
ralloc_free(live); ralloc_free(live);
ralloc_free(flag_live); ralloc_free(flag_live);