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

Function analyze_caches

Tools/cases_generator/analyzer.py:424–436  ·  view source on GitHub ↗
(inputs: list[parser.InputEffect])

Source from the content-addressed store, hash-verified

422
423
424def analyze_caches(inputs: list[parser.InputEffect]) -> list[CacheEntry]:
425 caches: list[parser.CacheEffect] = [
426 i for i in inputs if isinstance(i, parser.CacheEffect)
427 ]
428 if caches:
429 # Middle entries are allowed to be unused. Check first and last caches.
430 for index in (0, -1):
431 cache = caches[index]
432 if cache.name == "unused":
433 position = "First" if index == 0 else "Last"
434 msg = f"{position} cache entry in op is unused. Move to enclosing macro."
435 raise analysis_error(msg, cache.tokens[0])
436 return [CacheEntry(i.name, int(i.size)) for i in caches]
437
438
439def find_variable_stores(node: parser.InstDef) -> list[lexer.Token]:

Callers 1

make_uopFunction · 0.85

Calls 2

analysis_errorFunction · 0.85
CacheEntryClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…