diff --git a/mlir/test/Examples/Toy/Ch3/transpose_transpose.toy b/mlir/test/Examples/Toy/Ch3/transpose_transpose.toy --- a/mlir/test/Examples/Toy/Ch3/transpose_transpose.toy +++ b/mlir/test/Examples/Toy/Ch3/transpose_transpose.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch3 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch3 %s -emit=mlir -opt 2>&1 | FileCheck %s # User defined generic function that operates on unknown shaped arguments def transpose_transpose(x) { @@ -13,13 +13,10 @@ # CHECK-LABEL: func @transpose_transpose( # CHECK-SAME: [[VAL_0:%.*]]: tensor<*xf64>) -> tensor<*xf64> -# CHECK: [[VAL_1:%.*]] = toy.transpose([[VAL_0]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.transpose([[VAL_1]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: toy.return [[VAL_2]] : tensor<*xf64> +# CHECK-NEXT: toy.return [[VAL_0]] : tensor<*xf64> # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_3:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> -# CHECK-NEXT: [[VAL_4:%.*]] = toy.reshape([[VAL_3]] : tensor<2x3xf64>) to tensor<2x3xf64> -# CHECK-NEXT: [[VAL_5:%.*]] = toy.generic_call @transpose_transpose([[VAL_4]]) : (tensor<2x3xf64>) -> tensor<*xf64> -# CHECK-NEXT: toy.print [[VAL_5]] : tensor<*xf64> +# CHECK-NEXT: [[VAL_1:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> +# CHECK-NEXT: [[VAL_2:%.*]] = toy.generic_call @transpose_transpose([[VAL_1]]) : (tensor<2x3xf64>) -> tensor<*xf64> +# CHECK-NEXT: toy.print [[VAL_2]] : tensor<*xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch3/trivial_reshape.toy b/mlir/test/Examples/Toy/Ch3/trivial_reshape.toy --- a/mlir/test/Examples/Toy/Ch3/trivial_reshape.toy +++ b/mlir/test/Examples/Toy/Ch3/trivial_reshape.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch3 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch3 %s -emit=mlir -opt 2>&1 | FileCheck %s def main() { var a<2,1> = [1, 2]; @@ -8,9 +8,9 @@ } # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf64> -# CHECK-NEXT: [[VAL_1:%.*]] = toy.reshape([[VAL_0]] : tensor<2xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.reshape([[VAL_1]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_3:%.*]] = toy.reshape([[VAL_2]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: toy.print [[VAL_3]] : tensor<2x1xf64> +# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant +# CHECK-SAME: dense<[ +# CHECK-SAME: [1.000000e+00], [2.000000e+00] +# CHECK-SAME: ]> : tensor<2x1xf64> +# CHECK-NEXT: toy.print [[VAL_0]] : tensor<2x1xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch4/transpose_transpose.toy b/mlir/test/Examples/Toy/Ch4/transpose_transpose.toy --- a/mlir/test/Examples/Toy/Ch4/transpose_transpose.toy +++ b/mlir/test/Examples/Toy/Ch4/transpose_transpose.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch4 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch4 %s -emit=mlir -opt 2>&1 | FileCheck %s # User defined generic function that operates on unknown shaped arguments def transpose_transpose(x) { @@ -11,15 +11,7 @@ print(b); } -# CHECK-LABEL: func @transpose_transpose( -# CHECK-SAME: [[VAL_0:%.*]]: tensor<*xf64>) -> tensor<*xf64> -# CHECK: [[VAL_1:%.*]] = toy.transpose([[VAL_0]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.transpose([[VAL_1]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: toy.return [[VAL_2]] : tensor<*xf64> - # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_3:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> -# CHECK-NEXT: [[VAL_4:%.*]] = toy.reshape([[VAL_3]] : tensor<2x3xf64>) to tensor<2x3xf64> -# CHECK-NEXT: [[VAL_5:%.*]] = toy.generic_call @transpose_transpose([[VAL_4]]) : (tensor<2x3xf64>) -> tensor<*xf64> -# CHECK-NEXT: toy.print [[VAL_5]] : tensor<*xf64> +# CHECK-NEXT: [[VAL_1:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> +# CHECK-NEXT: toy.print [[VAL_1]] : tensor<2x3xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch4/trivial_reshape.toy b/mlir/test/Examples/Toy/Ch4/trivial_reshape.toy --- a/mlir/test/Examples/Toy/Ch4/trivial_reshape.toy +++ b/mlir/test/Examples/Toy/Ch4/trivial_reshape.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch4 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch4 %s -emit=mlir -opt 2>&1 | FileCheck %s def main() { var a<2,1> = [1, 2]; @@ -8,9 +8,9 @@ } # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf64> -# CHECK-NEXT: [[VAL_1:%.*]] = toy.reshape([[VAL_0]] : tensor<2xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.reshape([[VAL_1]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_3:%.*]] = toy.reshape([[VAL_2]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: toy.print [[VAL_3]] : tensor<2x1xf64> +# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant +# CHECK-SAME: dense<[ +# CHECK-SAME: [1.000000e+00], [2.000000e+00] +# CHECK-SAME: ]> : tensor<2x1xf64> +# CHECK-NEXT: toy.print [[VAL_0]] : tensor<2x1xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch5/transpose_transpose.toy b/mlir/test/Examples/Toy/Ch5/transpose_transpose.toy --- a/mlir/test/Examples/Toy/Ch5/transpose_transpose.toy +++ b/mlir/test/Examples/Toy/Ch5/transpose_transpose.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch5 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch5 %s -emit=mlir -opt 2>&1 | FileCheck %s # User defined generic function that operates on unknown shaped arguments def transpose_transpose(x) { @@ -11,15 +11,7 @@ print(b); } -# CHECK-LABEL: func @transpose_transpose( -# CHECK-SAME: [[VAL_0:%.*]]: tensor<*xf64>) -> tensor<*xf64> -# CHECK: [[VAL_1:%.*]] = toy.transpose([[VAL_0]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.transpose([[VAL_1]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: toy.return [[VAL_2]] : tensor<*xf64> - # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_3:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> -# CHECK-NEXT: [[VAL_4:%.*]] = toy.reshape([[VAL_3]] : tensor<2x3xf64>) to tensor<2x3xf64> -# CHECK-NEXT: [[VAL_5:%.*]] = toy.generic_call @transpose_transpose([[VAL_4]]) : (tensor<2x3xf64>) -> tensor<*xf64> -# CHECK-NEXT: toy.print [[VAL_5]] : tensor<*xf64> +# CHECK-NEXT: [[VAL_1:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> +# CHECK-NEXT: toy.print [[VAL_1]] : tensor<2x3xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch5/trivial_reshape.toy b/mlir/test/Examples/Toy/Ch5/trivial_reshape.toy --- a/mlir/test/Examples/Toy/Ch5/trivial_reshape.toy +++ b/mlir/test/Examples/Toy/Ch5/trivial_reshape.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch5 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch4 %s -emit=mlir -opt 2>&1 | FileCheck %s def main() { var a<2,1> = [1, 2]; @@ -8,9 +8,9 @@ } # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf64> -# CHECK-NEXT: [[VAL_1:%.*]] = toy.reshape([[VAL_0]] : tensor<2xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.reshape([[VAL_1]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_3:%.*]] = toy.reshape([[VAL_2]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: toy.print [[VAL_3]] : tensor<2x1xf64> +# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant +# CHECK-SAME: dense<[ +# CHECK-SAME: [1.000000e+00], [2.000000e+00] +# CHECK-SAME: ]> : tensor<2x1xf64> +# CHECK-NEXT: toy.print [[VAL_0]] : tensor<2x1xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch6/transpose_transpose.toy b/mlir/test/Examples/Toy/Ch6/transpose_transpose.toy --- a/mlir/test/Examples/Toy/Ch6/transpose_transpose.toy +++ b/mlir/test/Examples/Toy/Ch6/transpose_transpose.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch6 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch6 %s -emit=mlir -opt 2>&1 | FileCheck %s # User defined generic function that operates on unknown shaped arguments def transpose_transpose(x) { @@ -11,15 +11,7 @@ print(b); } -# CHECK-LABEL: func @transpose_transpose( -# CHECK-SAME: [[VAL_0:%.*]]: tensor<*xf64>) -> tensor<*xf64> -# CHECK: [[VAL_1:%.*]] = toy.transpose([[VAL_0]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.transpose([[VAL_1]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: toy.return [[VAL_2]] : tensor<*xf64> - # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_3:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> -# CHECK-NEXT: [[VAL_4:%.*]] = toy.reshape([[VAL_3]] : tensor<2x3xf64>) to tensor<2x3xf64> -# CHECK-NEXT: [[VAL_5:%.*]] = toy.generic_call @transpose_transpose([[VAL_4]]) : (tensor<2x3xf64>) -> tensor<*xf64> -# CHECK-NEXT: toy.print [[VAL_5]] : tensor<*xf64> +# CHECK-NEXT: [[VAL_1:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> +# CHECK-NEXT: toy.print [[VAL_1]] : tensor<2x3xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch6/trivial_reshape.toy b/mlir/test/Examples/Toy/Ch6/trivial_reshape.toy --- a/mlir/test/Examples/Toy/Ch6/trivial_reshape.toy +++ b/mlir/test/Examples/Toy/Ch6/trivial_reshape.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch6 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch4 %s -emit=mlir -opt 2>&1 | FileCheck %s def main() { var a<2,1> = [1, 2]; @@ -8,9 +8,9 @@ } # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf64> -# CHECK-NEXT: [[VAL_1:%.*]] = toy.reshape([[VAL_0]] : tensor<2xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.reshape([[VAL_1]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_3:%.*]] = toy.reshape([[VAL_2]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: toy.print [[VAL_3]] : tensor<2x1xf64> +# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant +# CHECK-SAME: dense<[ +# CHECK-SAME: [1.000000e+00], [2.000000e+00] +# CHECK-SAME: ]> : tensor<2x1xf64> +# CHECK-NEXT: toy.print [[VAL_0]] : tensor<2x1xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch7/transpose_transpose.toy b/mlir/test/Examples/Toy/Ch7/transpose_transpose.toy --- a/mlir/test/Examples/Toy/Ch7/transpose_transpose.toy +++ b/mlir/test/Examples/Toy/Ch7/transpose_transpose.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch7 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch7 %s -emit=mlir -opt 2>&1 | FileCheck %s # User defined generic function that operates on unknown shaped arguments def transpose_transpose(x) { @@ -11,15 +11,7 @@ print(b); } -# CHECK-LABEL: func @transpose_transpose( -# CHECK-SAME: [[VAL_0:%.*]]: tensor<*xf64>) -> tensor<*xf64> -# CHECK: [[VAL_1:%.*]] = toy.transpose([[VAL_0]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.transpose([[VAL_1]] : tensor<*xf64>) to tensor<*xf64> -# CHECK-NEXT: toy.return [[VAL_2]] : tensor<*xf64> - # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_3:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> -# CHECK-NEXT: [[VAL_4:%.*]] = toy.reshape([[VAL_3]] : tensor<2x3xf64>) to tensor<2x3xf64> -# CHECK-NEXT: [[VAL_5:%.*]] = toy.generic_call @transpose_transpose([[VAL_4]]) : (tensor<2x3xf64>) -> tensor<*xf64> -# CHECK-NEXT: toy.print [[VAL_5]] : tensor<*xf64> +# CHECK-NEXT: [[VAL_1:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> +# CHECK-NEXT: toy.print [[VAL_1]] : tensor<2x3xf64> # CHECK-NEXT: toy.return \ No newline at end of file diff --git a/mlir/test/Examples/Toy/Ch7/trivial_reshape.toy b/mlir/test/Examples/Toy/Ch7/trivial_reshape.toy --- a/mlir/test/Examples/Toy/Ch7/trivial_reshape.toy +++ b/mlir/test/Examples/Toy/Ch7/trivial_reshape.toy @@ -1,4 +1,4 @@ -# RUN: toyc-ch7 %s -emit=mlir 2>&1 | FileCheck %s +# RUN: toyc-ch4 %s -emit=mlir -opt 2>&1 | FileCheck %s def main() { var a<2,1> = [1, 2]; @@ -8,9 +8,9 @@ } # CHECK-LABEL: func @main() -# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant dense<[1.000000e+00, 2.000000e+00]> : tensor<2xf64> -# CHECK-NEXT: [[VAL_1:%.*]] = toy.reshape([[VAL_0]] : tensor<2xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_2:%.*]] = toy.reshape([[VAL_1]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: [[VAL_3:%.*]] = toy.reshape([[VAL_2]] : tensor<2x1xf64>) to tensor<2x1xf64> -# CHECK-NEXT: toy.print [[VAL_3]] : tensor<2x1xf64> +# CHECK-NEXT: [[VAL_0:%.*]] = toy.constant +# CHECK-SAME: dense<[ +# CHECK-SAME: [1.000000e+00], [2.000000e+00] +# CHECK-SAME: ]> : tensor<2x1xf64> +# CHECK-NEXT: toy.print [[VAL_0]] : tensor<2x1xf64> # CHECK-NEXT: toy.return \ No newline at end of file