for (int i = 0; i < cfg->num_blocks; i++) {
bblock_t *bblock = cfg->blocks[i];
- vec4_instruction *inst;
memset(last_grf_write, 0, sizeof(last_grf_write));
memset(last_mrf_write, 0, sizeof(last_mrf_write));
- for (inst = (vec4_instruction *)bblock->start;
- inst != (vec4_instruction *)bblock->end->next;
- inst = (vec4_instruction *)inst->next) {
+ foreach_inst_in_block (vec4_instruction, inst, bblock) {
/* If we read from a register that we were doing dependency control
* on, don't do dependency control across the read.
*/
void *cse_ctx = ralloc_context(NULL);
int ip = block->start_ip;
- for (vec4_instruction *inst = (vec4_instruction *)block->start;
- inst != block->end->next;
- inst = (vec4_instruction *) inst->next) {
-
+ foreach_inst_in_block (vec4_instruction, inst, block) {
/* Skip some cases. */
if (is_expression(inst) && !inst->predicate && inst->mlen == 0 &&
(inst->dst.file != HW_REG || inst->dst.is_null()))