A program that does not actually return a secret value, e.g.,
//RUN: heir-opt --mlir-to-bgv %s | FileCheck %s
func.func @foo(%x: i32 {secret.secret}) -> i8 {
%0 = arith.constant 42 : i8
func.return %0 : i8
}
crashes with the following:
// -----// IR Dump Before ConvertToCiphertextSemantics (convert-to-ciphertext-semantics) //----- //
#layout = #tensor_ext.layout<"{ [] -> [ct, slot] : ct = 0 and 0 <= slot <= 1023 }">
module {
func.func @foo(%arg0: !secret.secret<i32> {tensor_ext.layout = #layout}) -> (!secret.secret<i8> {tensor_ext.layout = #layout}) {
%c42_i8 = arith.constant 42 : i8
%0 = secret.conceal %c42_i8 : i8 -> !secret.secret<i8>
%1 = tensor_ext.assign_layout %0 {layout = #layout, tensor_ext.layout = #layout} : !secret.secret<i8>
return %1 : !secret.secret<i8>
}
}
tmp.mlir:2:1: error: unexpected unrealized conversion cast op found
func.func @foo(%x: i32 {secret.secret}) -> i8 {
^
tmp.mlir:2:1: note: see current operation: %3 = "builtin.unrealized_conversion_cast"(%2) : (tensor<1x1024x!secret.secret<i8>>) -> !secret.secret<tensor<1x1024xi8>>
Obviously a bit of a pathological program, but this bug was encountered "in the wild" in #2525 (but unrelated to that frontend bug)
A program that does not actually return a secret value, e.g.,
crashes with the following:
Obviously a bit of a pathological program, but this bug was encountered "in the wild" in #2525 (but unrelated to that frontend bug)