aco: fix invalid access on Pseudo_instructions
Fixes: 93c8ebfa78
aco: Initial commit of independent AMD compiler
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
This commit is contained in:
parent
5b09a7e2e4
commit
a2a6880743
|
@ -881,7 +881,15 @@ void handle_pseudo(ra_ctx& ctx,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!writes_sgpr)
|
/* if all operands are constant, no need to care either */
|
||||||
|
bool reads_sgpr = false;
|
||||||
|
for (Operand& op : instr->operands) {
|
||||||
|
if (op.isTemp() && op.getTemp().type() == RegType::sgpr) {
|
||||||
|
reads_sgpr = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!(writes_sgpr && reads_sgpr))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Pseudo_instruction *pi = (Pseudo_instruction *)instr;
|
Pseudo_instruction *pi = (Pseudo_instruction *)instr;
|
||||||
|
|
|
@ -265,7 +265,7 @@ aco_ptr<Instruction> do_reload(spill_ctx& ctx, Temp tmp, Temp new_name, uint32_t
|
||||||
} else if (instr->format == Format::SOP1) {
|
} else if (instr->format == Format::SOP1) {
|
||||||
res.reset(create_instruction<SOP1_instruction>(instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
|
res.reset(create_instruction<SOP1_instruction>(instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
|
||||||
} else if (instr->format == Format::PSEUDO) {
|
} else if (instr->format == Format::PSEUDO) {
|
||||||
res.reset(create_instruction<Instruction>(instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
|
res.reset(create_instruction<Pseudo_instruction>(instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
|
||||||
}
|
}
|
||||||
for (unsigned i = 0; i < instr->operands.size(); i++) {
|
for (unsigned i = 0; i < instr->operands.size(); i++) {
|
||||||
res->operands[i] = instr->operands[i];
|
res->operands[i] = instr->operands[i];
|
||||||
|
|
Loading…
Reference in New Issue