Bases: LivenessContext
Helper to ensure that registers can be allocated in the input, inserting a move if
not.
Source code in xdsl/backend/x86/legalization.py
| @dataclass
class LegalizationContext(LivenessContext):
"""
Helper to ensure that registers can be allocated in the input, inserting a move if
not.
"""
arch: X86Arch
builder: Builder
def handle_live_inout(
self, op: Operation, value: SSAValue, *, duplicate_inout: bool = False
) -> SSAValue:
return self.arch.move_value_to_unallocated(
value,
self.builder,
value_type=None,
insertion_point=InsertPoint.before(op),
)
|
arch: X86Arch
instance-attribute
builder: Builder
instance-attribute
__init__(alive: set[SSAValue], arch: X86Arch, builder: Builder) -> None
handle_live_inout(op: Operation, value: SSAValue, *, duplicate_inout: bool = False) -> SSAValue
Source code in xdsl/backend/x86/legalization.py
| def handle_live_inout(
self, op: Operation, value: SSAValue, *, duplicate_inout: bool = False
) -> SSAValue:
return self.arch.move_value_to_unallocated(
value,
self.builder,
value_type=None,
insertion_point=InsertPoint.before(op),
)
|