[llvm] [SLP]: Introduce and use getDataFlowCost (PR #112999)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 19 10:20:05 PDT 2024


================
@@ -9044,6 +9044,51 @@ static SmallVector<Type *> buildIntrinsicArgTypes(const CallInst *CI,
   return ArgTys;
 }
 
+// The cost model may determine that vectorizing and eliminating a series of
+// ExtractElements is beneficial. However, if the input vector is a function
+// argument, the calling convention may require extractions in the geneerated
+// code. In this scenario, vectorizaino would then not eliminate the
+// ExtractElement sequence, but would add additional vectorization code.
+// getCCCostFromScalars does the proper accounting for this.
+static unsigned getCCCostFromScalars(ArrayRef<Value *> &Scalars,
----------------
alexey-bataev wrote:

I think it should be implemented in a separate patch

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


More information about the llvm-commits mailing list