[llvm] [AArch64][CostModel] Consider the cost of const vector (PR #117539)

Sushant Gokhale via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 28 01:49:36 PST 2024


================
@@ -10053,8 +10071,10 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
     return Constant::getAllOnesValue(Ty);
   }
 
-  InstructionCost getBuildVectorCost(ArrayRef<Value *> VL, Value *Root) {
-    if ((!Root && allConstant(VL)) || all_of(VL, IsaPred<UndefValue>))
+  InstructionCost getBuildVectorCost(ArrayRef<Value *> VL, Value *Root,
+                                     const TreeEntry *E = nullptr) {
+    if ((!Root && allConstant(VL) && isSplat(VL)) ||
+        all_of(VL, IsaPred<UndefValue>))
       return TTI::TCC_Free;
----------------
sushgokh wrote:

done

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


More information about the llvm-commits mailing list