[llvm] [AMDGPU] Vectorize i8 Shuffles (PR #95840)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 14:04:03 PDT 2024


================
@@ -306,6 +306,18 @@ bool GCNTTIImpl::hasBranchDivergence(const Function *F) const {
   return !F || !ST->isSingleLaneExecution(*F);
 }
 
+unsigned GCNTTIImpl::getNumberOfParts(Type *Tp) const {
+  if (FixedVectorType *VTy = dyn_cast<FixedVectorType>(Tp)) {
+    if (DL.getTypeSizeInBits(VTy->getElementType()) == 8) {
+      unsigned ElCount = VTy->getElementCount().getFixedValue();
+      return ElCount / 4;
+    }
+  }
+
+  std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Tp);
+  return LT.first.isValid() ? *LT.first.getValue() : 0;
----------------
arsenm wrote:

This is really generic, why does this need overriding? 

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


More information about the llvm-commits mailing list