The current implementation has some inefficiencies that become noticeable when running on large modules. This revision optimizes the code, and updates some out-dated idioms with newer utilities. The main components of this optimization include:
- Add an overload of Block::eraseArguments that allows for O(N) erasure of disjoint arguments.
- Don't process entry block arguments given that we don't erase them at this point.
- Don't track individual operation results, given that we don't erase them. We can just track the parent operation.
firstDead ?