In the long term, we should think about adding bitwise liveness analysis into the system, instead of using pattern matching. If the live bits out of a LoadB are contained in 0xFF, then we can transform to LoadUB.
Doing this would require a type system that can represent per-bit liveness, and an analysis phase that pushes such types backwards through the graph. That is a straightforward extension of our existing type system, augmenting the existing arithmetic range endpoints with corresponding bit masks.
��� John