[PATCH] D41133: [X86] Make the code that creates fmaddsub from build_vector of extracts and inserts functional and add tests.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 09:44:28 PST 2017


craig.topper added a comment.

I'll add the fsubadd tests as a follow up.



================
Comment at: lib/Target/X86/X86ISelLowering.cpp:29717
   SDValue Opnd2;
-  if (isFMAddSub(Subtarget, DAG, Opnd0, Opnd1, Opnd2))
+  if (isFMAddSub(Subtarget, DAG, Opnd0, Opnd1, Opnd2, 2))
     return DAG.getNode(X86ISD::FMADDSUB, DL, VT, Opnd0, Opnd1, Opnd2);
----------------
RKSimon wrote:
> Doesn't the ExpectedUses have to be 2/4/8 for xmm/ymm/zmm (double)? and 4/8/16 for float?
This call site is for matching a shuffle that interleaves a single fadd and fsub result together. So the only users of the fmul should be the full vector width fadd and fsub. The number of elements doesn't matter.


https://reviews.llvm.org/D41133





More information about the llvm-commits mailing list