From f2c74c6dbde6ee3d4041e4f93406449f52c75299 Mon Sep 17 00:00:00 2001 From: Jeremy Kun Date: Mon, 23 Oct 2023 22:49:12 -0700 Subject: [PATCH] add poly_to_llvm test file --- tests/poly_to_llvm.mlir | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/poly_to_llvm.mlir diff --git a/tests/poly_to_llvm.mlir b/tests/poly_to_llvm.mlir new file mode 100644 index 0000000..61380c4 --- /dev/null +++ b/tests/poly_to_llvm.mlir @@ -0,0 +1,13 @@ +// RUN: tutorial-opt --poly-to-llvm %s | FileCheck %s + +// CHECK-NOT: poly +func.func @test_poly_fn(%arg : i32) -> i32 { + %tens = tensor.splat %arg : tensor<10xi32> + %input = poly.from_tensor %tens : tensor<10xi32> -> !poly.poly<10> + %0 = poly.constant dense<[2, 3, 4]> : tensor<3xi32> : !poly.poly<10> + %1 = poly.add %0, %arg : !poly.poly<10> + %2 = poly.mul %1, %1 : !poly.poly<10> + %3 = poly.sub %2, %arg : !poly.poly<10> + %4 = poly.eval %3, %point: (!poly.poly<10>, i32) -> i32 + return %4 : i32 +}