Skip to content

Internal/external test difference for ntt placement #2730

@j2kun

Description

@j2kun

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 } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions