- Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
Followup from #2671
// RUN: heir-opt --convert-polynomial-mul-to-ntt %s | FileCheck %s // CHECK-DAG: [[ZQ0:![^ ]+]] = !mod_arith.int<1095233372161 : i64> !Zq0 = !mod_arith.int<1095233372161 : i64> // CHECK-DAG: [[ZQ1:![^ ]+]] = !mod_arith.int<1032955396097 : i64> !Zq1 = !mod_arith.int<1032955396097 : i64> // CHECK-DAG: [[RNS2:![^ ]+]] = !rns.rns<[[ZQ0]], [[ZQ1]]> // CHECK-DAG: [[ring_2:#[^ ]+]] = #polynomial.ring<coefficientType = [[RNS2]], polynomialModulus = <1 + x**1024>> #ring_2 = #polynomial.ring<coefficientType = !rns.rns<!Zq0, !Zq1>, polynomialModulus = <1 + x**1024>> // CHECK-DAG: [[poly_ty_2:![^ ]+]] = !polynomial.polynomial<ring = [[ring_2]]> !poly_ty_2 = !polynomial.polynomial<ring=#ring_2, form=coeff> // Covers: flexible-op-only pipeline (Add/Sub) without mandatory coeff/eval-only consumers. // CHECK: func.func @test_ntt_insertion5([[x5:%.+]]: [[poly_ty_2]]) -> [[poly_ty_2]] { // CHECK: [[a5:%.+]] = polynomial.add [[x5]], [[x5]] : [[poly_ty_2]] // CHECK: [[b5:%.+]] = polynomial.sub [[a5]], [[x5]] : [[poly_ty_2]] // CHECK: return [[b5]] : [[poly_ty_2]] func.func @test_ntt_insertion5(%x: !poly_ty_2) -> !poly_ty_2 { %a = polynomial.add %x, %x : !poly_ty_2 %b = polynomial.sub %a, %x : !poly_ty_2 return %b : !poly_ty_2 }produces
!Z1032955396097_i64 = !mod_arith.int<1032955396097 : i64> !Z1095233372161_i64 = !mod_arith.int<1095233372161 : i64> !rns_L1 = !rns.rns<!Z1095233372161_i64, !Z1032955396097_i64> #ring_rns_L1_1_x1024 = #polynomial.ring<coefficientType = !rns_L1, polynomialModulus = <1 + x**1024>> !poly = !polynomial.polynomial<ring = #ring_rns_L1_1_x1024> !poly1 = !polynomial.polynomial<ring = #ring_rns_L1_1_x1024, form = eval> module { func.func @test_ntt_insertion5(%arg0: !poly) -> !poly1 { %0 = polynomial.ntt %arg0 : !poly. // <--- should not be here %1 = polynomial.add %0, %0 : !poly1 %2 = polynomial.sub %1, %0 : !poly1 return %2 : !poly1 } }Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels