Skip to content

Commit

Permalink
Scalar Replacement of Aggregates (#5114)
Browse files Browse the repository at this point in the history
## Description
Closes #3136.

<details>
<summary>Code size reductions</summary>

Test | Without SRoA | With SRoA | % reduction
-- | -- | -- | --
should_pass/superabi_diamond | 164 | 164 | 0
should_pass/non_payable_implicit_zero_coins | 240 | 240 | 0
should_pass/supertraits_for_abis_ownable | 2236 | 2012 |
10.0178890876565
should_pass/superabi_supertrait_same_methods | 124 | 124 | 0
should_pass/forc/contract_dependencies/contract_b | 68 | 68 | 0
should_pass/forc/contract_dependencies/contract_c | 68 | 68 | 0
should_pass/forc/contract_dependencies/contract_a | 68 | 68 | 0
should_pass/forc/workspace_building | 28 | 28 | 0
should_pass/forc/dependency_package_field | 36 | 36 | 0
should_pass/forc/dependency_patching | 36 | 36 | 0
should_pass/forc/parent_pkg_manifest/contract_a | 68 | 68 | 0
should_pass/evm/evm_basic | 36 | 36 | 0
should_pass/language/basic_func_decl | 36 | 36 | 0
should_pass/language/integer_type_inference | 788 | 716 |
9.13705583756345
should_pass/language/const_decl_in_library | 76 | 76 | 0
should_pass/language/mutable_arrays_struct | 156 | 52 | 66.6666666666667
should_pass/language/unary_not_basic | 36 | 36 | 0
should_pass/language/name_resolution_inside_intrinsics | 84 | 84 | 0
should_pass/language/associated_const_trait_method | 36 | 36 | 0
should_pass/language/import_trailing_comma | 84 | 44 | 47.6190476190476
should_pass/language/struct_field_access | 92 | 52 | 43.4782608695652
should_pass/language/type_alias | 5388 | 5372 | 0.296956198960653
should_pass/language/mutable_arrays | 116 | 52 | 55.1724137931034
should_pass/language/prelude_access | 36 | 36 | 0
should_pass/language/trait_method_generic_qualified | 36 | 36 | 0
should_pass/language/generic_where_in_impl_self2 | 460 | 460 | 0
should_pass/language/array_generics | 84 | 36 | 57.1428571428571
should_pass/language/is_prime | 1124 | 1124 | 0
should_pass/language/out_of_order_decl | 52 | 44 | 15.3846153846154
should_pass/language/generic_tuple_trait | 588 | 364 | 38.0952380952381
should_pass/language/associated_const_impl_self | 36 | 36 | 0
should_pass/language/binary_and_hex_literals | 36 | 36 | 0
should_pass/language/chained_if_let | 164 | 164 | 0
should_pass/language/builtin_type_method_call | 52 | 52 | 0
should_pass/language/match_expressions_nested | 164 | 164 | 0
should_pass/language/raw_identifiers | 140 | 140 | 0
should_pass/language/struct_init_reorder | 116 | 92 | 20.6896551724138
should_pass/language/ref_mutable_fn_args_struct_assign | 92 | 52 |
43.4782608695652
should_pass/language/generic_enum | 36 | 36 | 0
should_pass/language/op_precedence | 36 | 36 | 0
should_pass/language/retd_struct | 120 | 120 | 0
should_pass/language/attributes_warnings | 36 | 36 | 0
should_pass/language/break_and_continue_block_ret | 44 | 44 | 0
should_pass/language/typeinfo_custom_callpath | 100 | 76 | 24
should_pass/language/retd_small_array | 60 | 60 | 0
should_pass/language/many_stack_variables | 780 | 724 | 7.17948717948718
should_pass/language/multi_item_import | 36 | 36 | 0
should_pass/language/ref_mutable_fn_args_struct | 84 | 52 |
38.0952380952381
should_pass/language/inline_if_expr_const | 36 | 36 | 0
should_pass/language/contract_caller_as_ret | 68 | 68 | 0
should_pass/language/mutable_arrays_enum | 156 | 116 | 25.6410256410256
should_pass/language/ref_mutable_arrays | 116 | 52 | 55.1724137931034
should_pass/language/tuple_in_struct | 916 | 588 | 35.8078602620087
should_pass/language/doc_comments | 84 | 84 | 0
should_pass/language/unary_not_basic_2 | 36 | 36 | 0
should_pass/language/match_expressions_simple | 340 | 196 |
42.3529411764706
should_pass/language/gtf_intrinsic | 92 | 92 | 0
should_pass/language/modulo_uint_test | 300 | 300 | 0
should_pass/language/ret_string_in_struct | 80 | 80 | 0
should_pass/language/match_expressions_unreachable_catch_all_middle_arm
| 2844 | 2052 | 27.8481012658228
should_pass/language/smo_opcode | 112 | 112 | 0
should_pass/language/arg_demotion_inline | 68 | 68 | 0
should_pass/language/ret_small_string | 64 | 64 | 0
should_pass/language/match_expressions_rest | 148 | 132 |
10.8108108108108
should_pass/language/b256_bad_jumps | 36 | 36 | 0
should_pass/language/tuple_single_element | 108 | 84 | 22.2222222222222
should_pass/language/match_expressions_mismatched | 116 | 116 | 0
should_pass/language/basic_predicate | 36 | 36 | 0
should_pass/language/if_elseif_enum | 788 | 564 | 28.4263959390863
should_pass/language/associated_const_impl | 36 | 36 | 0
should_pass/language/associated_const_trait_const | 36 | 36 | 0
should_pass/language/implicit_return | 52 | 52 | 0
should_pass/language/generic_transpose | 900 | 876 | 2.66666666666667
should_pass/language/insert_element_reg_reuse | 5044 | 3260 |
35.3687549563838
should_pass/language/where_clause_structs | 380 | 316 | 16.8421052631579
should_pass/language/enum_variant_imports | 844 | 844 | 0
should_pass/language/configurable_consts | 8820 | 6628 |
24.8526077097506
should_pass/language/match_expressions_with_self | 396 | 260 |
34.3434343434343
should_pass/language/where_clause_impls | 524 | 428 | 18.3206106870229
should_pass/language/enum_type_inference | 52 | 52 | 0
should_pass/language/implicit_casting | 52 | 52 | 0
should_pass/language/binop_intrinsics | 972 | 972 | 0
should_pass/language/abort_control_flow_good | 52 | 52 | 0
should_pass/language/match_expressions_structs | 212 | 148 |
30.188679245283
should_pass/language/funcs_with_generic_types | 36 | 36 | 0
should_pass/language/typeinfo_custom_callpath2 | 100 | 76 | 24
should_pass/language/bool_and_or | 84 | 84 | 0
should_pass/language/eq_and_neq | 1332 | 1332 | 0
should_pass/language/const_decl_with_call_path | 364 | 364 | 0
should_pass/language/unit_type_variants | 60 | 60 | 0
should_pass/language/ops | 5212 | 5212 | 0
should_pass/language/far_jumps/many_blobs | 11640288 | 11640288 | 0
should_pass/language/far_jumps/single_blob | 1048656 | 1048656 | 0
should_pass/language/ref_mutable_fn_args_call | 60 | 44 |
26.6666666666667
should_pass/language/size_of | 260 | 260 | 0
should_pass/language/zero_field_types | 52 | 52 | 0
should_pass/language/asm_without_return | 60 | 60 | 0
should_pass/language/str_slice | 144 | 128 | 11.1111111111111
should_pass/language/where_clause_functions | 1932 | 1356 |
29.8136645962733
should_pass/language/associated_const_impl_local_same_name | 36 | 36 | 0
should_pass/language/struct_destructuring | 204 | 188 | 7.84313725490196
should_pass/language/is_reference_type | 516 | 516 | 0
should_pass/language/reassignment_operators | 260 | 260 | 0
should_pass/language/enum_if_let_large_type | 508 | 508 | 0
should_pass/language/match_expressions_enums | 148 | 148 | 0
should_pass/language/asm_expr_basic | 284 | 284 | 0
should_pass/language/same_const_name_lib | 28 | 28 | 0
should_pass/language/associated_const_abi | 36 | 36 | 0
should_pass/language/nested_structs | 1940 | 1196 | 38.3505154639175
should_pass/language/retd_b256 | 128 | 128 | 0
should_pass/language/same_const_name | 1036 | 1036 | 0
should_pass/language/u256 | 2968 | 2968 | 0
should_pass/language/tuple_types | 52 | 52 | 0
should_pass/language/tuple_trait | 140 | 108 | 22.8571428571429
should_pass/language/associated_const_trait | 36 | 36 | 0
should_pass/language/predicate_while_dep | 68 | 68 | 0
should_pass/language/generic_impl_self_where | 2260 | 1284 |
43.1858407079646
should_pass/language/enum_if_let | 640 | 640 | 0
should_pass/language/main_returns_unit | 36 | 36 | 0
should_pass/language/tuple_indexing | 68 | 36 | 47.0588235294118
should_pass/language/mutable_arrays_nested | 196 | 36 | 81.6326530612245
should_pass/language/match_expressions_empty_enums | 52 | 52 | 0
should_pass/language/associated_const_abi_default | 36 | 36 | 0
should_pass/language/shadowing/shadowed_glob_imports | 36 | 36 | 0
should_pass/language/eq_intrinsic | 588 | 588 | 0
should_pass/language/struct_field_reassignment | 36 | 36 | 0
should_pass/language/generic_structs | 52 | 36 | 30.7692307692308
should_pass/language/ref_mutable_arrays_inline | 116 | 52 |
55.1724137931034
should_pass/language/import_with_different_callpaths | 2492 | 1772 |
28.892455858748
should_pass/language/main_args/main_args_ref_copy | 60 | 60 | 0
should_pass/language/main_args/main_args_copy | 52 | 52 | 0
should_pass/language/main_args/main_args_ref_ref | 60 | 60 | 0
should_pass/language/main_args/main_args_various_types | 620 | 588 |
5.16129032258065
should_pass/language/main_args/main_args_empty | 52 | 52 | 0
should_pass/language/main_args/main_args_ref | 52 | 52 | 0
should_pass/language/main_args/main_args_copy_copy | 52 | 52 | 0
should_pass/language/prelude_access2 | 36 | 36 | 0
should_pass/language/use_full_path_names | 36 | 36 | 0
should_pass/language/typeinfo_custom_callpath_with_import | 164 | 92 |
43.9024390243903
should_pass/language/retd_zero_len_array | 44 | 44 | 0
should_pass/language/where_clause_enums | 612 | 612 | 0
should_pass/language/generic_functions | 36 | 36 | 0
should_pass/language/b256_bitwise_ops | 25280 | 19360 | 23.4177215189873
should_pass/language/mutable_and_initd | 164 | 164 | 0
should_pass/language/enum_in_fn_decl | 116 | 116 | 0
should_pass/language/associated_const_abi_multiple | 36 | 36 | 0
should_pass/language/valid_impurity | 68 | 68 | 0
should_pass/language/nested_while_and_if | 164 | 164 | 0
should_pass/language/mutable_arrays_multiple_nested | 172 | 36 |
79.0697674418605
should_pass/language/where_clause_traits | 36 | 36 | 0
should_pass/language/supertraits | 4204 | 3716 | 11.6079923882017
should_pass/language/match_expressions_constants | 92 | 92 | 0
should_pass/language/match_expressions_unreachable_last_arm | 4476 |
3332 | 25.5585344057194
should_pass/language/tuple_field_reassignment | 1188 | 260 |
78.1144781144781
should_pass/language/enum_destructuring | 124 | 124 | 0
should_pass/language/revert_in_first_if_branch | 52 | 52 | 0
should_pass/language/logging | 512 | 504 | 1.5625
should_pass/language/where_clause_methods | 1932 | 1356 |
29.8136645962733
should_pass/language/ref_mutable_fn_args_bool | 52 | 36 |
30.7692307692308
should_pass/language/diagnose_unknown_annotations | 100 | 100 | 0
should_pass/language/bitwise_not | 220 | 220 | 0
should_pass/language/generic_struct | 44 | 36 | 18.1818181818182
should_pass/language/match_expressions_unreachable_catch_all_last_arm |
3668 | 2500 | 31.8429661941112
should_pass/language/primitive_type_argument | 52 | 52 | 0
should_pass/language/fix_opcode_bug | 52 | 52 | 0
should_pass/language/trait_method_ascription_disambiguate | 36 | 36 | 0
should_pass/language/smo | 936 | 904 | 3.41880341880342
should_pass/language/import_method_from_other_file | 508 | 372 |
26.7716535433071
should_pass/language/aliased_imports | 60 | 52 | 13.3333333333333
should_pass/language/left_to_right_func_args_evaluation | 188 | 76 |
59.5744680851064
should_pass/language/mutable_arrays_swap | 116 | 52 | 55.1724137931034
should_pass/language/break_and_continue | 788 | 788 | 0
should_pass/language/generic_type_inference | 3916 | 2684 |
31.4606741573034
should_pass/language/empty_method_initializer | 416 | 416 | 0
should_pass/language/const_inits | 3172 | 2460 | 22.4464060529634
should_pass/language/if_implicit_unit | 36 | 36 | 0
should_pass/language/enum_init_fn_call | 812 | 764 | 5.91133004926108
should_pass/language/complex_cfg | 340 | 116 | 65.8823529411765
should_pass/language/use_absolute_path | 36 | 36 | 0
should_pass/language/enum_padding | 116 | 116 | 0
should_pass/language/method_type_args | 36 | 36 | 0
should_pass/language/method_on_empty_struct | 36 | 36 | 0
should_pass/language/const_decl | 52 | 52 | 0
should_pass/language/tuple_access | 184 | 184 | 0
should_pass/language/impure_ifs | 804 | 620 | 22.8855721393035
should_pass/language/ref_mutable_fn_args_u32 | 60 | 52 |
13.3333333333333
should_pass/language/match_expressions_or | 724 | 508 | 29.8342541436464
should_pass/language/trait_import_with_star | 60 | 60 | 0
should_pass/language/generic_where_in_impl_self | 460 | 460 | 0
should_pass/language/match_expressions_explicit_rets | 36 | 36 | 0
should_pass/language/while_loops | 420 | 420 | 0
should_pass/language/generics_in_contract | 1792 | 1352 |
24.5535714285714
should_pass/language/associated_const_trait_impl_method | 36 | 36 | 0
should_pass/language/contract_caller_dynamic_address | 144 | 144 | 0
should_pass/language/generic_result_method | 652 | 652 | 0
should_pass/language/local_impl_for_ord | 36 | 36 | 0
should_pass/language/match_expressions_inside_generic_functions | 540 |
540 | 0
should_pass/language/raw_ptr/vec_ret | 804 | 444 | 44.7761194029851
should_pass/language/raw_ptr/raw_ptr_ret | 348 | 180 | 48.2758620689655
should_pass/language/const_decl_and_use_in_library | 52 | 52 | 0
should_pass/language/predicate_while | 68 | 68 | 0
should_pass/language/test_attribute | 28 | 28 | 0
should_pass/language/numeric_constants | 380 | 380 | 0
should_pass/language/generic_impl_self | 2652 | 1852 | 30.1659125188537
should_pass/language/generic_inside_generic | 196 | 164 |
16.3265306122449
should_pass/language/match_expressions | 52 | 52 | 0
should_pass/language/associated_const_trait_default | 52 | 52 | 0
should_pass/language/generic_traits | 1028 | 868 | 15.5642023346304
should_pass/language/self_impl_reassignment | 1228 | 1068 |
13.0293159609121
should_pass/language/b256_ops | 5368 | 3672 | 31.5946348733234
should_pass/language/associated_const_impl_multiple | 36 | 36 | 0
should_pass/language/multi_impl_self | 52 | 52 | 0
should_pass/language/array_basics | 964 | 196 | 79.6680497925311
should_pass/language/tuple_desugaring | 228 | 100 | 56.140350877193
should_pass/language/non_literal_const_decl | 52 | 52 | 0
should_pass/language/supertraits_with_trait_methods | 148 | 100 |
32.4324324324324
should_pass/language/redundant_return | 36 | 36 | 0
should_pass/language/nested_struct_destructuring | 52 | 36 |
30.7692307692308
should_pass/language/test_multiple_attributes | 28 | 28 | 0
should_pass/language/diverging_exprs | 1932 | 1820 | 5.79710144927536
should_pass/language/match_expressions_unreachable_middle_arm | 5908 |
4188 | 29.113067027759
should_pass/language/trait_method_qualified | 260 | 260 | 0
should_pass/language/new_allocator_test | 820 | 820 | 0
should_pass/stdlib/assert_eq_u256_revert | 452 | 212 | 53.0973451327434
should_pass/stdlib/sha256 | 2084 | 1332 | 36.084452975048
should_pass/stdlib/u256_div_test | 36100 | 14332 | 60.2991689750693
should_pass/stdlib/result | 10728 | 10064 | 6.18941088739746
should_pass/stdlib/u128_mul_test | 1380 | 788 | 42.8985507246377
should_pass/stdlib/require | 36 | 36 | 0
should_pass/stdlib/address_test | 2184 | 2184 | 0
should_pass/stdlib/storage_vec_insert | 8168 | 5976 | 26.8364348677767
should_pass/stdlib/eq_custom_type | 820 | 820 | 0
should_pass/stdlib/alloc | 780 | 780 | 0
should_pass/stdlib/u256_ops_test | 31068 | 14084 | 54.6671816660229
should_pass/stdlib/if_type_revert | 36 | 36 | 0
should_pass/stdlib/u256_test | 4892 | 2676 | 45.2984464431725
should_pass/stdlib/b512_test | 2864 | 2864 | 0
should_pass/stdlib/assert_eq_revert | 68 | 68 | 0
should_pass/stdlib/option | 212972 | 127804 | 39.9902334579194
should_pass/stdlib/exponentiation_test | 3028 | 3028 | 0
should_pass/stdlib/vec | 178328 | 124568 | 30.1466959759544
should_pass/stdlib/vec_swap | 36836 | 25188 | 31.6212400912151
should_pass/stdlib/assert_test | 276 | 276 | 0
should_pass/stdlib/raw_slice | 572 | 460 | 19.5804195804196
should_pass/stdlib/intrinsics | 596 | 596 | 0
should_pass/stdlib/ge_test | 388 | 388 | 0
should_pass/stdlib/u128_test | 7428 | 4524 | 39.0953150242326
should_pass/stdlib/contract_id_test | 304 | 304 | 0
should_pass/stdlib/contract_id_type | 288 | 288 | 0
should_pass/stdlib/chess | 2084 | 1812 | 13.0518234165067
should_pass/stdlib/raw_ptr | 7220 | 4308 | 40.3324099722992
should_pass/stdlib/u128_root_test | 34652 | 12972 | 62.5649313170957
should_pass/stdlib/logarithmic_test | 1644 | 1644 | 0
should_pass/stdlib/assert_eq | 3968 | 3160 | 20.3629032258064
should_pass/stdlib/block_height | 76 | 76 | 0
should_pass/stdlib/u256_mul_test | 36508 | 17012 | 53.4019940834885
should_pass/stdlib/eq_generic | 36 | 36 | 0
should_pass/stdlib/u128_div_test | 4460 | 2132 | 52.1973094170404
should_pass/stdlib/u128_log_test | 33908 | 11540 | 65.9667335142149
should_pass/stdlib/identity_eq | 6628 | 6628 | 0
should_pass/stdlib/b512_struct_alignment | 328 | 328 | 0
should_pass/dca/impl_trait_single | 36 | 36 | 0
should_pass/dca/multiple_fns_same_name | 36 | 36 | 0
should_pass/dca/trait_method | 36 | 36 | 0
should_pass/dca/unused_trait | 36 | 36 | 0
should_pass/dca/trait_method_neq | 116 | 116 | 0
should_pass/dca/alias_lib | 84 | 84 | 0
should_pass/dca/trait_method_lib | 28 | 28 | 0
should_pass/dca/multiple_enums_same_name | 36 | 36 | 0
should_pass/dca/contract/unused_struct_field_array | 100 | 100 | 0
should_pass/dca/contract/unused_struct_field_enum | 92 | 92 | 0
should_pass/dca/contract/unused_struct_field | 76 | 76 | 0
should_pass/dca/contract/abi_fn_params | 116 | 116 | 0
should_pass/dca/contract/superabi_contract_calls | 204 | 204 | 0
should_pass/dca/contract/unused_struct_field_tuple | 76 | 76 | 0
should_pass/dca/unused_struct | 36 | 36 | 0
should_pass/dca/unused_free_fn | 36 | 36 | 0
should_pass/dca/impl_self | 36 | 36 | 0
should_pass/dca/unused_variable | 36 | 36 | 0
should_pass/dca/all_paths_return | 36 | 36 | 0
should_pass/dca/allow_dead_code | 36 | 36 | 0
should_pass/dca/log_stdlib | 52 | 52 | 0
should_pass/dca/impl_self_alias2 | 36 | 36 | 0
should_pass/dca/struct_field_no_warning | 44 | 44 | 0
should_pass/dca/log_intrinsic | 52 | 52 | 0
should_pass/dca/unused_enum | 36 | 36 | 0
should_pass/dca/constant_struct | 64 | 52 | 18.75
should_pass/dca/impl_unused_fn | 60 | 52 | 13.3333333333333
should_pass/dca/library/fn_params_free | 28 | 28 | 0
should_pass/dca/library/fn_params_impl | 28 | 28 | 0
should_pass/dca/library/unused_priv_free_fn | 28 | 28 | 0
should_pass/dca/library/unused_pub_free_fn | 28 | 28 | 0
should_pass/dca/library/fn_params_trait | 28 | 28 | 0
should_pass/dca/unused_variable_in_free_fn | 36 | 36 | 0
should_pass/dca/generic_fn_trait_contraint | 36 | 36 | 0
should_pass/dca/func_param | 36 | 36 | 0
should_pass/dca/alias_type_ascription_generic | 36 | 36 | 0
should_pass/dca/alias_unused | 36 | 36 | 0
should_pass/dca/impl_trait_multiple | 36 | 36 | 0
should_pass/dca/impl_self_alias | 36 | 36 | 0
should_pass/dca/alias_type_ascription | 36 | 36 | 0
should_pass/dca/constant_decl_expr | 52 | 52 | 0
should_pass/dca/constant_while | 36 | 36 | 0
should_pass/dca/unused_fields | 36 | 36 | 0
should_pass/superabi_diamond_impl | 26052 | 18508 | 28.9574696760325
should_pass/static_analysis/cei_pattern_violation_storage_var_read | 524
| 524 | 0
should_pass/static_analysis/cei_pattern_violation_in_intrinsic_call |
260 | 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_tuple | 260 | 260 |
0
should_pass/static_analysis/cei_pattern_violation_in_asm_block | 240 |
240 | 0
should_pass/static_analysis/cei_pattern_violation_in_while_loop-4 | 260
| 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_asm_block_tr | 332
| 332 | 0
should_pass/static_analysis/cei_pattern_violation_smo_intrinsic | 296 |
296 | 0
should_pass/static_analysis/cei_pattern_violation_more_complex_logic |
31200 | 21904 | 29.7948717948718
should_pass/static_analysis/cei_pattern_violation_in_struct | 260 | 260
| 0
should_pass/static_analysis/cei_pattern_violation_in_asm_block_read |
224 | 224 | 0
should_pass/static_analysis/cei_pattern_violation_in_while_loop-2 | 260
| 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_while_loop-1 | 260
| 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_while_loop-3 | 260
| 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_func_app-1 | 260 |
260 | 0
should_pass/static_analysis/cei_pattern_violation_in_func_app-2 | 260 |
260 | 0
should_pass/static_analysis/cei_pattern_violation | 260 | 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_asm_block_tro |
1292 | 972 | 24.7678018575851
should_pass/static_analysis/cei_pattern_violation_in_func_app-3 | 260 |
260 | 0
should_pass/static_analysis/cei_pattern_violation_in_if_statement-2 |
260 | 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_asm_block_bal | 212
| 212 | 0
should_pass/static_analysis/storage_annotations_unused_read | 68 | 68 |
0

should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions
| 260 | 260 | 0
should_pass/static_analysis/cei_pattern_violation_in_asm_block_smo | 220
| 220 | 0
should_pass/static_analysis/cei_pattern_violation_storage_struct_read |
516 | 508 | 1.55038759689923
should_pass/static_analysis/cei_pattern_violation_storage_var_update |
452 | 452 | 0

should_pass/static_analysis/cei_pattern_violation_in_standalone_function
| 260 | 260 | 0
should_pass/static_analysis/storage_annotations_unused_read_and_write |
68 | 68 | 0
should_pass/static_analysis/storage_annotations_unused_write | 68 | 68 |
0
should_pass/static_analysis/cei_pattern_violation_in_if_statement-1 |
284 | 284 | 0
should_pass/static_analysis/cei_pattern_violation_storage_map_and_vec |
15076 | 9804 | 34.9694879278323
should_pass/static_analysis/cei_pattern_violation_in_match_statement-1 |
452 | 388 | 14.1592920353982
should_pass/supertraits_for_abis_diamond | 68 | 68 | 0
should_pass/test_abis/abi_impl_methods_in_json_abi | 100 | 100 | 0
should_pass/test_abis/abi_impl_methods_callable | 84 | 84 | 0
should_pass/superabi | 100 | 100 | 0
should_pass/non_payable_zero_coins_let_binding | 240 | 240 | 0
should_pass/blanket_impl_u16 | 52 | 52 | 0
should_pass/multiple_supertraits_for_abis | 100 | 100 | 0
should_pass/unit_tests/contract_with_nested_libs | 124 | 124 | 0
should_pass/unit_tests/script_with_nested_libs | 132 | 132 | 0
should_pass/unit_tests/should_revert | 68 | 68 | 0
should_pass/unit_tests/predicate_multi_test | 204 | 204 | 0
should_pass/unit_tests/lib_single_test | 36 | 36 | 0
should_pass/unit_tests/regalloc_spill | 412 | 412 | 0
should_pass/unit_tests/contract_multi_test | 68 | 68 | 0
should_pass/unit_tests/script_multi_test | 136 | 136 | 0
should_pass/unit_tests/nested_libs | 124 | 124 | 0
should_pass/unit_tests/workspace_test | 136 | 136 | 0
should_pass/unit_tests/contract-multi-contract-calls | 68 | 68 | 0
should_pass/unit_tests/script-contract-calls | 68 | 68 | 0
should_pass/unit_tests/stack_indexing_overflow | 4148 | 3804 |
8.29315332690453
should_pass/unit_tests/predicate_with_nested_libs | 76 | 76 | 0
should_pass/unit_tests/lib_multi_test | 116 | 116 | 0
should_pass/supertraits_via_self | 36 | 36 | 0
should_pass/test_contracts/storage_configurable | 68 | 68 | 0
should_pass/test_contracts/context_testing_contract | 388 | 388 | 0
should_pass/test_contracts/contract_with_type_aliases | 172 | 172 | 0
should_pass/test_contracts/basic_storage | 26052 | 18508 |
28.9574696760325
should_pass/test_contracts/storage_access_contract | 10916 | 10916 | 0
should_pass/test_contracts/auth_testing_contract | 76 | 76 | 0
should_pass/test_contracts/nested_struct_args_contract | 100 | 100 | 0
should_pass/test_contracts/abi_with_tuples_contract | 108 | 108 | 0
should_pass/test_contracts/test_fuel_coin_contract | 276 | 276 | 0
should_pass/test_contracts/array_of_structs_contract | 196 | 196 | 0
should_pass/test_contracts/return_struct | 2920 | 2040 |
30.1369863013699
should_pass/test_contracts/abi_with_generic_types | 192 | 192 | 0
should_pass/test_contracts/balance_test_contract | 84 | 84 | 0
should_pass/test_contracts/multiple_impl | 92 | 92 | 0
should_pass/test_contracts/abi_with_same_name_types | 112 | 112 | 0
should_pass/test_contracts/issue_1512_repro | 1324 | 1284 |
3.02114803625378
should_pass/test_contracts/increment_contract | 828 | 828 | 0
should_pass/superabi_contract_calls | 124 | 124 | 0
should_pass/conditional_compilation/run | 52 | 52 | 0
should_pass/empty_fields_in_storage_struct | 25516 | 18588 |
27.1515911584888
should_pass/payable_non_zero_coins | 196 | 196 | 0
should_pass/supertraits_for_abis | 100 | 100 | 0
should_pass/blanket_impl | 52 | 52 | 0
</details>
  • Loading branch information
vaivaswatha authored Sep 20, 2023
1 parent d61fc36 commit 0b35ceb
Show file tree
Hide file tree
Showing 17 changed files with 1,058 additions and 408 deletions.
7 changes: 5 additions & 2 deletions sway-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ use sway_ast::AttributeDecl;
use sway_error::handler::{ErrorEmitted, Handler};
use sway_ir::{
create_o1_pass_group, register_known_passes, Context, Kind, Module, PassManager,
ARGDEMOTION_NAME, CONSTDEMOTION_NAME, DCE_NAME, MEMCPYOPT_NAME, MISCDEMOTION_NAME,
MODULEPRINTER_NAME, RETDEMOTION_NAME, SIMPLIFYCFG_NAME,
ARGDEMOTION_NAME, CONSTDEMOTION_NAME, DCE_NAME, MEM2REG_NAME, MEMCPYOPT_NAME,
MISCDEMOTION_NAME, MODULEPRINTER_NAME, RETDEMOTION_NAME, SIMPLIFYCFG_NAME, SROA_NAME,
};
use sway_types::constants::DOC_COMMENT_ATTRIBUTE_NAME;
use sway_types::SourceEngine;
Expand Down Expand Up @@ -765,6 +765,9 @@ pub(crate) fn compile_ast_to_ir_to_asm(
// Run a DCE and simplify-cfg to clean up any obsolete instructions.
pass_group.append_pass(DCE_NAME);
pass_group.append_pass(SIMPLIFYCFG_NAME);
pass_group.append_pass(SROA_NAME);
pass_group.append_pass(MEM2REG_NAME);
pass_group.append_pass(DCE_NAME);
}

if build_config.print_ir {
Expand Down
4 changes: 2 additions & 2 deletions sway-ir/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pub mod call_graph;
pub use call_graph::*;
pub mod dominator;
pub use dominator::*;
pub mod escaped_symbols;
pub use escaped_symbols::*;
pub mod memory_utils;
pub use memory_utils::*;
134 changes: 0 additions & 134 deletions sway-ir/src/analysis/escaped_symbols.rs

This file was deleted.

Loading

0 comments on commit 0b35ceb

Please sign in to comment.