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

Function is_viable_expansion

Tools/cases_generator/opcode_metadata_generator.py:303–314  ·  view source on GitHub ↗

An instruction can be expanded if all its parts are viable for tier 2

(inst: Instruction)

Source from the content-addressed store, hash-verified

301
302
303def is_viable_expansion(inst: Instruction) -> bool:
304 "An instruction can be expanded if all its parts are viable for tier 2"
305 for part in inst.parts:
306 if isinstance(part, Uop):
307 # Skip specializing and replaced uops
308 if "specializing" in part.annotations:
309 continue
310 if "replaced" in part.annotations:
311 continue
312 if part.properties.tier == 1 or not part.is_viable():
313 return False
314 return True
315
316
317def generate_extra_cases(analysis: Analysis, out: CWriter) -> None:

Callers 1

generate_expansion_tableFunction · 0.85

Calls 1

is_viableMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…