[llvm] [VPlan] Consolidate logic for narrowToSingleScalars (NFC) (PR #167360)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 11 00:11:55 PST 2025


================
@@ -1418,7 +1394,9 @@ static void narrowToSingleScalarRecipes(VPlan &Plan) {
       // Skip recipes that aren't single scalars or don't have only their
       // scalar results used. In the latter case, we would introduce extra
       // broadcasts.
-      if (!vputils::isSingleScalar(RepOrWidenR) ||
+      if ((!vputils::isSingleScalar(RepOrWidenR) &&
+           !vputils::onlyFirstLaneUsed(RepOrWidenR)) ||
+          RepOrWidenR->getNumUsers() == 0 ||
----------------
artagnon wrote:

Yes, it is needed to exclude replicate stores?

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


More information about the llvm-commits mailing list