-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dialects: Add filecheck tests for stencil dialect and initial lowering (
#499) Co-authored-by: Emilien Bauer <bauer.emilien@gmail.com>
- Loading branch information
1 parent
8695a1f
commit 6bc3779
Showing
9 changed files
with
329 additions
and
72 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// RUN: xdsl-opt %s -t mlir | filecheck %s | ||
|
||
"builtin.module"() ({ | ||
"func.func"() ({ | ||
^0(%0 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, %1 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>): | ||
%2 = "stencil.cast"(%0) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
%3 = "stencil.cast"(%1) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
%4 = "stencil.load"(%2) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64> | ||
%5 = "stencil.apply"(%4) ({ | ||
^1(%6 : !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>): | ||
%7 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>) -> f64 | ||
%8 = "stencil.store_result"(%7) : (f64) -> !stencil.result<f64> | ||
"stencil.return"(%8) : (!stencil.result<f64>) -> () | ||
}) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>) -> !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64> | ||
"stencil.store"(%5, %3) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>, !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> () | ||
"func.return"() : () -> () | ||
}) {"sym_name" = "stencil_copy", "function_type" = (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> (), "sym_visibility" = "private"} : () -> () | ||
}) : () -> () | ||
|
||
// CHECK-NEXT: "builtin.module"() ({ | ||
// CHECK-NEXT: "func.func"() ({ | ||
// CHECK-NEXT: ^0(%0 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, %1 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>): | ||
// CHECK-NEXT: %2 = "stencil.cast"(%0) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
// CHECK-NEXT: %3 = "stencil.cast"(%1) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
// CHECK-NEXT: %4 = "stencil.load"(%2) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64> | ||
// CHECK-NEXT: %5 = "stencil.apply"(%4) ({ | ||
// CHECK-NEXT: ^1(%6 : !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>): | ||
// CHECK-NEXT: %7 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>) -> f64 | ||
// CHECK-NEXT: %8 = "stencil.store_result"(%7) : (f64) -> !stencil.result<f64> | ||
// CHECK-NEXT: "stencil.return"(%8) : (!stencil.result<f64>) -> () | ||
// CHECK-NEXT: }) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>) -> !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64> | ||
// CHECK-NEXT: "stencil.store"(%5, %3) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>, !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> () | ||
// CHECK-NEXT: "func.return"() : () -> () | ||
// CHECK-NEXT: }) {"sym_name" = "stencil_copy", "function_type" = (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> (), "sym_visibility" = "private"} : () -> () | ||
// CHECK-NEXT: }) : () -> () |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// RUN: xdsl-opt %s -t mlir | filecheck %s | ||
|
||
"builtin.module"() ({ | ||
"func.func"() ({ | ||
^0(%0 : !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, %1 : !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, %2 : !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>): | ||
%3 = "stencil.cast"(%0) {"lb" = #stencil.index<[-4 : i64, -4 : i64, -4 : i64]>, "ub" = #stencil.index<[68 : i64, 68 : i64, 68 : i64]>} : (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[72 : i64, 72 : i64, 72 : i64], f64> | ||
%4 = "stencil.cast"(%1) {"lb" = #stencil.index<[-4 : i64, -4 : i64, -4 : i64]>, "ub" = #stencil.index<[68 : i64, 68 : i64, 68 : i64]>} : (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[72 : i64, 72 : i64, 72 : i64], f64> | ||
%5 = "stencil.cast"(%2) {"lb" = #stencil.index<[-4 : i64, -4 : i64, -4 : i64]>, "ub" = #stencil.index<[68 : i64, 68 : i64, 68 : i64]>} : (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[72 : i64, 72 : i64, 72 : i64], f64> | ||
%6 = "stencil.load"(%3) : (!stencil.field<[72 : i64, 72 : i64, 72 : i64], f64>) -> !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64> | ||
%7 = "stencil.load"(%4) : (!stencil.field<[72 : i64, 72 : i64, 72 : i64], f64>) -> !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64> | ||
%8 = "stencil.apply"(%6) ({ | ||
^1(%9 : !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>): | ||
%10 = "stencil.access"(%9) {"offset" = #stencil.index<[-1 : i64, 0 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
%11 = "stencil.access"(%9) {"offset" = #stencil.index<[1 : i64, 0 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
%12 = "stencil.access"(%9) {"offset" = #stencil.index<[0 : i64, 1 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
%13 = "stencil.access"(%9) {"offset" = #stencil.index<[0 : i64, -1 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
%14 = "stencil.access"(%9) {"offset" = #stencil.index<[0 : i64, 0 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
%15 = "arith.addf"(%10, %11) : (f64, f64) -> f64 | ||
%16 = "arith.addf"(%12, %13) : (f64, f64) -> f64 | ||
%17 = "arith.addf"(%15, %16) : (f64, f64) -> f64 | ||
%cst = "arith.constant"() {"value" = -4.0 : f32} : () -> f64 | ||
%18 = "arith.mulf"(%14, %cst) : (f64, f64) -> f64 | ||
%19 = "arith.addf"(%18, %17) : (f64, f64) -> f64 | ||
%20 = "stencil.store_result"(%19) : (f64) -> !stencil.result<f64> | ||
"stencil.return"(%20) : (!stencil.result<f64>) -> () | ||
}) : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64> | ||
}) {"function_type" = (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, "sym_name" = "stencil_hdiff"} : () -> () | ||
}) : () -> () | ||
|
||
|
||
// CHECK-NEXT: "builtin.module"() ({ | ||
// CHECK-NEXT: "func.func"() ({ | ||
// CHECK-NEXT: ^0(%0 : !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, %1 : !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, %2 : !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>): | ||
// CHECK-NEXT: %3 = "stencil.cast"(%0) {"lb" = #stencil.index<[-4 : i64, -4 : i64, -4 : i64]>, "ub" = #stencil.index<[68 : i64, 68 : i64, 68 : i64]>} : (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[72 : i64, 72 : i64, 72 : i64], f64> | ||
// CHECK-NEXT: %4 = "stencil.cast"(%1) {"lb" = #stencil.index<[-4 : i64, -4 : i64, -4 : i64]>, "ub" = #stencil.index<[68 : i64, 68 : i64, 68 : i64]>} : (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[72 : i64, 72 : i64, 72 : i64], f64> | ||
// CHECK-NEXT: %5 = "stencil.cast"(%2) {"lb" = #stencil.index<[-4 : i64, -4 : i64, -4 : i64]>, "ub" = #stencil.index<[68 : i64, 68 : i64, 68 : i64]>} : (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[72 : i64, 72 : i64, 72 : i64], f64> | ||
// CHECK-NEXT: %6 = "stencil.load"(%3) : (!stencil.field<[72 : i64, 72 : i64, 72 : i64], f64>) -> !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64> | ||
// CHECK-NEXT: %7 = "stencil.load"(%4) : (!stencil.field<[72 : i64, 72 : i64, 72 : i64], f64>) -> !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64> | ||
// CHECK-NEXT: %8 = "stencil.apply"(%6) ({ | ||
// CHECK-NEXT: ^1(%9 : !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>): | ||
// CHECK-NEXT: %10 = "stencil.access"(%9) {"offset" = #stencil.index<[-1 : i64, 0 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
// CHECK-NEXT: %11 = "stencil.access"(%9) {"offset" = #stencil.index<[1 : i64, 0 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
// CHECK-NEXT: %12 = "stencil.access"(%9) {"offset" = #stencil.index<[0 : i64, 1 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
// CHECK-NEXT: %13 = "stencil.access"(%9) {"offset" = #stencil.index<[0 : i64, -1 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
// CHECK-NEXT: %14 = "stencil.access"(%9) {"offset" = #stencil.index<[0 : i64, 0 : i64, 0 : i64]>} : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> f64 | ||
// CHECK-NEXT: %15 = "arith.addf"(%10, %11) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %16 = "arith.addf"(%12, %13) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %17 = "arith.addf"(%15, %16) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %cst = "arith.constant"() {"value" = -4.0 : f32} : () -> f64 | ||
// CHECK-NEXT: %18 = "arith.mulf"(%14, %cst) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %19 = "arith.addf"(%18, %17) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %20 = "stencil.store_result"(%19) : (f64) -> !stencil.result<f64> | ||
// CHECK-NEXT: "stencil.return"(%20) : (!stencil.result<f64>) -> () | ||
// CHECK-NEXT: }) : (!stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.temp<[-1 : i64, -1 : i64, -1 : i64], f64> | ||
// CHECK-NEXT: }) {"function_type" = (!stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>) -> !stencil.field<[-1 : i64, -1 : i64, -1 : i64], f64>, "sym_name" = "stencil_hdiff"} : () -> () | ||
// CHECK-NEXT: }) : () -> () | ||
|
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// RUN: xdsl-opt %s -t mlir | filecheck %s | ||
|
||
"builtin.module"() ({ | ||
"func.func"() ({ | ||
^0(%0 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, %1 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>): | ||
%2 = "stencil.cast"(%0) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
%3 = "stencil.cast"(%1) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
%4 = "stencil.load"(%2) {"lb" = #stencil.index<[-1 : i32, -1 : i32, 0 : i32]>, "ub" = #stencil.index<[65 : i32, 65 : i32, 64 : i32]>} : (!stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> !stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64> | ||
%5 = "stencil.apply"(%4) ({ | ||
^1(%6 : !stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>): | ||
%7 = "stencil.access"(%6) {"offset" = #stencil.index<[-1 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
%8 = "stencil.access"(%6) {"offset" = #stencil.index<[1 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
%9 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, 1 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
%10 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, -1 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
%11 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
%12 = "arith.addf"(%7, %8) : (f64, f64) -> f64 | ||
%13 = "arith.addf"(%9, %10) : (f64, f64) -> f64 | ||
%14 = "arith.addf"(%12, %13) : (f64, f64) -> f64 | ||
%15 = "arith.constant"() {"value" = -4.0 : f64} : () -> f64 | ||
%16 = "arith.mulf"(%11, %15) : (f64, f64) -> f64 | ||
%17 = "arith.mulf"(%16, %13) : (f64, f64) -> f64 | ||
%18 = "stencil.store_result"(%17) : (f64) -> !stencil.result<f64> | ||
"stencil.return"(%18) : (!stencil.result<f64>) -> () | ||
}) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64> | ||
"stencil.store"(%5, %3) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>, !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> () | ||
"func.return"() : () -> () | ||
}) {"sym_name" = "stencil_laplace", "function_type" = (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> (), "sym_visibility" = "private"} : () -> () | ||
}) : () -> () | ||
|
||
// CHECK-NEXT: "builtin.module"() ({ | ||
// CHECK-NEXT: "func.func"() ({ | ||
// CHECK-NEXT: ^0(%0 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, %1 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>): | ||
// CHECK-NEXT: %2 = "stencil.cast"(%0) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
// CHECK-NEXT: %3 = "stencil.cast"(%1) {"lb" = #stencil.index<[-4 : i32, -4 : i32, -4 : i32]>, "ub" = #stencil.index<[68 : i32, 68 : i32, 68 : i32]>} : (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64> | ||
// CHECK-NEXT: %4 = "stencil.load"(%2) {"lb" = #stencil.index<[-1 : i32, -1 : i32, 0 : i32]>, "ub" = #stencil.index<[65 : i32, 65 : i32, 64 : i32]>} : (!stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> !stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64> | ||
// CHECK-NEXT: %5 = "stencil.apply"(%4) ({ | ||
// CHECK-NEXT: ^1(%6 : !stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>): | ||
// CHECK-NEXT: %7 = "stencil.access"(%6) {"offset" = #stencil.index<[-1 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
// CHECK-NEXT: %8 = "stencil.access"(%6) {"offset" = #stencil.index<[1 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
// CHECK-NEXT: %9 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, 1 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
// CHECK-NEXT: %10 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, -1 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
// CHECK-NEXT: %11 = "stencil.access"(%6) {"offset" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> f64 | ||
// CHECK-NEXT: %12 = "arith.addf"(%7, %8) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %13 = "arith.addf"(%9, %10) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %14 = "arith.addf"(%12, %13) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %15 = "arith.constant"() {"value" = -4.0 : f64} : () -> f64 | ||
// CHECK-NEXT: %16 = "arith.mulf"(%11, %15) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %17 = "arith.mulf"(%16, %13) : (f64, f64) -> f64 | ||
// CHECK-NEXT: %18 = "stencil.store_result"(%17) : (f64) -> !stencil.result<f64> | ||
// CHECK-NEXT: "stencil.return"(%18) : (!stencil.result<f64>) -> () | ||
// CHECK-NEXT: }) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[66 : i32, 66 : i32, 64 : i32], f64>) -> !stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64> | ||
// CHECK-NEXT: "stencil.store"(%5, %3) {"lb" = #stencil.index<[0 : i32, 0 : i32, 0 : i32]>, "ub" = #stencil.index<[64 : i32, 64 : i32, 64 : i32]>} : (!stencil.temp<[64 : i32, 64 : i32, 64 : i32], f64>, !stencil.field<[72 : i32, 72 : i32, 72 : i32], f64>) -> () | ||
// CHECK-NEXT: "func.return"() : () -> () | ||
// CHECK-NEXT: }) {"sym_name" = "stencil_laplace", "function_type" = (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> (), "sym_visibility" = "private"} : () -> () | ||
// CHECK-NEXT: }) : () -> () |
16 changes: 16 additions & 0 deletions
16
tests/filecheck/dialects/stencil/test_funcop_lowering.mlir
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: xdsl-opt %s -t mlir -p convert-stencil-to-ll-mlir | filecheck %s | ||
|
||
"builtin.module"() ({ | ||
"func.func"() ({ | ||
^0(%0 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, %1 : !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>): | ||
"func.return"() : () -> () | ||
}) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>, !stencil.field<[-1 : i32, -1 : i32, -1 : i32], f64>) -> (), "sym_visibility" = "private"} : () -> () | ||
}) : () -> () | ||
|
||
// CHECK-NEXT: "builtin.module"() ({ | ||
// CHECK-NEXT: "func.func"() ({ | ||
// CHECK-NEXT: ^0(%0 : memref<?x?x?xf64>, %1 : memref<?x?x?xf64>): | ||
// CHECK-NEXT: "func.return"() : () -> () | ||
// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref<?x?x?xf64>, memref<?x?x?xf64>) -> (), "sym_visibility" = "private"} : () -> () | ||
// CHECK-NEXT: }) : () -> () | ||
|
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
Oops, something went wrong.