[PATCH] D87117: [GlobalISel] Add G_UNMERGE_VALUES(G_MERGE_VALUES) combine

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 16:16:28 PDT 2020


qcolombet created this revision.
qcolombet added reviewers: arsenm, aemerson, paquette.
Herald added subscribers: hiraditya, rovka.
Herald added a project: LLVM.
qcolombet requested review of this revision.
Herald added a subscriber: wdng.

Add the matching and applying function to the combiner helper for
G_UNMERGE_VALUES(G_MERGE_VALUES).

This combine also supports any merge-like input nodes, like G_BUILD_VECTORS
and is robust against bitcasts in between int unmerge and merge nodes.

When the input type of the merge node and the output type of the unmerge
node are not the same, but the sizes are, the combine still applies but
creates bitcasts between the sources and the destinations instead of
reusing the destinations directly.

Long term, the artifact combiner should probably reuse that helper, but
as of today, it doesn't use any outside helper, so I kept it this way.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87117

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/combine-unmerge.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87117.289830.patch
Type: text/x-patch
Size: 12204 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200903/1312d4a8/attachment.bin>


More information about the llvm-commits mailing list