jayfoad wrote: This feels like a workaround. Compacting the slot indexes is a fundamentally better approach, it just requires fixing bugs in some analyses that currently keep references to slots for instructions that have been deleted. https://github.com/llvm/llvm-project/pull/224144