struct list_head node;
struct ir3 *shader;
- nir_block *nblock;
+ const nir_block *nblock;
struct list_head instr_list; /* list of ir3_instruction */
struct ir3_instruction *condition;
struct ir3_block *successors[2];
+ unsigned predecessors_count;
+ struct ir3_block **predecessors;
+
uint16_t start_ip, end_ip;
/* Track instructions which do not write a register but other-
}
static struct ir3_instruction * create_immed(struct ir3_block *block, uint32_t val);
-static struct ir3_block * get_block(struct ir3_context *ctx, nir_block *nblock);
+static struct ir3_block * get_block(struct ir3_context *ctx, const nir_block *nblock);
static struct ir3_context *
}
static struct ir3_block *
-get_block(struct ir3_context *ctx, nir_block *nblock)
+get_block(struct ir3_context *ctx, const nir_block *nblock)
{
struct ir3_block *block;
- struct hash_entry *entry;
- entry = _mesa_hash_table_search(ctx->block_ht, nblock);
- if (entry)
- return entry->data;
+ struct hash_entry *hentry;
+ struct set_entry *sentry;
+ unsigned i;
+
+ hentry = _mesa_hash_table_search(ctx->block_ht, nblock);
+ if (hentry)
+ return hentry->data;
block = ir3_block_create(ctx->ir);
block->nblock = nblock;
_mesa_hash_table_insert(ctx->block_ht, nblock, block);
+ block->predecessors_count = nblock->predecessors->entries;
+ block->predecessors = ralloc_array_size(block,
+ sizeof(block->predecessors[0]), block->predecessors_count);
+ i = 0;
+ set_foreach(nblock->predecessors, sentry) {
+ block->predecessors[i++] = get_block(ctx, sentry->key);
+ }
+
return block;
}
*/
orig_end_block = ctx->block;
+// TODO these blocks need to update predecessors..
+// maybe w/ store_global intrinsic, we could do this
+// stuff in nir->nir pass
+
stream_out_block = ir3_block_create(ir);
list_addtail(&stream_out_block->node, &ir->block_list);