static bool
constant_fold(struct vc4_compile *c, struct qinst *inst)
{
- int nsrc = qir_get_op_nsrc(inst->op);
+ int nsrc = qir_get_nsrc(inst);
uint32_t ui[nsrc];
for (int i = 0; i < nsrc; i++) {
qir_opt_constant_folding(struct vc4_compile *c)
{
bool progress = false;
- struct simple_node *node;
- foreach(node, &c->instructions) {
- struct qinst *inst = (struct qinst *)node;
+ qir_for_each_inst_inorder(inst, c) {
if (constant_fold(c, inst))
progress = true;
}