[PATCH] D141778: [DAGCombiner][X86] `mergeConsecutiveStores()`: support merging splat-stores of the same value

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 14 17:52:34 PST 2023


lebedev.ri created this revision.
lebedev.ri added reviewers: RKSimon, craig.topper, spatel.
lebedev.ri added a project: LLVM.
Herald added subscribers: StephenFan, ecnelises, pengfei, hiraditya.
Herald added a project: All.
lebedev.ri requested review of this revision.
Herald added a subscriber: pcwang-thead.

`getStoreMergeCandidates()` is quite obious for this kind
of source - just look for identical store values.
`tryStoreMergeOfConstants()` basically already supports it,
we just need to bypass some checks that are constant-specific.

For X86, this does appear to be always better,
as long as we store at least a single full vector register.
But the test changes for other targets were more questionable,
so i didn't enable it elsewhere.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141778

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/test/CodeGen/X86/MergeConsecutiveStores.ll
  llvm/test/CodeGen/X86/elementwise-store-of-scalar-splat.ll
  llvm/test/CodeGen/X86/legalize-shl-vec.ll
  llvm/test/CodeGen/X86/wide-scalar-shift-by-byte-multiple-legalization.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141778.489320.patch
Type: text/x-patch
Size: 114431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230115/ee62c34d/attachment.bin>


More information about the llvm-commits mailing list