[llvm-branch-commits] [llvm] [LoopVectorizer] Bundle partial reductions inside VPMulAccumulateReductionRecipe (PR #136173)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 30 06:43:03 PDT 2025


================
@@ -986,11 +986,23 @@ InstructionCost TargetTransformInfo::getShuffleCost(
 
 TargetTransformInfo::PartialReductionExtendKind
 TargetTransformInfo::getPartialReductionExtendKind(Instruction *I) {
-  if (isa<SExtInst>(I))
-    return PR_SignExtend;
-  if (isa<ZExtInst>(I))
+  auto *Cast = dyn_cast<CastInst>(I);
+  if (!Cast)
+    return PR_None;
+  return getPartialReductionExtendKind(Cast->getOpcode());
----------------
sdesmalen-arm wrote:

```suggestion
  if (auto *Cast = dyn_cast<CastInst>(I))
    return getPartialReductionExtendKind(Cast->getOpcode());
  return PR_None;
```

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


More information about the llvm-branch-commits mailing list