[PATCH] D118089: [AMDGPU] Validate dst and src2 non-overlapping restriction in asm
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 24 16:38:09 PST 2022
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:3643
+
+ if (RUCount <= 8) // 4 VGPRs or less
+ return true;
----------------
Can't you get the width directly from the operand register class without making an assumption about the number of register units?
================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:3646-3653
+ for (MCRegister SubReg : TRI->subregs(Src2Reg)) {
+ if (TRI->isSubRegister(DstReg, SubReg)) {
+ Error(getRegLoc(mc2PseudoReg(Src2Reg), Operands),
+ "source 2 operand must not partially overlap with dst");
+ return false;
+ }
+ }
----------------
This is a weird overlap check. Can't you just check if you encounter the register in MCRegAliasIterator
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118089/new/
https://reviews.llvm.org/D118089
More information about the llvm-commits
mailing list