Lines Matching refs:path
43 nir_deref_path_init(nir_deref_path *path,
48 /* The length of the short path is at most ARRAY_SIZE - 1 because we need
51 static const int max_short_path_len = ARRAY_SIZE(path->_short_path) - 1;
55 nir_deref_instr **tail = &path->_short_path[max_short_path_len];
68 /* If we're under max_short_path_len, just use the short path. */
69 path->path = head;
75 for (unsigned i = 0; i < ARRAY_SIZE(path->_short_path); i++)
76 path->_short_path[i] = (void *)(uintptr_t)0xdeadbeef;
79 path->path = ralloc_array(mem_ctx, nir_deref_instr *, count + 1);
80 head = tail = path->path + count;
89 assert(head == path->path);
95 nir_deref_path_finish(nir_deref_path *path)
97 if (path->path < &path->_short_path[0] ||
98 path->path > &path->_short_path[ARRAY_SIZE(path->_short_path) - 1])
99 ralloc_free(path->path);
307 nir_deref_path path;
308 nir_deref_path_init(&path, deref, NULL);
311 for (nir_deref_instr **p = &path.path[1]; *p; p++) {
318 /* p starts at path[1], so this is safe */
332 nir_deref_path_finish(&path);
341 nir_deref_path path;
342 nir_deref_path_init(&path, deref, NULL);
345 for (nir_deref_instr **p = &path.path[1]; *p; p++) {
355 /* p starts at path[1], so this is safe */
371 nir_deref_path_finish(&path);
466 nir_deref_instr **a = a_path->path;
467 nir_deref_instr **b = b_path->path;
590 if (!modes_may_alias(b_path->path[0]->modes, a_path->path[0]->modes))
593 if (a_path->path[0]->deref_type != b_path->path[0]->deref_type)
597 if (a_path->path[0]->deref_type == nir_deref_type_var) {
598 const nir_variable *a_var = a_path->path[0]->var;
599 const nir_variable *b_var = b_path->path[0]->var;
661 assert(a_path->path[0]->deref_type == nir_deref_type_cast);
673 if (a_path->path[0] != b_path->path[0])
691 assert(a_path.path[0]->deref_type == nir_deref_type_var ||
692 a_path.path[0]->deref_type == nir_deref_type_cast);
693 assert(b_path.path[0]->deref_type == nir_deref_type_var ||
694 b_path.path[0]->deref_type == nir_deref_type_cast);
717 if (a->instr == b->instr) /* nir_compare_derefs has a fast path if a == b */