[PATCH] D112505: [X86] Add a dependency breaking xor before any gathers with an undef passthru value.

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 20:04:18 PDT 2021


pengfei created this revision.
pengfei added reviewers: craig.topper, RKSimon, spatel, LuoYuanke.
Herald added a subscriber: hiraditya.
pengfei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In the instruction encoding, the passthru register is always
tied to the destination register. The CPU scheduler has to wait
for the last writer of this register to finish executing before
the gather can start. This is true even if the initial mask is
all ones so that the passthru will never be used.

By explicitly zeroing the register we can break the false
dependency. The zero idiom is executed completing by the
register renamer and so is immedately considered ready.

Authored by Craig.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112505

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/masked_gather.ll
  llvm/test/CodeGen/X86/masked_gather_scatter.ll
  llvm/test/CodeGen/X86/masked_gather_scatter_widen.ll
  llvm/test/CodeGen/X86/pr45067.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112505.382167.patch
Type: text/x-patch
Size: 44508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211026/58c00953/attachment.bin>


More information about the llvm-commits mailing list