[Mlir-commits] [mlir] 94b372e - [MLIR] Add booleans to dense element list in LangRef
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Apr 4 09:29:57 PDT 2022
Author: Siddharth Bhat
Date: 2022-04-04T21:59:44+05:30
New Revision: 94b372e725a1c22e6e418d154f1499bc6c56f5c7
URL: https://github.com/llvm/llvm-project/commit/94b372e725a1c22e6e418d154f1499bc6c56f5c7
DIFF: https://github.com/llvm/llvm-project/commit/94b372e725a1c22e6e418d154f1499bc6c56f5c7.diff
LOG: [MLIR] Add booleans to dense element list in LangRef
Add boolean values as a dense element, as tested in the MLIR parser:
```
// CHECK: "splatBoolTensor"() {bar = dense<false> : tensor<i1>} : () -> ()
"splatBoolTensor"(){bar = dense<false> : tensor<i1>} : () -> ()
```
https://github.com/llvm/llvm-project/blob/43d758b142bbdf94a1c55dc0950637ae74f825b9/mlir/test/IR/parser.mlir#L630-L631
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D122978
Added:
Modified:
mlir/include/mlir/IR/BuiltinAttributes.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/BuiltinAttributes.td b/mlir/include/mlir/IR/BuiltinAttributes.td
index 74cba43e1c43a..0efbe0e885c20 100644
--- a/mlir/include/mlir/IR/BuiltinAttributes.td
+++ b/mlir/include/mlir/IR/BuiltinAttributes.td
@@ -153,7 +153,7 @@ def Builtin_DenseIntOrFPElementsAttr : Builtin_Attr<
Syntax:
```
- tensor-literal ::= integer-literal | float-literal | [] | [tensor-literal (, tensor-literal)* ]
+ tensor-literal ::= integer-literal | float-literal | bool-literal | [] | [tensor-literal (, tensor-literal)* ]
dense-intorfloat-elements-attribute ::= `dense` `<` tensor-literal `>` `:`
( tensor-type | vector-type )
```
More information about the Mlir-commits
mailing list