Skip to content

Commit 6fb1d40

Browse files
authored
[mlir][spirv] Update example of spirv.Constant(NFC) (llvm#127030)
Actually the `spirv.Constant dense<[2, 3]> : vector<2xf32>` will cause a error: ``` error: unexpected decimal integer literal for a floating point value %cst = spirv.Constant dense<[2, 3]> : vector<2xf32> ^ ``` The value should be an explicit float.
1 parent 4c56096 commit 6fb1d40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def SPIRV_ConstantOp : SPIRV_Op<"Constant",
101101

102102
```mlir
103103
%0 = spirv.Constant true
104-
%1 = spirv.Constant dense<[2, 3]> : vector<2xf32>
104+
%1 = spirv.Constant dense<[2.0, 3.0]> : vector<2xf32>
105105
%2 = spirv.Constant [dense<3.0> : vector<2xf32>] : !spirv.array<1xvector<2xf32>>
106106
```
107107

0 commit comments

Comments
 (0)