circt/test/Dialect/LLHD
Fabian Schuiki 0d8106e640
[LLHD] Add support for `llhd.sig.array_get` projections to Mem2Reg (#8509)
Extend the Mem2Reg pass to support drives to `llhd.sig.array_get`
projections into a promotable signal. This requires a few changes:

- When checking whether a signal is promotable, we have to recursively
  check its users and look through `llhd.sig.array_get` ops to see if
  all uses are safe for promotion.

- The lattice used to propagate needed and reaching definitions has to
  track the projection being driven separately from the underlying root
  slot being driven.

- A new set of helpers to unpack and pack stacks of projections help
  probes and drives take a promotable slot and its value, descend into
  subfields as indicated by a set of projection ops ("unpack"), and then
  optionally mutate the value of a subfield and zip the updated value
  back up to the promotable slot ("pack").

- During backward and forward propagation across the lattice, drives to
  projections have to create the need for a definition of the slot to be
  available because they have to take the slot's current value in order
  to mutate the projected field.

- The functions that resolve definitions have to unpack a slot's value
  according to the projections between the probe and the slot. In case
  of a drive they also have to mutate the projected field value after
  unpacking and then pack everything back op in order to create a new
  reaching definition for the entire slot to be forwarded to readers.

This commit also drops `slotOrder` in favor of a `promotable` set of
values. The actual order of slots was never used.
2025-05-23 13:23:15 -07:00
..
Canonicalization [LLHD] Remove unused ConnectOp 2025-03-05 09:49:15 -08:00
IR [LLHD] Remove unused ConnectOp 2025-03-05 09:49:15 -08:00
Transforms [LLHD] Add support for `llhd.sig.array_get` projections to Mem2Reg (#8509) 2025-05-23 13:23:15 -07:00