[PATCH] D79652: [X86] Remove the v16i8->v16i16 path for MULHS with AVX2.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 14:31:38 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, andreadb.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

We have a couple main strategies for legalizing MULH.

-If the vXi16 type is legal, extend to do the full i16 multiply
and then shift and truncate the results.
-Use unpcks to split each 128 bit lane into high and low halves.a

For signed we have an extra case to split a v32i8 to v16i8 and then
use the extending to v16i16 strategy.

This patch proposes to use the unpck strategy instead. Which is
what we already do for unsigned.

This seems to be 1 instruction shorter when the RHS is constant
like the idiv case. It's 1 instruction longer for the smulo case.
But we're trading cross lane shuffles for inlane shuffles and a
shift.

I'm not sure this is the right answer, so I wanted to put it out
there for discussion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79652

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/vec_smulo.ll
  llvm/test/CodeGen/X86/vector-idiv-sdiv-256.ll
  llvm/test/CodeGen/X86/vector-idiv-sdiv-512.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79652.262959.patch
Type: text/x-patch
Size: 42287 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200508/e7ecb5f4/attachment-0001.bin>


More information about the llvm-commits mailing list