[PATCH] D62338: [globalisel][legalizer] Combine G_TRUNC+G_MERGE_VALUES in artifact combiner

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 11:52:16 PDT 2019


dsanders created this revision.
dsanders added reviewers: bogner, aditya_nandakumar, volkan, aemerson, paquette, arsenm, rovka, Petar.Avramovic.
Herald added subscribers: javed.absar, kristof.beyls, mgorny, nhaehnle, wdng, jvesely.
Herald added a project: LLVM.

This has a fairly good chance of killing off significant amounts of dead
code when narrowScalar() is used to legalize certain instructions since
it removes vestigial uses of the upper component of a G_MERGE_VALUES that
may not contribute to the final value. For example, a sequence of s128
operations narrowScalar'd to s64 that ends in a truncation to s64 can
discard all the operations for the upper s64. As they are no longer
kept alive by the use of the lower s64.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62338

Files:
  llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-inserts.mir
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-undef.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ctlz-zero-undef.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ctlz.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-unmerge-values.mir
  llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt
  llvm/unittests/CodeGen/GlobalISel/GISelMITest.h
  llvm/unittests/CodeGen/GlobalISel/LegalizerArtifactCombinerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62338.201035.patch
Type: text/x-patch
Size: 19482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190523/3bc4310f/attachment.bin>


More information about the llvm-commits mailing list