Pierre-vh wrote: I updated the diff, need some help with the vector case because it can generate illegal ops. Ideally this would be in the legalizer but it has no uniformity info, see the TODO in the match function https://github.com/llvm/llvm-project/pull/106557