diff options
author | Son Ho | 2022-04-27 13:57:35 +0200 |
---|---|---|
committer | Son Ho | 2022-04-27 13:57:35 +0200 |
commit | e8ba63274102a0de17227b46729ca3e22b861a23 (patch) | |
tree | c5e5288317c85b4751382a15ea175ea765fbf655 /src | |
parent | 41fe2641dccff2881fd965a524c8a962f80b86b2 (diff) |
Fix the filtering of useless backward functions
Diffstat (limited to '')
-rw-r--r-- | src/PureMicroPasses.ml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/PureMicroPasses.ml b/src/PureMicroPasses.ml index 75844345..2c4c667f 100644 --- a/src/PureMicroPasses.ml +++ b/src/PureMicroPasses.ml @@ -959,9 +959,14 @@ let filter_useless (filter_monadic_calls : bool) (ctx : trans_ctx) *) let filter_if_backward_with_no_outputs (config : config) (def : fun_decl) : fun_decl option = + let return_ty = + if config.use_state_monad then + mk_result_ty (mk_simpl_tuple_ty [ mk_state_ty; unit_ty ]) + else mk_result_ty (mk_simpl_tuple_ty [ unit_ty ]) + in if config.filter_useless_functions && Option.is_some def.back_id - && def.signature.outputs = [] + && def.signature.outputs = [ return_ty ] then None else Some def |