[llvm] [SLP][REVEC] Make ShuffleCostEstimator and ShuffleInstructionBuilder can vectorize vector instructions. (PR #99606)

Han-Kuan Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 06:06:16 PDT 2024


================
@@ -12179,6 +12217,8 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
         }
     }
     int VF = cast<FixedVectorType>(V1->getType())->getNumElements();
+    if (auto *VecTy = dyn_cast<FixedVectorType>(ScalarTy))
+      VF /= VecTy->getNumElements();
----------------
HanKuanChen wrote:

We can make `getVF` into a protected member function of `BaseShuffleAnalysis`. However, `BaseShuffleAnalysis` would need to store `ScalarTy`. See https://github.com/llvm/llvm-project/pull/99606/commits/f1de612dbf027f53e1f7dff1616aa1a98f2acd26.

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


More information about the llvm-commits mailing list