[Mlir-commits] [mlir] [mlir][spirv] Add definition for selected sample operations (PR #129558)
Igor Wodiany
llvmlistbot at llvm.org
Tue Mar 11 04:17:16 PDT 2025
================
@@ -115,7 +121,7 @@ def SPIRV_ImageDrefGatherOp : SPIRV_Op<"ImageDrefGather",
let assemblyFormat = [{
$sampled_image `,` $coordinate `,` $dref custom<ImageOperands>($image_operands) ( `(` $operand_arguments^ `)` )? attr-dict
- `:` type($sampled_image) `,` type($coordinate) `,` type($dref) ( `(` type($operand_arguments)^ `)` )?
+ `:` type($sampled_image) `,` type($coordinate) `,` type($dref) ` ` ( `(` type($operand_arguments)^ `)` )?
----------------
IgWod-IMG wrote:
I was concerned it may be a bit misleading when there are multiple arguments for the operand, but looking at an example it works:
```mlir
%0 = spirv.ImageSampleImplicitLod %arg0, %arg1 ["XXX"](%arg2, %arg2, %arg2) : !spirv.sampled_image<...>, vector<2xf32>, f32, f32, f32 -> vector<4xf32>
```
An alternative would be having both comma and parentheses:
```mlir
%0 = spirv.ImageSampleImplicitLod %arg0, %arg1 ["XXX"](%arg2, %arg2, %arg2) : !spirv.sampled_image<...>, vector<2xf32>, (f32, f32, f32) -> vector<4xf32>
```
Anyway, I'll remove this change and the change to `ImageWrite` and submit it as a separate PR.
https://github.com/llvm/llvm-project/pull/129558
More information about the Mlir-commits
mailing list