This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Help reduce operation width for instruction with two results.
ClosedPublic

Authored by cdevadas on Apr 18 2021, 7:15 AM.

Details

Summary

The function reduceOperationWidth helps to legalize a vector
operation either by narrowing its type or by scalarizing the
operation itself. It currently supports instructions with one result.
This patch, in addition, allows the same for instructions with two
results (for instance, G_SDIVREM).

Diff Detail

Event Timeline

cdevadas created this revision.Apr 18 2021, 7:15 AM
cdevadas requested review of this revision.Apr 18 2021, 7:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2021, 7:15 AM
arsenm added inline comments.May 12 2021, 4:17 PM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
4037

This is assuming the two results have the same type, which I guess is fine for now

4050

You don't need to call build undef for each time. I think just append(Num, Reg) works?

cdevadas updated this revision to Diff 345110.May 13 2021, 6:00 AM

Comment addressed.

arsenm accepted this revision.May 20 2021, 10:34 AM
This revision is now accepted and ready to land.May 20 2021, 10:34 AM
This revision was landed with ongoing or failed builds.May 20 2021, 10:06 PM
This revision was automatically updated to reflect the committed changes.