[GlobalISel] support widen unmerge if WideTy > SrcTy
authorDominik Montada <dominik.montada@hightec-rt.com>
Fri, 20 Mar 2020 13:46:01 +0000 (14:46 +0100)
committerDominik Montada <dominik.montada@hightec-rt.com>
Mon, 23 Mar 2020 08:16:45 +0000 (09:16 +0100)
commitccf49b9ef012bab44b1f1322223e8b2e5ca89bad
tree3c7799441cdd04ccb553421c1ae2633e55007570
parent0cc124c186a5211ae5a734fe7708d61b5a150bc2
[GlobalISel] support widen unmerge if WideTy > SrcTy

Summary:
Widening G_UNMERGE_VALUES to a type which is larger than the
original source type is the same as widening it to the same
type as the source type: in both cases, G_UNMERGE_VALUES has
to be replaced with bit arithmetic which. Although the arithmetic
itself is independent of whether the source type is smaller
or equal to the widen type, widening the source type to the
widen type should result in less artifacts being emitted,
since this is the type that the user explicitly requested.

Reviewers: arsenm, dsanders, aemerson, aditya_nandakumar

Reviewed By: arsenm, dsanders

Subscribers: jvesely, wdng, nhaehnle, rovka, hiraditya, volkan, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76494
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-unmerge-values.mir
llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp