[GlobalISel] fix widenScalarUnmerge if widen type is not a multiple of destination...
authorDominik Montada <dominik.montada@hightec-rt.com>
Mon, 28 Sep 2020 14:38:35 +0000 (16:38 +0200)
committerDominik Montada <dominik.montada@hightec-rt.com>
Tue, 29 Sep 2020 13:52:20 +0000 (15:52 +0200)
commit113114a5da60ef30731046f50fc1d67ff87897fc
treee81c626b5aa53a803bec1992c4c5f7330522284b
parent074ab233ed620c1afa44e5bc2d86ab448a9ce1ed
[GlobalISel] fix widenScalarUnmerge if widen type is not a multiple of destination type

Fix creation of illegal unmerge when widen was requested to a type which
is not a multiple of the destination type. E.g. when trying to widen
an s48 unmerge to s64 the existing code would create an illegal unmerge
from s64 to s48.

Instead, create further unmerges to a GCD type, then use this to remerge
these intermediate results to the actual destinations.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D88422
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp