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

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


================
@@ -189,19 +189,7 @@ static bool sinkScalarOperands(VPlan &Plan) {
     if (NeedsDuplicating) {
       if (ScalarVFOnly)
         continue;
-      VPSingleDefRecipe *Clone;
-      if (auto *SinkCandidateRepR =
-              dyn_cast<VPReplicateRecipe>(SinkCandidate)) {
-        // TODO: Handle converting to uniform recipes as separate transform,
-        // then cloning should be sufficient here.
-        Instruction *I = SinkCandidate->getUnderlyingInstr();
-        Clone = new VPReplicateRecipe(I, SinkCandidate->operands(), true,
-                                      nullptr /*Mask*/, *SinkCandidateRepR);
-        // TODO: add ".cloned" suffix to name of Clone's VPValue.
----------------
david-arm wrote:

Worth adding the TODO to getSingleScalarClone?

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


More information about the llvm-commits mailing list