[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
Mon Jul 28 02:01:58 PDT 2025


================
@@ -13356,6 +13479,16 @@ TTI::CastContextHint BoUpSLP::getCastContextHint(const TreeEntry &TE) const {
 InstructionCost
 BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef<Value *> VectorizedVals,
                       SmallPtrSetImpl<Value *> &CheckedExtracts) {
+  // No need to count the cost for combined entries, they are combined and
+  // just skip their cost.
+  if (E->State == TreeEntry::CombinedVectorize) {
+    LLVM_DEBUG(
+        dbgs() << "SLP: Skipping cost for combined node that starts with "
+               << E->Scalars[0] << ".\n";
+        E->dump());
+    return 0;
+  }
----------------
gbossu wrote:

Thanks, I think it's a better place for that check.

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


More information about the llvm-commits mailing list