diff --git a/src/intel/compiler/elk/elk_eu.h b/src/intel/compiler/elk/elk_eu.h index 88b00d3d8ba..c003258830f 100644 --- a/src/intel/compiler/elk/elk_eu.h +++ b/src/intel/compiler/elk/elk_eu.h @@ -1915,8 +1915,9 @@ bool elk_validate_instructions(const struct elk_isa_info *isa, struct elk_disasm_info *disasm); static inline int -next_offset(const struct intel_device_info *devinfo, void *store, int offset) +next_offset(struct elk_codegen *p, void *store, int offset) { + const struct intel_device_info *devinfo = p->devinfo; elk_inst *insn = (elk_inst *)((char *)store + offset); if (elk_inst_cmpt_control(devinfo, insn)) diff --git a/src/intel/compiler/elk/elk_eu_compact.c b/src/intel/compiler/elk/elk_eu_compact.c index 3e98e1c5d7e..fa06877b29b 100644 --- a/src/intel/compiler/elk/elk_eu_compact.c +++ b/src/intel/compiler/elk/elk_eu_compact.c @@ -2010,7 +2010,7 @@ elk_compact_instructions(struct elk_codegen *p, int start_offset, /* Fix up control flow offsets. */ p->next_insn_offset = start_offset + offset; for (offset = 0; offset < p->next_insn_offset - start_offset; - offset = next_offset(devinfo, store, offset)) { + offset = next_offset(p, store, offset)) { elk_inst *insn = store + offset; int this_old_ip = old_ip[offset / sizeof(elk_compact_inst)]; int this_compacted_count = compacted_counts[this_old_ip]; @@ -2123,7 +2123,7 @@ elk_compact_instructions(struct elk_codegen *p, int start_offset, sizeof(elk_inst) != group->offset) { assert(start_offset + old_ip[offset / sizeof(elk_compact_inst)] * sizeof(elk_inst) < group->offset); - offset = next_offset(devinfo, store, offset); + offset = next_offset(p, store, offset); } group->offset = start_offset + offset; diff --git a/src/intel/compiler/elk/elk_eu_emit.c b/src/intel/compiler/elk/elk_eu_emit.c index aeca1c246f5..f7814d18591 100644 --- a/src/intel/compiler/elk/elk_eu_emit.c +++ b/src/intel/compiler/elk/elk_eu_emit.c @@ -2518,9 +2518,9 @@ elk_find_next_block_end(struct elk_codegen *p, int start_offset) int depth = 0; - for (offset = next_offset(devinfo, store, start_offset); + for (offset = next_offset(p, store, start_offset); offset < p->next_insn_offset; - offset = next_offset(devinfo, store, offset)) { + offset = next_offset(p, store, offset)) { elk_inst *insn = store + offset; switch (elk_inst_opcode(p->isa, insn)) { @@ -2568,9 +2568,9 @@ elk_find_loop_end(struct elk_codegen *p, int start_offset) /* Always start after the instruction (such as a WHILE) we're trying to fix * up. */ - for (offset = next_offset(devinfo, store, start_offset); + for (offset = next_offset(p, store, start_offset); offset < p->next_insn_offset; - offset = next_offset(devinfo, store, offset)) { + offset = next_offset(p, store, offset)) { elk_inst *insn = store + offset; if (elk_inst_opcode(p->isa, insn) == ELK_OPCODE_WHILE) {