MCPcopy Index your code
hub / github.com/python/cpython / uop_cache_info

Function uop_cache_info

Tools/cases_generator/uop_metadata_generator.py:28–47  ·  view source on GitHub ↗
(uop: Uop)

Source from the content-addressed store, hash-verified

26
27
28def 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
50CACHING_INFO_DECL = """

Callers 1

generate_names_and_flagsFunction · 0.85

Calls 3

get_uop_cache_depthsFunction · 0.90
strFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…