This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources
ClosedPublic

Authored by arsenm on Jul 3 2019, 1:21 PM.

Details

Summary

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.

Diff Detail

Event Timeline

arsenm created this revision.Jul 3 2019, 1:21 PM
aemerson added inline comments.Jul 8 2019, 4:35 PM
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
891

Can you add some more descriptive comments to this section to illustrate what the code is trying to achieve, maybe using an example input.

arsenm updated this revision to Diff 208566.Jul 8 2019, 6:15 PM

Add example comments

aemerson accepted this revision.Jul 9 2019, 10:46 AM
This revision is now accepted and ready to land.Jul 9 2019, 10:46 AM
arsenm closed this revision.Jul 17 2019, 1:23 PM

r366367 with small fix for when the result type is a pointer

foad added a subscriber: foad.Apr 19 2023, 7:52 AM
foad added inline comments.
test/CodeGen/AMDGPU/GlobalISel/legalize-merge-values.mir
3

Missing RUN:

Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 7:52 AM