davemgreen wrote: I've added some tests, can you rebase? I'm pretty sure this LGTM, providing that the SVE tests still produce an invalid cost. (We will need to add lowering). https://github.com/llvm/llvm-project/pull/146373