Skip to content

Commit

Permalink
add poly_to_llvm test file
Browse files Browse the repository at this point in the history
  • Loading branch information
j2kun committed Oct 30, 2023
1 parent 3dc2169 commit f2c74c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/poly_to_llvm.mlir
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit f2c74c6

Please sign in to comment.