aco: do not combine additions of DS instructions on GFX6
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 15 Jan 2020 09:47:17 +0000 (10:47 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Jan 2020 14:06:06 +0000 (14:06 +0000)
The offset field doesn't work as expected on GFX6.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3412>

src/amd/compiler/aco_optimizer.cpp

index 224918c172f047f0011c97e1a49f2c4e8d5b4cf0..d8e42d88b7d53f37ce36860dec54f7c012793a6e 100644 (file)
@@ -787,7 +787,11 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
          DS_instruction *ds = static_cast<DS_instruction *>(instr.get());
          Temp base;
          uint32_t offset;
-         if (i == 0 && parse_base_offset(ctx, instr.get(), i, &base, &offset) && base.regClass() == instr->operands[i].regClass() && instr->opcode != aco_opcode::ds_swizzle_b32) {
+         bool has_usable_ds_offset = ctx.program->chip_class >= GFX7;
+         if (has_usable_ds_offset &&
+             i == 0 && parse_base_offset(ctx, instr.get(), i, &base, &offset) &&
+             base.regClass() == instr->operands[i].regClass() &&
+             instr->opcode != aco_opcode::ds_swizzle_b32) {
             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) {
                if (offset % 4 == 0 &&