[PATCH] D107689: [X86] Teach shouldSinkOperands to recognize pmuldq/pmuludq patterns.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 23:13:03 PDT 2021


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

The IR for pmuldq/pmuludq intrinsics uses a sext_inreg/zext_inreg
pattern on the inputs. Ideally we pattern match these away during
isel. It is possible for LICM or other middle end optimizations
to separate the extend from the mul. This prevents SelectionDAG
from removing it or depending on how the extend is lowered, we
may not be able to generate an AssertSExt/AssertZExt in the
mul basic block. This will prevent pmuldq/pmuludq from being
formed at all.

This patch teaches shouldSinkOperands to recognize this so
that CodeGenPrepare will clone the extend into the same basic
block as the mul.

Fixes PR51371.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107689

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107689.364933.patch
Type: text/x-patch
Size: 5432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210807/d02b8904/attachment.bin>


More information about the llvm-commits mailing list