summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc.c b/src/gallium/drivers/nv50/nv50_pc.c
index 0e8aadf5a9..614982db2d 100644
--- a/src/gallium/drivers/nv50/nv50_pc.c
+++ b/src/gallium/drivers/nv50/nv50_pc.c
@@ -464,3 +464,18 @@ void nvbb_attach_block(struct nv_basic_block *parent, struct nv_basic_block *b)
b->in[b->num_in++] = parent;
}
+
+int
+nvbb_dominated_by(struct nv_basic_block *b, struct nv_basic_block *d)
+{
+ int j, n;
+
+ if (b == d)
+ return 1;
+
+ n = 0;
+ for (j = 0; j < b->num_in; ++j)
+ n += nvbb_dominated_by(b->in[j], d);
+
+ return n && (n == b->num_in);
+}