Skip to content

v0.0.0-9903-g32c6e63b3

Latest

Choose a tag to compare

Add a pass to replace OneHotSelect with Select.

This change introduces `RemoveOneHotSelectPass`, a development tool pass that transforms `OneHotSelect` operations into equivalent `Select` operations. For each `OneHotSelect`, a new `Select` is created with 2^N cases, where N is the bitwidth of the selector. Each case in the new `Select` corresponds to a unique bit pattern of the selector. If multiple bits are set in a selector pattern, the corresponding `OneHotSelect` cases are combined using an OR operation. To prevent excessive node creation, the pass only operates on `OneHotSelect` nodes with a selector bitwidth of 16 or less. This pass is intended for analysis and investigation purposes.

PiperOrigin-RevId: 906592025