[Mlir-commits] [mlir] 4f185fc - [mlir][emitc][nfc] Replace !emitc.opaque pointers
Marius Brehler
llvmlistbot at llvm.org
Mon Apr 11 04:58:33 PDT 2022
Author: Marius Brehler
Date: 2022-04-11T11:56:03Z
New Revision: 4f185fccc722699b53d7718d528a5968110db819
URL: https://github.com/llvm/llvm-project/commit/4f185fccc722699b53d7718d528a5968110db819
DIFF: https://github.com/llvm/llvm-project/commit/4f185fccc722699b53d7718d528a5968110db819.diff
LOG: [mlir][emitc][nfc] Replace !emitc.opaque pointers
Replaces `!emitc.opaque` types used to express pointers with
`!emitc.ptr` types.
Added:
Modified:
mlir/test/Dialect/EmitC/invalid_ops.mlir
mlir/test/Dialect/EmitC/ops.mlir
Removed:
################################################################################
diff --git a/mlir/test/Dialect/EmitC/invalid_ops.mlir b/mlir/test/Dialect/EmitC/invalid_ops.mlir
index 9ff1f8a0ad850..865e2dcf52724 100644
--- a/mlir/test/Dialect/EmitC/invalid_ops.mlir
+++ b/mlir/test/Dialect/EmitC/invalid_ops.mlir
@@ -66,7 +66,7 @@ func @dense_template_argument(%arg : i32) {
func @empty_operator(%arg : i32) {
// expected-error @+1 {{'emitc.apply' op applicable operator must not be empty}}
- %2 = emitc.apply ""(%arg) : (i32) -> !emitc.opaque<"int32_t*">
+ %2 = emitc.apply ""(%arg) : (i32) -> !emitc.ptr<i32>
return
}
@@ -74,7 +74,7 @@ func @empty_operator(%arg : i32) {
func @illegal_operator(%arg : i32) {
// expected-error @+1 {{'emitc.apply' op applicable operator is illegal}}
- %2 = emitc.apply "+"(%arg) : (i32) -> !emitc.opaque<"int32_t*">
+ %2 = emitc.apply "+"(%arg) : (i32) -> !emitc.ptr<i32>
return
}
@@ -89,7 +89,7 @@ func @var_attribute_return_type_1() {
// -----
func @var_attribute_return_type_2() {
- // expected-error @+1 {{'emitc.variable' op requires attribute's type ('!emitc.opaque<"int32_t*">') to match op's return type ('!emitc.opaque<"int32_t">')}}
- %c0 = "emitc.variable"(){value = "nullptr" : !emitc.opaque<"int32_t*">} : () -> !emitc.opaque<"int32_t">
+ // expected-error @+1 {{'emitc.variable' op requires attribute's type ('!emitc.ptr<i64>') to match op's return type ('!emitc.ptr<i32>')}}
+ %c0 = "emitc.variable"(){value = "nullptr" : !emitc.ptr<i64>} : () -> !emitc.ptr<i32>
return
}
diff --git a/mlir/test/Dialect/EmitC/ops.mlir b/mlir/test/Dialect/EmitC/ops.mlir
index f6526cbaa0251..98bd919cbf35e 100644
--- a/mlir/test/Dialect/EmitC/ops.mlir
+++ b/mlir/test/Dialect/EmitC/ops.mlir
@@ -18,7 +18,7 @@ func @c() {
}
func @a(%arg0: i32, %arg1: i32) {
- %1 = "emitc.apply"(%arg0) {applicableOperator = "&"} : (i32) -> !emitc.opaque<"int32_t*">
- %2 = emitc.apply "&"(%arg1) : (i32) -> !emitc.opaque<"int32_t*">
+ %1 = "emitc.apply"(%arg0) {applicableOperator = "&"} : (i32) -> !emitc.ptr<i32>
+ %2 = emitc.apply "&"(%arg1) : (i32) -> !emitc.ptr<i32>
return
}
More information about the Mlir-commits
mailing list