[llvm] [SLP] Check for extracts, being replaced by original scalars, for user nodes (PR #149572)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 09:38:40 PDT 2025


================
@@ -10700,6 +10801,15 @@ void BoUpSLP::buildTreeRec(ArrayRef<Value *> VLRef, unsigned Depth,
     return;
   }
 
+  // Postpone vectorization, if the node is not profitable because of the
+  // external uses.
----------------
gbossu wrote:

Fair enough, eventually we will look at uses outside the tree because we check if `UserTree` has non-vectorized uses. I would still update the comment as:
```
  // Postpone vectorization if the node is not profitable because of
  // external uses of UserTreeIdx.UserTE
```

Otherwise it feels like we are checking external uses of `VL`, which is not what this function is doing.

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


More information about the llvm-commits mailing list