[PATCH] D110995: [X86] combineMulToPMADDWD - handle any pow2 vector type and split to legal types

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 2 07:50:03 PDT 2021


RKSimon created this revision.
RKSimon added reviewers: craig.topper, xbolva00, lebedev.ri, pengfei.
Herald added subscribers: hiraditya, inglorion.
RKSimon requested review of this revision.
Herald added a project: LLVM.

combineMulToPMADDWD is currently limited to legal types, but there's no reason why we can't handle any larger type that the existing SplitOpsAndApply code can use to split to legal X86ISD::VPMADDWD ops.

This also exposed a missed opportunity for pre-SSE41 targets to handle SEXT ops from types smaller than vXi16 - without PMOVSX instructions these will always be expanded to unpack+shifts, so we can cheat and convert this into a ZEXT(SEXT()) sequence to make it a valid PMADDWD op.

There's still one regression in the SSE2 larger_mul test that I'm currently investigating.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110995

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/madd.ll
  llvm/test/CodeGen/X86/pmaddubsw.ll
  llvm/test/CodeGen/X86/pmulh.ll
  llvm/test/CodeGen/X86/shrink_vmul.ll
  llvm/test/CodeGen/X86/slow-pmulld.ll
  llvm/test/CodeGen/X86/vshli-simplify-demanded-bits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110995.376705.patch
Type: text/x-patch
Size: 54141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211002/02c8b8cc/attachment-0001.bin>


More information about the llvm-commits mailing list