This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] fix widenScalarUnmerge if widen type is not a multiple of destination type
ClosedPublic

Authored by gargaroff on Sep 28 2020, 8:15 AM.

Details

Summary

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.

Diff Detail

Event Timeline

gargaroff created this revision.Sep 28 2020, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2020, 8:15 AM
gargaroff requested review of this revision.Sep 28 2020, 8:15 AM
arsenm added inline comments.Sep 28 2020, 2:36 PM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
1652

Maybe 8?

1655

+ J at the end?

llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
3138

Comment is wrong

gargaroff marked 3 inline comments as done.

Address review comments

arsenm accepted this revision.Sep 29 2020, 6:30 AM
This revision is now accepted and ready to land.Sep 29 2020, 6:30 AM