Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): Handle tensor.empty in the pass that lower tfhe to the… #760

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -607,18 +607,20 @@ void SimulateTFHEPass::runOnOperation() {
mlir::concretelang::TypeConvertingReinstantiationPattern<
mlir::tensor::CollapseShapeOp>,
mlir::concretelang::TypeConvertingReinstantiationPattern<
mlir::tensor::YieldOp>>(&getContext(), converter);
mlir::tensor::YieldOp>,
mlir::concretelang::TypeConvertingReinstantiationPattern<
mlir::tensor::EmptyOp>>(&getContext(), converter);
// legalize ops only if operand and result types are legal
target.addDynamicallyLegalOp<
mlir::tensor::YieldOp, mlir::scf::YieldOp, mlir::tensor::GenerateOp,
mlir::tensor::ExtractSliceOp, mlir::tensor::ExtractOp,
mlir::tensor::InsertOp, mlir::tensor::InsertSliceOp,
mlir::tensor::FromElementsOp, mlir::tensor::ExpandShapeOp,
mlir::tensor::CollapseShapeOp, mlir::bufferization::AllocTensorOp>(
[&](mlir::Operation *op) {
return converter.isLegal(op->getResultTypes()) &&
converter.isLegal(op->getOperandTypes());
});
mlir::tensor::CollapseShapeOp, mlir::bufferization::AllocTensorOp,
mlir::tensor::EmptyOp>([&](mlir::Operation *op) {
return converter.isLegal(op->getResultTypes()) &&
converter.isLegal(op->getOperandTypes());
});
// Make sure that no ops `linalg.generic` that have illegal types
target
.addDynamicallyLegalOp<mlir::linalg::GenericOp, mlir::tensor::GenerateOp>(
Expand Down
Loading