@@ -198,7 +198,7 @@ class Instruction:
198198 # Parts of the underlying instruction definition
199199 inst : parser .InstDef
200200 register : bool
201- kind : typing .Literal ["inst" , "op" , "legacy" ] # Legacy means no (input -- output)
201+ kind : typing .Literal ["inst" , "op" ]
202202 name : str
203203 block : parser .Block
204204 block_text : list [str ] # Block.text, less curlies, less PREDICT() calls
@@ -838,8 +838,6 @@ def get_stack_effect_info(
838838 self , thing : parser .InstDef | parser .Super | parser .Macro
839839 ) -> tuple [AnyInstruction | None , str , str ]:
840840 def effect_str (effects : list [StackEffect ]) -> str :
841- if getattr (thing , "kind" , None ) == "legacy" :
842- return str (- 1 )
843841 n_effect , sym_effect = list_effect_size (effects )
844842 if sym_effect :
845843 return f"{ sym_effect } + { n_effect } " if n_effect else sym_effect
@@ -966,15 +964,12 @@ def write_metadata(self) -> None:
966964 def write_metadata_for_inst (self , instr : Instruction ) -> None :
967965 """Write metadata for a single instruction."""
968966 dir_op1 = dir_op2 = dir_op3 = "DIR_NONE"
969- if instr .kind == "legacy" :
970- assert not instr .register
971- else :
972- if instr .register :
973- directions : list [str ] = []
974- directions .extend ("DIR_READ" for _ in instr .input_effects )
975- directions .extend ("DIR_WRITE" for _ in instr .output_effects )
976- directions .extend ("DIR_NONE" for _ in range (3 ))
977- dir_op1 , dir_op2 , dir_op3 = directions [:3 ]
967+ if instr .register :
968+ directions : list [str ] = []
969+ directions .extend ("DIR_READ" for _ in instr .input_effects )
970+ directions .extend ("DIR_WRITE" for _ in instr .output_effects )
971+ directions .extend ("DIR_NONE" for _ in range (3 ))
972+ dir_op1 , dir_op2 , dir_op3 = directions [:3 ]
978973 self .out .emit (
979974 f" [{ instr .name } ] = {{ { dir_op1 } , { dir_op2 } , { dir_op3 } , true, { INSTR_FMT_PREFIX } { instr .instr_fmt } }},"
980975 )
0 commit comments