The combiner for BUILD_VECTOR that merges consecutive loads into a wide load had two issues:
- It didn't check that the input loads all have the same input chain
- It didn't update nodes that are chained to the original loads to be chained to the new load
This caused issues with bootstrap when 3c4d2a03968ccf5889bacffe02d6fa2443b0260f was committed. This patch fixes the issue so it can unblock this commit.
Do we really need a SmallPtrSet here? We check each load exactly once, so we should be able to just use a SmallVector.
Iterating over a SmallPtrSet like this might lead to non-determinism.