SuccessChanges

Summary

  1. GlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources Extract the sources to the GCD of the original size and target size, padding with implicit_def as necessary. Also fix the case where the requested source type is wider than the original result type. This was ignoring the type, and just using the destination. Do the operation in the requested type and truncate back.
  2. GlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES Use an anyext to the requested type for the leftover operand to produce a slightly wider type, and then truncate the final merge. I have another implementation almost ready which handles arbitrary widens, but I think it produces worse code in this example (which I think is 90% due to not folding redundant copies or folding out implicit_def users), so I wanted to add this as a baseline first.
Revision 366367 by arsenm:
GlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources

Extract the sources to the GCD of the original size and target size,
padding with implicit_def as necessary.

Also fix the case where the requested source type is wider than the
original result type. This was ignoring the type, and just using the
destination. Do the operation in the requested type and truncate back.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/Support/MathExtras.h (diff)llvm.src/include/llvm/Support/MathExtras.h
The file was modified/llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp (diff)llvm.src/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modified/llvm/trunk/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp (diff)llvm.src/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
The file was modified/llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/legalize-merge-values.mir (diff)llvm.src/test/CodeGen/AMDGPU/GlobalISel/legalize-merge-values.mir
The file was modified/llvm/trunk/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp (diff)llvm.src/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
Revision 366366 by arsenm:
GlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES

Use an anyext to the requested type for the leftover operand to
produce a slightly wider type, and then truncate the final merge.

I have another implementation almost ready which handles arbitrary
widens, but I think it produces worse code in this example (which I
think is 90% due to not folding redundant copies or folding out
implicit_def users), so I wanted to add this as a baseline first.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp (diff)llvm.src/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modified/llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/legalize-merge-values.mir (diff)llvm.src/test/CodeGen/AMDGPU/GlobalISel/legalize-merge-values.mir
The file was modified/llvm/trunk/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp (diff)llvm.src/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp