https://github.com/RKSimon requested changes to this pull request. please can you rebase after #147472 - I think what you're after is just the undef element handling that isConstantSplatVector gives you by default https://github.com/llvm/llvm-project/pull/147305