[PATCH] D134272: RFD: AMDGPU: Stop validating earlyclobber operands in assembler

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 02:55:06 PDT 2022


foad created this revision.
foad added reviewers: AMDGPU, dp, rampitec.
Herald added subscribers: kosarev, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: All.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

This validation was introduced in D34003 <https://reviews.llvm.org/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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134272

Files:
  llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
  llvm/test/MC/AMDGPU/gfx10_err_pos.s
  llvm/test/MC/AMDGPU/vop3-errs.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134272.461525.patch
Type: text/x-patch
Size: 5509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220920/d02bc3d2/attachment.bin>


More information about the llvm-commits mailing list