[llvm] [VPlan] Use VPInstructionWithType for uniform casts. (PR #140623)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 08:22:53 PDT 2026


================
@@ -6839,7 +6844,10 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VPlanPtr Plan,
       if (isa<VPWidenCanonicalIVRecipe, VPBlendRecipe, VPReductionRecipe,
               VPReplicateRecipe, VPWidenLoadRecipe, VPWidenStoreRecipe,
               VPWidenCallRecipe, VPWidenIntrinsicRecipe, VPVectorPointerRecipe,
-              VPVectorEndPointerRecipe, VPHistogramRecipe>(&R))
+              VPVectorEndPointerRecipe, VPHistogramRecipe>(&R) ||
+          (isa<VPInstructionWithType>(R) &&
+           Instruction::isCast(cast<VPInstructionWithType>(R).getOpcode()) &&
+           vputils::onlyFirstLaneUsed(cast<VPInstructionWithType>(&R))))
----------------
artagnon wrote:

Yep, I understand that, but IsUniform is not perfectly equal to onlyFirstLaneUsed, so I guess it's an imperfect skipping?

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


More information about the llvm-commits mailing list