[PATCH] D115757: [SLP]Generalize cost model.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 07:13:07 PDT 2022


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6313
+          ScalarCost = VL.size() *
+                       ScalarEltCost(std::distance(VL.begin(), find(VL, VL0)));
+        } else {
----------------
RKSimon wrote:
> Is this purely compile time saving?
Replaced by 0, since it does not matter.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6341
+        Value *Op = PHI->getIncomingValue(I);
+        Operands[I] = Op;
       }
----------------
RKSimon wrote:
> Can't we directly initialize Operands from PHI-> incoming_values()? Or even create a ArrayRef<> from it?
operand_value returns llvm::Use, Operands list requires Value *. Did not find better way to do it.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6675
+            if (getOperandInfo(VL, 0).isConstant())
+              OpVK = TTI::OK_NonUniformConstantValue;
+            return TTI->getMemoryOpCost(Instruction::Store, VecTy,
----------------
RKSimon wrote:
> Why do you avoid allowing uniform as well? Can't you just use getOperandInfo(VL, 0)..getNoProps() below ?
Just missed this change, will fix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115757/new/

https://reviews.llvm.org/D115757



More information about the llvm-commits mailing list