summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_pc.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-07-31 17:52:54 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-07-31 18:32:35 +0200
commitfa67cabe7a9f1343e96c7c8a105e82dc05e3de44 (patch)
tree303a429b3a0cf3e65852e4689a337ec28334637f /src/gallium/drivers/nv50/nv50_pc.c
parent5705b45b6a050f908120779e6049853931a8025a (diff)
nv50: fixes for nested IFs
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);
+}