intel/brw: Add a idom_tree::dominates(a, b) helper.

Simpler to use than the existing methods.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29624>
This commit is contained in:
Kenneth Graunke
2024-03-11 00:23:52 -07:00
parent e2d9ff8004
commit b4a595204b

View File

@@ -511,6 +511,21 @@ namespace brw {
bblock_t *
intersect(bblock_t *b1, bblock_t *b2) const;
/**
* Returns true if block `a` dominates block `b`.
*/
bool
dominates(const bblock_t *a, const bblock_t *b) const
{
while (a != b) {
if (b->num == 0)
return false;
b = parent(b);
}
return true;
}
void
dump() const;