Correct VOPD ComponentLayout to explicitly use ComponentProps of previous component (if any). Hopefully this will make code more clear.
This is actually an NFC change. It only affects one existing test for error position.
Paths
| Differential D137952
[AMDGPU][GFX11] Refactor VOPD operands handling ClosedPublic Authored by dp on Nov 14 2022, 7:30 AM.
Details
Summary Correct VOPD ComponentLayout to explicitly use ComponentProps of previous component (if any). Hopefully this will make code more clear. This is actually an NFC change. It only affects one existing test for error position.
Diff Detail
Event TimelineComment Actions This looks like a reasonable refactor. Why does it change the error position?
Comment Actions
Before this change getParsedSrcIndex handled tied operands as if they were parsed and returned dst index for tied operands: unsigned getParsedSrcIndex(unsigned SrcIdx, bool ComponentHasSrc2Acc) const { if (ComponentHasSrc2Acc && SrcIdx == (MAX_SRC_NUM - 1)) return getParsedDstIndex(); ... } This patch corrects handling of parsed operands: now they don't include tied ones.
Comment Actions
Thanks for the explanation. Then this patch is nicely beneficial, but perhaps not NFC.
dp marked an inline comment as done. Comment ActionsAdd a comment describing InstInfo::getRegIndices. Comment Actions I suggest doing renaming in a separate patch because it is a separate problem introduced before this change. Comment Actions
Ok. This patch LGTM This revision is now accepted and ready to land.Nov 15 2022, 6:39 AM This revision was landed with ongoing or failed builds.Nov 16 2022, 5:29 AM Closed by commit rGe468b1b740e5: [AMDGPU][GFX11] Refactor VOPD operands handling (authored by dp). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 475798 llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/test/MC/AMDGPU/gfx11_asm_vopd_err.s
|
Can we rename SrcIdx to something like MCSrcIdx? So that there is no confusion with the ParsedSrcIndex returned by getParsedSrcIndex.