This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Implement widenScalar for G_UNMERGE_VALUES
ClosedPublic

Authored by arsenm on Jan 29 2019, 4:51 PM.

Details

Summary

For the scalar case only.

Also move the similar G_MERGE_VALUES handling to a separate function
and cleanup to make them look more similar.

Diff Detail

Event Timeline

arsenm created this revision.Jan 29 2019, 4:51 PM
aemerson requested changes to this revision.Jan 30 2019, 3:08 PM
aemerson added inline comments.
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
792

Rename EltSize to PartSize to make it clear it's not a vector element.

797

I to me is the source register index into the instruction that we're inserting, so I think this would be better expressed as:

for (unsigned I = 2; I != NumRc; ++I) {
  const unsigned Offset = (I - 1) * EltSize;

and then just use I in the other two places.

807

and shouldn't this be I + 2 anyway?

855

Since we modify this in place we need to tell the Observer we're changing MI.

This revision now requires changes to proceed.Jan 30 2019, 3:08 PM
arsenm updated this revision to Diff 184446.Jan 30 2019, 8:20 PM
arsenm marked 3 inline comments as done.

Address comments, use more MachineIRBuilder trickery

aemerson accepted this revision.Feb 1 2019, 3:47 PM

LGTM.

This revision is now accepted and ready to land.Feb 1 2019, 3:47 PM
arsenm closed this revision.Feb 2 2019, 4:10 PM

r352979