aco: improve support for s_sendmsg
[mesa.git] / src / amd / compiler / aco_insert_NOPs.cpp
index 1ead0c04da5264700e18df32fc44553cb720fcdf..b9eaaed96db0697f85cca5208cd93d1124ef0741 100644 (file)
@@ -378,6 +378,14 @@ int handle_instruction_gfx8_9(NOP_ctx_gfx8_9& ctx, aco_ptr<Instruction>& instr,
             }
          }
       }
+   } else if (instr->format == Format::SOPP) {
+      if (instr->opcode == aco_opcode::s_sendmsg && new_idx > 0) {
+         aco_ptr<Instruction>& pred = new_instructions.back();
+         if (pred->isSALU() &&
+             !pred->definitions.empty() &&
+             pred->definitions[0].physReg() == m0)
+            return 1;
+      }
    }
 
    return 0;