aco: either copy-propagate or inline create_vector operands
Don't do both at the same time as it breaks DCE
Fixes: 2dc550202e
('aco: copy-propagate p_create_vector copies of vectors')
Fixes: dEQP-VK.glsl.builtin.precision_double.ldexp.compute.scalar on GFX6-GFX7
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4922>
This commit is contained in:

committed by
Marge Bot

parent
c9e7362402
commit
37e89e3027
@@ -898,9 +898,12 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
|
|||||||
|
|
||||||
switch (instr->opcode) {
|
switch (instr->opcode) {
|
||||||
case aco_opcode::p_create_vector: {
|
case aco_opcode::p_create_vector: {
|
||||||
bool copy_prop = instr->operands.size() == 1 && instr->operands[0].isTemp();
|
bool copy_prop = instr->operands.size() == 1 && instr->operands[0].isTemp() &&
|
||||||
if (copy_prop)
|
instr->operands[0].regClass() == instr->definitions[0].regClass();
|
||||||
|
if (copy_prop) {
|
||||||
ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
|
ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned num_ops = instr->operands.size();
|
unsigned num_ops = instr->operands.size();
|
||||||
for (const Operand& op : instr->operands) {
|
for (const Operand& op : instr->operands) {
|
||||||
@@ -928,8 +931,7 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
|
|||||||
assert(k == num_ops);
|
assert(k == num_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!copy_prop)
|
ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
|
||||||
ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case aco_opcode::p_split_vector: {
|
case aco_opcode::p_split_vector: {
|
||||||
|
Reference in New Issue
Block a user