mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
intel/compiler: Micro optimize inst_is_in_block
This function only exists in builds with assertions, so it only matters there. On my Ice Lake laptop (using a locked CPU speed and other measures to prevent thermal throttling, etc.) using a debugoptimized build, improves performance of Vulkan CTS "deqp-vk --deqp-case='dEQP-VK.*spir*'" by -5.2% ± 0.16% (n = 5, pooled s = 0.657887). Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
This commit is contained in:
parent
d47f521ee4
commit
43cb42df7c
1 changed files with 10 additions and 5 deletions
|
|
@ -1153,11 +1153,16 @@ backend_instruction::is_volatile() const
|
|||
static bool
|
||||
inst_is_in_block(const bblock_t *block, const backend_instruction *inst)
|
||||
{
|
||||
foreach_inst_in_block (backend_instruction, i, block) {
|
||||
if (inst == i)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
const exec_node *n = inst;
|
||||
|
||||
/* Find the tail sentinel. If the tail sentinel is the sentinel from the
|
||||
* list header in the bblock_t, then this instruction is in that basic
|
||||
* block.
|
||||
*/
|
||||
while (!n->is_tail_sentinel())
|
||||
n = n->get_next();
|
||||
|
||||
return n == &block->instructions.tail_sentinel;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue