[llvm] [VPlan] Preserve the branch weights of scalarized selects. (PR #224968)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 01:41:10 PDT 2026


================
@@ -527,6 +527,13 @@ void VPlanTransforms::convertToConcreteRecipes(VPlan &Plan) {
            vp_depth_first_deep(Plan.getEntry()))) {
     for (VPRecipeBase &R : make_early_inc_range(*VPBB)) {
       VPBuilder Builder(&R);
+      // !prof is only supported on scalar selects.
+      if (auto *Widen = dyn_cast<VPWidenRecipe>(&R)) {
----------------
david-arm wrote:

Can you use the pattern matcher `m_Select` here?

https://github.com/llvm/llvm-project/pull/224968


More information about the llvm-commits mailing list