AMDGPU: Stop validating earlyclobber operands in assembler
authorJay Foad <jay.foad@amd.com>
Tue, 20 Sep 2022 09:43:40 +0000 (10:43 +0100)
committerJay Foad <jay.foad@amd.com>
Wed, 21 Sep 2022 20:46:59 +0000 (21:46 +0100)
commit5c7ee894f8039902b9cd6da3db39b43819ca3996
tree5a8fd36a617fed44d44d5eb7fc925327c4fbc1b3
parent85cd376f706fe00833100bbc975db087aed9ad14
AMDGPU: Stop validating earlyclobber operands in assembler

This validation was introduced in D34003 for v_qsad/v_mqsad instructions
but it applies to all instructions with earlyclobber operands, which now
includes v_mad_i64/v_mad_u64.

In all these cases I do not think there is documentation saying that the
destination must not overlap the sources. Rather there are *some* cases
where the instruction may not function correctly if there is an overlap,
and we are using earlyclobber as a conservative way of preventing
codegen from generating those cases.

I think it is unhelpful for the assembler to enforce the earlyclobber
restriction because it prevents assembling cases where the programmer
knows that in fact the overlap is safe.

See also: https://github.com/llvm/llvm-project/issues/57610

Differential Revision: https://reviews.llvm.org/D134272
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/test/MC/AMDGPU/gfx10_err_pos.s
llvm/test/MC/AMDGPU/vop3-errs.s