[PATCH] D76947: [SelectionDAGBuilder][CGP][X86] Move some of SDB's gather/scatter uniform base handling to CGP.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 13:10:13 PDT 2020


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

I've always found the "findValue" a little odd and
inconsistent with other things in SDB.

This simplies the code in SDB to just handle a splat constant
address or a 2 operand GEP in the same BB. This removes the
need for "findValue" since the operands to the GEP are
guaranteed to be available. The splat constant handling is
new, but was needed to avoid regressions due to constant
folding combining GEPs created in CGP.

CGP is now responsible for canonicalizing gather/scatters into
this form. The pattern I'm using for scalarizing, a scalar GEP
followed by a GEP with an all zeroes index, seems to be subject
to constant folding that the insertelement+shufflevector was not.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76947

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  llvm/lib/IR/Verifier.cpp
  llvm/test/CodeGen/X86/masked_gather.ll
  llvm/test/CodeGen/X86/masked_gather_scatter.ll
  llvm/test/CodeGen/X86/pr45067.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76947.253200.patch
Type: text/x-patch
Size: 16124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200327/e35802ed/attachment.bin>


More information about the llvm-commits mailing list