[llvm] [VPlan] Introduce vputils::getSingleScalarClone (PR #161667)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 06:52:00 PDT 2025


================
@@ -250,3 +250,24 @@ vputils::getRecipesForUncountableExit(VPlan &Plan,
 
   return UncountableCondition;
 }
+
+VPSingleDefRecipe *vputils::getSingleScalarClone(VPSingleDefRecipe *R) {
+  return TypeSwitch<VPSingleDefRecipe *, VPSingleDefRecipe *>(R)
+      .Case<VPInstruction, VPWidenRecipe, VPWidenSelectRecipe,
----------------
david-arm wrote:

What about all the other VPSingleDefRecipe types, i.e. VPWidenPHIRecipe, VPBlendRecipe, VPExpressionRecipe, VPWidenCanonicalIVRecipe, etc? I'm a bit nervous that we might be missing some cases here. Have you tried running the LLVM test suite to catch any missing cases?

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


More information about the llvm-commits mailing list