9 Commits

Author SHA1 Message Date
Jakub Kuderski
971b852546
[mlir][NFC] Simplify type checks with isa predicates (#87183)
For more context on isa predicates, see:
https://github.com/llvm/llvm-project/pull/83753.
2024-04-01 11:40:09 -04:00
Jakub Kuderski
6e90f13cc9
[mlir][spirv] Drop support for SPV_NV_cooperative_matrix (#76782)
This extension has been superseded by SPV_KHR_cooperative_matrix which
is supported across major vendors GPU like Nvidia, AMD, and Intel.

Given that the KHR version has been supported for nearly half a year,
drop the NV-specific extension to reduce the maintenance burden and code
duplication.
2024-01-08 17:57:52 -05:00
Jakub Kuderski
4c4bdf0c3a
[mlir][spirv] Fix remaining coop matrix verification corner cases (#66137)
- Check `MakePointer*` load/store attribute values.
- Support coop matrix types in `MatrixTimesScalar` verification.
- Add test cases for all the remaining ops that accept coop matrix types.
- Split NV and KHR tests.
2023-09-12 17:04:03 -04:00
Jakub Kuderski
08425def7d
[mlir][spirv] Improve coop matrix attribute handling (#66020)
- Fix values of Matrix Operand bit enums.
- Add verification for the aligned Memory Operand attributes. Mark the
'Aligned' enumerant as not supported.

The target test passes validation with `spirv-val`.
2023-09-12 11:05:08 -04:00
Jakub Kuderski
1258c3f214
[mlir][spirv] Support spirv.coopmatrix type (de-)serialization (#65831)
Extend SPIR-V target serialization and deserialization to handle coop
matrix types. Add a roundtrip test. In addition to `FileCheck` checks,
the resulting spirv binary also passes `spir-val` (external tool).

Also fix a type attribute bug surfaced by the `CooperativeMatrixLength`
op.

Multiple matrix operand attributes will be handled in a future patch to
reduce the scope.
2023-09-11 12:23:18 -04:00
Jakub Kuderski
af9dafeb38
[mlir][spirv] Fix coop matrix store (#65709)
- Fix operand/attribute order
- Use ODS for parsing/printing
- Allow for stride to be any integer type
2023-09-08 13:58:29 -04:00
Jakub Kuderski
53b3be7ecb
[mlir][spirv] Fix coop matrix load (#65712)
- Fix order of operands/attributes
- Allow for stride to be any integer type
- Use ODS for parsing/printing
- Update examples and tests
- Fix a typo in SPIR-V tblgen code
2023-09-08 13:29:12 -04:00
Jakub Kuderski
c10434bbb5
[mlir][spirv] Add CooperativeMatrixMulAdd op (#65617)
This is the last remaining op from the `SPV_KHR_cooperative_matrix`
extension.
2023-09-07 12:44:20 -04:00
Jakub Kuderski
9415241c5b [mlir][spirv] Split op implementation file into subfiles. NFC.
The main op implementation file for SPIR-V grew past 5k LOC. This makes it
take a long time to compile and index with LSPs like clangd.

Pull out the first few SPIR-V extension ops into their own `.cpp` files,
just like we do with `.td` op definitions. This includes the
KHR/NV/Intel coop matrix and the integer dot prod extensions.

I plan to further split this in future revisions.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D155747
2023-07-19 16:48:47 -04:00