https://github.com/arsenm commented: Checking specifically for select x, cast, cast seems too specific of a pattern to defend against an assertion. What happens if there are arbitrary indexing separating them? https://github.com/llvm/llvm-project/pull/98456