summaryrefslogtreecommitdiff
path: root/src/glsl/nir/nir.h
diff options
context:
space:
mode:
authorConnor Abbott <connor.abbott@intel.com>2014-07-18 16:13:11 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2015-01-15 07:18:58 -0800
commitb559ee709b26e013dda49332c55b3e25cd185bcd (patch)
tree4f54ceb62b0248dceb812c11f8a528599eeb3332 /src/glsl/nir/nir.h
parentcff1deff72294b810e4f03b72c7a871aacef8477 (diff)
nir: calculate dominance information
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r--src/glsl/nir/nir.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 7d55948ab8..97687cda8f 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -979,6 +979,18 @@ typedef struct nir_block {
struct nir_block *successors[2];
struct set *predecessors;
+
+ /*
+ * this node's immediate dominator in the dominance tree - set to NULL for
+ * the start block.
+ */
+ struct nir_block *imm_dom;
+
+ /* This node's children in the dominance tree */
+ unsigned num_dom_children;
+ struct nir_block **dom_children;
+
+ struct set *dom_frontier;
} nir_block;
#define nir_block_first_instr(block) \
@@ -1052,6 +1064,7 @@ typedef struct {
unsigned num_blocks;
bool block_index_dirty;
+ bool dominance_dirty;
} nir_function_impl;
#define nir_cf_node_next(_node) \
@@ -1249,6 +1262,18 @@ void nir_print_shader(nir_shader *shader, FILE *fp);
void nir_validate_shader(nir_shader *shader);
+void nir_calc_dominance_impl(nir_function_impl *impl);
+void nir_calc_dominance(nir_shader *shader);
+
+void nir_dump_dom_tree_impl(nir_function_impl *impl, FILE *fp);
+void nir_dump_dom_tree(nir_shader *shader, FILE *fp);
+
+void nir_dump_dom_frontier_impl(nir_function_impl *impl, FILE *fp);
+void nir_dump_dom_frontier(nir_shader *shader, FILE *fp);
+
+void nir_dump_cfg_impl(nir_function_impl *impl, FILE *fp);
+void nir_dump_cfg(nir_shader *shader, FILE *fp);
+
void nir_lower_variables_scalar(nir_shader *shader, bool lower_globals,
bool lower_io, bool add_names,
bool native_integers);