vc4: Add a "qir_for_each_inst_inorder" macro and use it in many places.

We have the prior list_foreach() all over the code, but I need to move
where instructions live as part of adding support for control flow.  Start
by just converting to a helper iterator macro.  (The simpler
"qir_for_each_inst()" will be used for the for-each-inst-in-a-block
iterator macro later)
This commit is contained in:
Eric Anholt
2016-07-08 15:24:34 -07:00
parent 6858f05924
commit d3cdbf6fd8
12 changed files with 17 additions and 14 deletions

View File

@@ -53,7 +53,7 @@ void qir_validate(struct vc4_compile *c)
fail_instr(c, def, "SSA def with condition");
}
list_for_each_entry(struct qinst, inst, &c->instructions, link) {
qir_for_each_inst_inorder(inst, c) {
switch (inst->dst.file) {
case QFILE_TEMP:
if (inst->dst.index >= c->num_temps)