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

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 06:14:47 PST 2024


================
@@ -12557,7 +12575,10 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
       auto *Inst = cast<Instruction>(EU.Scalar);
       InstructionCost ScalarCost = TTI->getInstructionCost(Inst, CostKind);
       auto OperandIsScalar = [&](Value *V) {
-        if (!getTreeEntry(V)) {
+        if (auto *TE = getTreeEntry(V);
+            // All constants entry does not result in a seperate instruction.
+            // Ignore such entry.
+            !TE || (TE && allConstant(TE->Scalars))) {
----------------
alexey-bataev wrote:

I don't see why this should be modified

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


More information about the llvm-commits mailing list