File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
lib/Transforms/ConvertToCiphertextSemantics Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1064,7 +1064,20 @@ struct ConvertToCiphertextSemantics
10641064
10651065 RewritePatternSet patterns (context);
10661066 ConversionTarget target (*context);
1067- target.markUnknownOpDynamicallyLegal ([&](Operation* op) {
1067+
1068+ // check for invalid types and bail out of the pass
1069+ SmallVector<Type, 2 > _invalid_types = {mlir::IndexType::get (context)};
1070+ mlir::TypeRange invalid_types (_invalid_types);
1071+ auto _helper_valid_type =
1072+ [invalid_types](const Type &type) -> LogicalResult {
1073+ return (llvm::is_contained (invalid_types, type) ? failure () : success ());
1074+ };
1075+ if (!walkAndValidateTypes<secret::GenericOp>(module , _helper_valid_type)
1076+ .succeeded ()) {
1077+ return signalPassFailure ();
1078+ }
1079+
1080+ target.markUnknownOpDynamicallyLegal ([&](Operation *op) {
10681081 return isa<ModuleOp>(op) || hasMaterializedAttr (op);
10691082 });
10701083
You can’t perform that action at this time.
0 commit comments