diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index c50eba30237..099eb1e1d91 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -1521,54 +1521,6 @@ label_instruction(opt_ctx& ctx, aco_ptr& instr) } } - /* DS: combine additions */ - else if (instr->isDS()) { - - DS_instruction& ds = instr->ds(); - Temp base; - uint32_t offset; - bool has_usable_ds_offset = ctx.program->gfx_level >= GFX7; - if (has_usable_ds_offset && i == 0 && - parse_base_offset(ctx, instr.get(), i, &base, &offset, false) && - base.regClass() == instr->operands[i].regClass() && - instr->opcode != aco_opcode::ds_swizzle_b32 && - instr->opcode != aco_opcode::ds_bvh_stack_push4_pop1_rtn_b32 && - instr->opcode != aco_opcode::ds_bvh_stack_push8_pop1_rtn_b32 && - instr->opcode != aco_opcode::ds_bvh_stack_push8_pop2_rtn_b64) { - if (instr->opcode == aco_opcode::ds_write2_b32 || - instr->opcode == aco_opcode::ds_read2_b32 || - instr->opcode == aco_opcode::ds_write2_b64 || - instr->opcode == aco_opcode::ds_read2_b64 || - instr->opcode == aco_opcode::ds_write2st64_b32 || - instr->opcode == aco_opcode::ds_read2st64_b32 || - instr->opcode == aco_opcode::ds_write2st64_b64 || - instr->opcode == aco_opcode::ds_read2st64_b64) { - bool is64bit = instr->opcode == aco_opcode::ds_write2_b64 || - instr->opcode == aco_opcode::ds_read2_b64 || - instr->opcode == aco_opcode::ds_write2st64_b64 || - instr->opcode == aco_opcode::ds_read2st64_b64; - bool st64 = instr->opcode == aco_opcode::ds_write2st64_b32 || - instr->opcode == aco_opcode::ds_read2st64_b32 || - instr->opcode == aco_opcode::ds_write2st64_b64 || - instr->opcode == aco_opcode::ds_read2st64_b64; - unsigned shifts = (is64bit ? 3 : 2) + (st64 ? 6 : 0); - unsigned mask = BITFIELD_MASK(shifts); - - if ((offset & mask) == 0 && ds.offset0 + (offset >> shifts) <= 255 && - ds.offset1 + (offset >> shifts) <= 255) { - instr->operands[i].setTemp(base); - ds.offset0 += offset >> shifts; - ds.offset1 += offset >> shifts; - } - } else { - if (ds.offset0 + offset <= 65535) { - instr->operands[i].setTemp(base); - ds.offset0 += offset; - } - } - } - } - else if (instr->isBranch()) { if (ctx.info[instr->operands[0].tempId()].is_scc_invert()) { /* Flip the branch instruction to get rid of the scc_invert instruction */