https://github.com/lukel97 approved this pull request. LGTM + what Craig said. Test diff seems good so I don't think we need a heuristic. It looks like it has the benefit of shrinking the vrgather indices. https://github.com/llvm/llvm-project/pull/122311