Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMDGPU][AsmParser] Refine parsing instructions #62629

Open
kosarev opened this issue May 9, 2023 · 1 comment
Open

[AMDGPU][AsmParser] Refine parsing instructions #62629

kosarev opened this issue May 9, 2023 · 1 comment

Comments

@kosarev
Copy link
Collaborator

kosarev commented May 9, 2023

This is an umbrella ticket for the work on refining the assembler-related parts of the backend and common LLVM infrastructure. Includes elimination of workarounds, turning custom code into TableGen definitions, simplifications and fixing minor defects found during the work.

32f6b6b [AMDGPU][AsmParser] Refine parsing SDWA operands.
5114843 [AMDGPU][AsmParser] Refine SMRD offset definitions.
32f46ef [AMDGPU][AsmParser][NFC] Refine immediate operand definitions.
b06e5ad [AMDGPU][AsmParser][NFC] Simplify parsing cache policies.
905fa15 [AMDGPU][AsmParser] Distinguish literal and modifier SMEM offsets.
dbbab71 [AMDGPU][NFC] Eliminate the u32imm operand definition.
f0f8ae7 [AMDGPU][AsmParser] Fix matching immediate literals.
3d6b108 [AMDGPU] Remove the unused u8imm operand definition.
ce1aae4 [AMDGPU][AsmParser][NFC] Refine defining single-bit custom operands.
9976127 [AMDGPU][AsmParser][NFC] Refine defining i8- and i16-typed custom operands.
2d945ef [AMDGPU][NFC] Rename GFX10A16 operands.
0a6dc9a [AMDGPU][AsmParser] Refine parsing cache policy modifiers.
536b8c5 [AMDGPU][AsmParser] Remove the now-unused OptionalOperand structure.
fce7a7a [AMDGPU][AsmParser] Refine parsing instruction operands.
926acd2 (arcpatch-D137638) [AMDGPU][AsmParser] Remove extra checks on missing instruction modifiers.
af6b1f7 [AsmParser] Match mandatory operands following optional operands.

@llvmbot
Copy link
Member

llvmbot commented May 9, 2023

@llvm/issue-subscribers-backend-amdgpu

kosarev added a commit that referenced this issue May 19, 2023
Eliminates the need for the custom code in parseCustomOperand().

The remaining uses of NamedOperandU32 are to be addressed separately.

Part of <#62629>.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D150204
kosarev added a commit that referenced this issue May 29, 2023
Eliminates the need for the custom code in parseCustomOperand().

Part of <#62629>.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D150980
kosarev added a commit that referenced this issue Jun 5, 2023
…tom operands.

Removes unnecessary duplication in TableGen definitions.

Part of <#62629>.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D151684
kosarev added a commit that referenced this issue Jun 5, 2023
…lasses.

Eliminates the need for custom operand classes whose only purpose is to
define a parser method.

Part of <#62629>.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D151685
kosarev added a commit that referenced this issue Jun 13, 2023
Clears the road to eliminating custom default operand handlers. Also
unifies naming of related entities.

Part of <#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D151687
kosarev added a commit that referenced this issue Jun 14, 2023
Removes the need to add and remove them manually depending on whether
they are used in cvt*() functions. Also removes the compiler warnings
about unused handlers when it happens to be the case.

Part of <#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D151688
kosarev added a commit that referenced this issue Jun 15, 2023
kosarev added a commit that referenced this issue Jun 23, 2023
Now that we have proper support for optional operands, the standard LLVM
machinery can take care of converting parsed instructions to MCInsts.
There are likely more cases where the conversion can be done
automatically, probably with some additional treatment. The plan is to
address them separately.

Part of <#62629>.

Reviewed By: arsenm, foad

Differential Revision: https://reviews.llvm.org/D153565
kosarev added a commit that referenced this issue Jun 29, 2023
This addresses the trivial cases that only require removing the
operand classes and renaming related entities.

Part of <#62629>.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D153965
kosarev added a commit that referenced this issue Jun 30, 2023
Also refine the definitions while there.

Part of <#62629>.

Reviewed By: mbrkusanin

Differential Revision: https://reviews.llvm.org/D154061
kosarev added a commit that referenced this issue Jul 5, 2023
Simplifies some future changes needed for
<#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D154337
kosarev added a commit that referenced this issue Jul 5, 2023
addKImmFPOperands() duplicates the KImmFP-specific logic implemented in
addLiteralImmOperand() and therefore can be removed.

Part of <#62629>.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D154427
kosarev added a commit that referenced this issue Jul 5, 2023
Those are implicit helper operands and therefore don't need any parsers
or printers.

Part of <#62629>.

Reviewed By: piotr, foad

Differential Revision: https://reviews.llvm.org/D154432
kosarev added a commit that referenced this issue Jul 5, 2023
Chenyang-L pushed a commit to intel/llvm that referenced this issue Jul 11, 2023
Now that we have proper support for optional operands, the standard LLVM
machinery can take care of converting parsed instructions to MCInsts.
There are likely more cases where the conversion can be done
automatically, probably with some additional treatment. The plan is to
address them separately.

Part of <llvm/llvm-project#62629>.

Reviewed By: arsenm, foad

Differential Revision: https://reviews.llvm.org/D153565
kosarev added a commit that referenced this issue Jul 13, 2023
The patch adds the support for 'noa16' operands in non-A16 variants of
the instructions, fixes validation of A16 operands and eliminates the
custom conversion to MCInst.

Part of <#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D155057
kosarev added a commit that referenced this issue Jul 13, 2023
…s automatically.

Part of <#62629>.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D155061
kosarev added a commit that referenced this issue Jul 19, 2023
kosarev added a commit that referenced this issue Jul 29, 2024
This includes simplifying printing dmask modifiers where we don't need
to mask the value to print.

Part of <#62629>.
kosarev added a commit to kosarev/llvm-project that referenced this issue Aug 7, 2024
Knowing just their numeric values is not very helpful.

Part of <llvm#62629>.
kosarev added a commit that referenced this issue Aug 8, 2024
…102328)

Knowing just their numeric values is not very helpful.

Part of <#62629>.
kosarev added a commit to kosarev/llvm-project that referenced this issue Aug 9, 2024
Mention the names of unavailable registers in error messages to not make
the diagnostics for execz/vccz less rich than it was.

Clean up unnecessary name qualifications while there.

Part of <llvm#62629>.
kosarev added a commit to kosarev/llvm-project that referenced this issue Aug 9, 2024
There's no need for them to have different types.

Part of <llvm#62629>.
kosarev added a commit that referenced this issue Aug 9, 2024
…#102616)

There's no need for them to have different types.

Part of <#62629>.
kosarev added a commit that referenced this issue Aug 12, 2024
Mention the names of unavailable registers in error messages to not make
the diagnostics for execz/vccz less rich than it was.

Clean up unnecessary name qualifications while there.

Part of <#62629>.
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Aug 26, 2024
Eliminates the need for the custom code in parseCustomOperand().

Part of <llvm/llvm-project#62629>.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D150980
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Aug 28, 2024
Clears the road to eliminating custom default operand handlers. Also
unifies naming of related entities.

Part of <llvm/llvm-project#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D151687
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Aug 28, 2024
Removes the need to add and remove them manually depending on whether
they are used in cvt*() functions. Also removes the compiler warnings
about unused handlers when it happens to be the case.

Part of <llvm/llvm-project#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D151688
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Aug 28, 2024
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Aug 30, 2024
Now that we have proper support for optional operands, the standard LLVM
machinery can take care of converting parsed instructions to MCInsts.
There are likely more cases where the conversion can be done
automatically, probably with some additional treatment. The plan is to
address them separately.

Part of <llvm/llvm-project#62629>.

Reviewed By: arsenm, foad

Differential Revision: https://reviews.llvm.org/D153565
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 2, 2024
This addresses the trivial cases that only require removing the
operand classes and renaming related entities.

Part of <llvm/llvm-project#62629>.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D153965
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 3, 2024
Also refine the definitions while there.

Part of <llvm/llvm-project#62629>.

Reviewed By: mbrkusanin

Differential Revision: https://reviews.llvm.org/D154061
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 3, 2024
Simplifies some future changes needed for
<llvm/llvm-project#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D154337
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 3, 2024
addKImmFPOperands() duplicates the KImmFP-specific logic implemented in
addLiteralImmOperand() and therefore can be removed.

Part of <llvm/llvm-project#62629>.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D154427
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 3, 2024
Those are implicit helper operands and therefore don't need any parsers
or printers.

Part of <llvm/llvm-project#62629>.

Reviewed By: piotr, foad

Differential Revision: https://reviews.llvm.org/D154432
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 3, 2024
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 6, 2024
The patch adds the support for 'noa16' operands in non-A16 variants of
the instructions, fixes validation of A16 operands and eliminates the
custom conversion to MCInst.

Part of <llvm/llvm-project#62629>.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D155057
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 6, 2024
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 7, 2024
arichardson pushed a commit to CTSRD-CHERI/llvm-project that referenced this issue Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants