-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gccjit] fix missed translation of return type
- Loading branch information
1 parent
1314f5b
commit 05a799d
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
// RUN: %gccjit-opt %s -o %t.mlir -convert-memref-to-gccjit | ||
// RUN: %filecheck --input-file=%t.mlir %s | ||
module @test | ||
module @test attributes { | ||
gccjit.opt_level = #gccjit.opt_level<O3>, | ||
gccjit.debug_info = false | ||
} | ||
{ | ||
|
||
func.func @foo() { | ||
func.func @foo() -> memref<100x100xf32> { | ||
// CHECK: gccjit.call builtin @aligned_alloc(%{{[0-9]+}}, %{{[0-9]+}}) : (!gccjit.int<size_t>, !gccjit.int<size_t>) -> !gccjit.ptr<!gccjit.void> | ||
%a = memref.alloc () : memref<100x100xf32> | ||
return | ||
return %a : memref<100x100xf32> | ||
} | ||
|
||
func.func @bar(%arg0 : index, %arg1: index) { | ||
func.func @bar(%arg0 : index, %arg1: index) -> memref<?x133x723x?xf32> { | ||
// CHECK: gccjit.call builtin @aligned_alloc(%{{[0-9]+}}, %{{[0-9]+}}) : (!gccjit.int<size_t>, !gccjit.int<size_t>) -> !gccjit.ptr<!gccjit.void> | ||
%a = memref.alloc (%arg0, %arg1) : memref<?x133x723x?xf32> | ||
return | ||
return %a : memref<?x133x723x?xf32> | ||
} | ||
|
||
func.func @baz() { | ||
func.func @baz() -> memref<133x723x1xi128> { | ||
// CHECK: gccjit.call builtin @aligned_alloc(%{{[0-9]+}}, %{{[0-9]+}}) : (!gccjit.int<size_t>, !gccjit.int<size_t>) -> !gccjit.ptr<!gccjit.void> | ||
%a = memref.alloc () {alignment = 128} : memref<133x723x1xi128> | ||
return | ||
return %a : memref<133x723x1xi128> | ||
} | ||
|
||
gccjit.func exported @qux() -> !gccjit.int<size_t> { | ||
// CHECK: gccjit.call builtin @aligned_alloc(%{{[0-9]+}}, %{{[0-9]+}}) : (!gccjit.int<size_t>, !gccjit.int<size_t>) -> !gccjit.ptr<!gccjit.void> | ||
%a = gccjit.alignof !gccjit.int<int64_t> : !gccjit.int<size_t> | ||
gccjit.return %a : !gccjit.int<size_t> | ||
} | ||
} |