(base_stats: Stats, head_stats: Stats | None = None)
| 938 | return calc |
| 939 | |
| 940 | def iter_specialization_tables(base_stats: Stats, head_stats: Stats | None = None): |
| 941 | opcode_base_stats = base_stats.get_opcode_stats("opcode") |
| 942 | names = opcode_base_stats.get_opcode_names() |
| 943 | if head_stats is not None: |
| 944 | opcode_head_stats = head_stats.get_opcode_stats("opcode") |
| 945 | names &= opcode_head_stats.get_opcode_names() # type: ignore |
| 946 | else: |
| 947 | opcode_head_stats = None |
| 948 | |
| 949 | for opcode in sorted(names): |
| 950 | if not opcode_base_stats.is_specializable(opcode): |
| 951 | continue |
| 952 | if opcode_base_stats.get_specialization_total(opcode) == 0 and ( |
| 953 | opcode_head_stats is None |
| 954 | or opcode_head_stats.get_specialization_total(opcode) == 0 |
| 955 | ): |
| 956 | continue |
| 957 | yield Section( |
| 958 | opcode, |
| 959 | f"specialization stats for {opcode} family", |
| 960 | [ |
| 961 | Table( |
| 962 | ("Kind", "Count:", "Ratio:"), |
| 963 | calc_specialization_table(opcode), |
| 964 | JoinMode.CHANGE, |
| 965 | ), |
| 966 | Table( |
| 967 | ("Success", "Count:", "Ratio:"), |
| 968 | calc_specialization_success_failure_table(opcode), |
| 969 | JoinMode.CHANGE, |
| 970 | ), |
| 971 | Table( |
| 972 | ("Failure kind", "Count:", "Ratio:"), |
| 973 | calc_specialization_failure_kind_table(opcode), |
| 974 | JoinMode.CHANGE, |
| 975 | ), |
| 976 | ], |
| 977 | ) |
| 978 | |
| 979 | return Section( |
| 980 | "Specialization stats", |
nothing calls this directly
no test coverage detected
searching dependent graphs…