https://github.com/ayalz commented: This looks right to me, thanks! Adding various comments. Worth noting in the commit message that the cost of VPWidenRecipe is computed directly, other recipes to follow. https://github.com/llvm/llvm-project/pull/92555