return None
return self.ty.base_ty
- def concat(self, *others):
- # type: (*LocSet) -> LocSet
- if self.ty is None:
- return LocSet()
- base_ty = self.ty.base_ty
- reg_len = self.ty.reg_len
- starts = {k: BitSet(v) for k, v in self.starts.items()}
- for other in others:
- if other.ty is None:
- return LocSet()
- if other.ty.base_ty != base_ty:
- return LocSet()
- for kind, other_starts in other.starts.items():
- if kind not in starts:
- continue
- starts[kind].bits &= other_starts.bits >> reg_len
- if starts[kind] == 0:
- del starts[kind]
- if len(starts) == 0:
- return LocSet()
- reg_len += other.ty.reg_len
-
- def locs():
- # type: () -> Iterable[Loc]
- for kind, v in starts.items():
- for start in v:
- loc = Loc.try_make(kind=kind, start=start, reg_len=reg_len)
- if loc is not None:
- yield loc
- return LocSet(locs())
-
@lru_cache(maxsize=None, typed=True)
def max_conflicts_with(self, other):
# type: (LocSet | Loc) -> int
self._verify_write_with_desc(idx, item, desc)
return idx
- def _on_set(self, idx, new_item, old_item):
- # type: (int, _T, _T | None) -> None
- pass
-
@abstractmethod
def _get_descriptors(self):
# type: () -> tuple[_Desc, ...]
raise ValueError(f"assigned item's type {item.ty!r} doesn't match "
f"corresponding input's type {desc.ty!r}")
- def _on_set(self, idx, new_item, old_item):
- # type: (int, SSAVal, SSAVal | None) -> None
- SSAUses._on_op_input_set(self, idx, new_item, old_item) # type: ignore
-
def __init__(self, items, op):
# type: (Iterable[SSAVal], Op) -> None
if hasattr(op, "inputs"):