[PATCH] D31679: Use PMADDWD to expand reduction in a loop

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 19:25:51 PDT 2017


danielcdh added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:34630
+  // Fill the rest of the output with 0
+  SDValue Zero = getZeroVector(Madd.getSimpleValueType(), Subtarget, DAG, DL);
+  SDValue Concat = DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, Madd, Zero);
----------------
mkuper wrote:
> mkuper wrote:
> > Isn't Madd.getSimpleValueType() always MVT::i32?
> > 
> Just a sanity check - this is correct irrespective of whether the initial value for the reduction phi is 0 or not, right?
I suppose yes.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:34630
+  // Fill the rest of the output with 0
+  SDValue Zero = getZeroVector(Madd.getSimpleValueType(), Subtarget, DAG, DL);
+  SDValue Concat = DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, Madd, Zero);
----------------
danielcdh wrote:
> mkuper wrote:
> > mkuper wrote:
> > > Isn't Madd.getSimpleValueType() always MVT::i32?
> > > 
> > Just a sanity check - this is correct irrespective of whether the initial value for the reduction phi is 0 or not, right?
> I suppose yes.
It should be vector type instead of scalar type.


https://reviews.llvm.org/D31679





More information about the llvm-commits mailing list