[PATCH] D111595: [X86] Move splat addends from the gather/scatter index operand to the base address

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 18:32:25 PDT 2021


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

This can avoid a vector add and a constant pool load. Or an explicit broadcast in case of non-constant.

Also reverse the transform any time we encounter a constant index addend that can't be moved to base. In that case pull the constant from base into the index. This reduces code size needed for the displacement since we needed the index add anyway. Limit this to scale of 1 to avoid divisibility and wrap issues.

Authored by Craig.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111595

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111595.378847.patch
Type: text/x-patch
Size: 17183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211012/287986c5/attachment.bin>


More information about the llvm-commits mailing list