OpGroupBroadcast added to SPIRV dialect
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td | ||
---|---|---|
89 | You can use AllTypesMatch<["value", "result"]> to enforce that the source and result have the same type and then you can remove it from the assembly format to avoid having redundant types. | |
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | ||
2013–2017 | nit: Don't use '{' for single line 'if' | |
mlir/test/Dialect/SPIRV/group-ops.mlir | ||
19–23 | Would be good to have an extra positive test with vector of localid |
We also need tests for roundtripping the serialization to SPIR-V binary. Please see this section : https://mlir.llvm.org/docs/Dialects/SPIR-V/#add-a-new-op
"Tests for the op’s custom assembly form and verification should be added to the proper file in test/Dialect/SPIRV/.
The generated op will automatically gain the logic for (de)serialization. However, tests still need to be coupled with the change to make sure no surprises. Serialization tests live in test/Dialect/SPIRV/Serialization."
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp | ||
---|---|---|
2006 | As Thomas suggested, if you add the AllTypesMatch this would not be needed. |
Thank You for the review. Regarding Serialization tests, is there anything more needed than what I already added to mlir/test/Dialect/SPIRV/Serialization/group-ops.mlir?
mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td | ||
---|---|---|
50 | Nit: Refactor this to be within 80 chars. |
mlir/test/Dialect/SPIRV/Serialization/group-ops.mlir | ||
---|---|---|
10 | Could you also add one for vector<..xi32> for localID. Nit: Prefer the CHECK-* to be formatted like this to make it easier to read CHECK-LABEL: func @group_broadcast CHECK: spv.GroupBroadcast ... i.e. |
I added remaining changes requested. Regarding the CHECK-* format I believe it is consistent with other tests.
Since I do not have rw access to llvm repo, may I ask someone to push this change to trunk?
Nit: Refactor this to be within 80 chars.