diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index ca671ec39a7..2ab2ac6a077 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -2089,6 +2089,8 @@ operand_can_use_reg(amd_gfx_level gfx_level, aco_ptr& instr, unsign (reg != m0 || idx == 1 || idx == 3) && /* offset can be m0 */ (reg != vcc || (instr->definitions.empty() && idx == 2) || gfx_level >= GFX10); /* sdata can be vcc */ + case Format::MUBUF: + case Format::MTBUF: return idx != 2 || gfx_level < GFX12 || reg != scc; default: // TODO: there are more instructions with restrictions on registers return true; diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index 53a92fa0c71..647d63b3d9b 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -722,6 +722,9 @@ validate_ir(Program* program) instr.get()); check(instr->operands.size() < 4 || instr->operands[3].isOfType(RegType::vgpr), "VMEM write data must be vgpr", instr.get()); + if (instr->operands.size() >= 3 && instr->operands[2].isConstant()) + check(program->gfx_level < GFX12 || instr->operands[2].constantValue() == 0, + "VMEM SOFFSET must not be non-zero constant on GFX12+", instr.get()); const bool d16 = instr->opcode ==