[PATCH] D77475: GlobalISel: Combine G_UNMERGE_VALUES with G_TRUNC

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 4 13:49:59 PDT 2020


arsenm created this revision.
arsenm added reviewers: aemerson, aditya_nandakumar, dsanders, paquette.
Herald added subscribers: kerbowa, rovka, nhaehnle, wdng, jvesely.

G_MERGE_VALUES with different types, but G_UNMERGE_VALUES of a vector
can also be implemented with a bitcast to a scalar, which introduces
the possibility for infinite loops. Try to eliminate an illegal source
register type in the artifact combiner to avoid this from happening.

      

Avoids infinite looping in the legalizer in a future patch which
allows lowering G_UNMERGE_VALUES of a vector source with a G_BITCAST.


https://reviews.llvm.org/D77475

Files:
  llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-select.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-sext.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-unmerge-values.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-and.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-bitcast.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-or.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-select.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-sext-inreg.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-trunc.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-unmerge-values-xfail.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-unmerge-values.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-xor.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77475.255078.patch
Type: text/x-patch
Size: 78166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200404/922e895a/attachment.bin>


More information about the llvm-commits mailing list