[PATCH] D29402: [SLP] Initial rework for min/max horizontal reduction vectorization, NFC.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 07:41:33 PDT 2017


ABataev added inline comments.


================
Comment at: lib/Analysis/CostModel.cpp:196
+
+static bool matchPairwiseReductionAtLevel(Value *V, unsigned Level,
+                                          unsigned NumLevels) {
----------------
RKSimon wrote:
> ABataev wrote:
> > mkuper wrote:
> > > Can this ever be a Value that's not an Instruction?
> > > (Same question applies to getReductionOpcode())
> > Of course no, only instructions can be used here. I'll convert these params to `Instruction *`.
> Still not Instruction*
Investigated this problem once again, it maybe not of Instruction type, for example, it may be an Argument. So, we have to use Value * here.


================
Comment at: lib/Analysis/CostModel.cpp:200
+
+static ReductionData getReductionData(Instruction *I) {
+  Value *L, *R;
----------------
RKSimon wrote:
> Worth making this an Optional<> instead of relying on Opcode == 0?
Ok, will do


https://reviews.llvm.org/D29402





More information about the llvm-commits mailing list