Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Differential D142002 Diff 490093 mlir/test/Conversion/FuncToLLVM/emit-c-wrappers-for-external-callers.mlir
Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Conversion/FuncToLLVM/emit-c-wrappers-for-external-callers.mlir
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
// CHECK-LABEL: llvm.func @_mlir_ciface_multiple_arg_attr_multiple_res_attr | // CHECK-LABEL: llvm.func @_mlir_ciface_multiple_arg_attr_multiple_res_attr | ||||
// CHECK: (%{{.*}}: !llvm.ptr<{{.*}}> {llvm.struct_attrs = [{}, {test.returnOne = 1 : i64}, {test.returnTwo = 2 : i64}]}, %{{.*}}: !llvm.ptr<{{.*}}> {test.argZero = 0 : i64}, %{{.*}}: f32, %{{.*}}: i32 {test.argTwo = 2 : i64} | // CHECK: (%{{.*}}: !llvm.ptr<{{.*}}> {llvm.struct_attrs = [{}, {test.returnOne = 1 : i64}, {test.returnTwo = 2 : i64}]}, %{{.*}}: !llvm.ptr<{{.*}}> {test.argZero = 0 : i64}, %{{.*}}: f32, %{{.*}}: i32 {test.argTwo = 2 : i64} | ||||
func.func @multiple_arg_attr_multiple_res_attr(%arg0: memref<f32> {test.argZero = 0}, %arg1: f32, %arg2: i32 {test.argTwo = 2}) -> (f32, memref<i32> {test.returnOne = 1}, i32 {test.returnTwo = 2}) { | func.func @multiple_arg_attr_multiple_res_attr(%arg0: memref<f32> {test.argZero = 0}, %arg1: f32, %arg2: i32 {test.argTwo = 2}) -> (f32, memref<i32> {test.returnOne = 1}, i32 {test.returnTwo = 2}) { | ||||
%0 = arith.constant 1.00 : f32 | %0 = arith.constant 1.00 : f32 | ||||
%1 = memref.alloc() : memref<i32> | %1 = memref.alloc() : memref<i32> | ||||
%2 = arith.constant 2 : i32 | %2 = arith.constant 2 : i32 | ||||
return %0, %1, %2 : f32, memref<i32>, i32 | return %0, %1, %2 : f32, memref<i32>, i32 | ||||
} | } | ||||
// CHECK: llvm.func @drop_linkage_attr() -> (!llvm.struct{{.*}} {test.returnOne}) | |||||
// CHECK-LABEL: llvm.func @_mlir_ciface_drop_linkage_attr | |||||
// CHECK-NOT: llvm.linkage | |||||
// CHECK: %{{.*}}: !llvm.ptr{{.*}} {test.returnOne} | |||||
func.func @drop_linkage_attr() -> (memref<f32> {test.returnOne}) attributes { llvm.linkage = #llvm.linkage<external> } { | |||||
gysit: nit: what about calling the function "drop_default_linkage"? Then it is more obvious why the… | |||||
DinistroAuthorUnsubmitted This does not just drop the external linkage but all linkage attributes. I changed the other test to use weak linkage to demonstrate that this influences the signature but no longer appears as an attribute. Dinistro: This does not just drop the external linkage but all linkage attributes. I changed the other… | |||||
%0 = memref.alloc() : memref<f32> | |||||
return %0 : memref<f32> | |||||
} |
nit: what about calling the function "drop_default_linkage"? Then it is more obvious why the linkage is not printed?