[PATCH] D116039: [X86] Combine reduce(mul x, y) to VNNI instruction.

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 20 06:57:39 PST 2021


LuoYuanke created this revision.
Herald added subscribers: pengfei, hiraditya.
LuoYuanke requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For below C code, we can use VNNI to combine the mul and add operation.
int usdot_prod_qi(unsigned char *restrict a, char *restrict b, int c,

                  int n) {
  int i;
  for (i = 0; i < 32; i++) {
    c += ((int)a[i] * (int)b[i]);
  }
  return c;

}
We didn't support the combine acoss basic block in this patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116039

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86PartialReduction.cpp
  llvm/test/CodeGen/X86/dpbusd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116039.395435.patch
Type: text/x-patch
Size: 27543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211220/34319e64/attachment.bin>


More information about the llvm-commits mailing list