GH-111485: Use micro-ops to split specialization code from base action (GH-111561)

This commit is contained in:
Mark Shannon 2023-11-01 10:53:27 +00:00 committed by GitHub
parent eaf67e37a2
commit b14e882428
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 864 additions and 583 deletions

View file

@ -178,17 +178,17 @@ class Generator(Analyzer):
# for all targets.
for target in self.pseudos[thing.name].targets:
target_instr = self.instrs.get(target)
# Currently target is always an instr. This could change
# in the future, e.g., if we have a pseudo targetting a
# macro instruction.
assert target_instr
target_popped = effect_str(target_instr.input_effects)
target_pushed = effect_str(target_instr.output_effects)
if popped is None:
popped, pushed = target_popped, target_pushed
if target_instr is None:
macro_instr = self.macro_instrs[target]
popped, pushed = stacking.get_stack_effect_info_for_macro(macro_instr)
else:
assert popped == target_popped
assert pushed == target_pushed
target_popped = effect_str(target_instr.input_effects)
target_pushed = effect_str(target_instr.output_effects)
if popped is None:
popped, pushed = target_popped, target_pushed
else:
assert popped == target_popped
assert pushed == target_pushed
case _:
assert_never(thing)
assert popped is not None and pushed is not None