(uop: Uop)
| 26 | |
| 27 | |
| 28 | def uop_cache_info(uop: Uop) -> list[str] | None: |
| 29 | if uop.name == "_SPILL_OR_RELOAD": |
| 30 | return None |
| 31 | if uop.properties.records_value: |
| 32 | return None |
| 33 | default = "{ -1, -1, -1 },\n" |
| 34 | table_size = MAX_CACHED_REGISTER + 1 |
| 35 | entries = [ default ] * table_size |
| 36 | low = MAX_CACHED_REGISTER+1 |
| 37 | high = -1 |
| 38 | defined = [ False ] * 4 |
| 39 | for inputs, outputs, exit_depth in get_uop_cache_depths(uop): |
| 40 | entries[inputs] = f"{{ {outputs}, {exit_depth}, {uop.name}_r{inputs}{outputs} }},\n" |
| 41 | if inputs < low: |
| 42 | low = inputs |
| 43 | if inputs > high: |
| 44 | high = inputs |
| 45 | best = [ str(low if i < low else (high if high < i else i)) for i in range(MAX_CACHED_REGISTER+1) ] |
| 46 | |
| 47 | return [ f".best = {{ {', '.join(best)} }},\n", ".entries = {\n", ] + entries + [ "},\n" ] |
| 48 | |
| 49 | |
| 50 | CACHING_INFO_DECL = """ |
no test coverage detected
searching dependent graphs…