GlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 17 Jul 2019 20:22:38 +0000 (20:22 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 17 Jul 2019 20:22:38 +0000 (20:22 +0000)
commit914a59cad825f322ef10273327e708fe5eb78283
tree3878f684cc227582940e418b011b91d36c98c347
parenta0858e2f20c84df1be9d0add9b726996bbe395a4
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.

llvm-svn: 366366
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-merge-values.mir
llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp