pan/bi: Choose instructions to schedule

In the future we'll want a heuristic minimizing register pressure but
for in-order this will suffice.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>
This commit is contained in:
Alyssa Rosenzweig
2021-01-06 14:55:50 -05:00
committed by Marge Bot
parent a303076c1a
commit 63271dca9a
+33
View File
@@ -764,6 +764,39 @@ bi_instr_schedulable(bi_instr *instr,
return true;
}
static signed
bi_instr_cost(bi_instr *instr)
{
/* TODO: stub */
return 0;
}
static unsigned
bi_choose_index(struct bi_worklist st,
struct bi_clause_state *clause,
struct bi_tuple_state *tuple,
bool fma)
{
unsigned i, best_idx = ~0;
signed best_cost = INT_MAX;
BITSET_FOREACH_SET(i, st.worklist, st.count) {
bi_instr *instr = st.instructions[i];
if (!bi_instr_schedulable(instr, clause, tuple, fma))
continue;
signed cost = bi_instr_cost(instr);
if (cost <= best_cost) {
best_idx = i;
best_cost = cost;
}
}
return best_idx;
}
#ifndef NDEBUG