This is an archive of the discontinued LLVM Phabricator instance.

[GISel]: Refactor InstructionSelector::constrainSelectInstOperands
ClosedPublic

Authored by aditya_nandakumar on Jan 16 2018, 4:48 PM.

Details

Summary

This patch moves the constrainSelectedInstRegOperands from InstructionSelector into GlobalISel/Utils so it can be used elsewhere.
Also added constrainAllUses method into MachineInstrBuilder which forwards the call to utils. So now we can use it like,

BuildMI(...)

.addUse(..)
.addImm(..)
.constrainAllUses(TII, TRI, RBI);

Diff Detail

Repository
rL LLVM

Event Timeline

Hi Aditya,

You forgot to include llvm-commits as a subscriber. Phabricator won't send the patch to the list if you add it now so you'll need to abandon this revision and create a new one.

The subject line '[GISel]: Refactor InstructionSelector::constrainSelectInstOperands' doesn't really describe what you're trying to do. It says what changed but not what effect that change has. Something like '[GISel] Make constrainSelectedInstRegOperands() available to the legalizer. NFC' would be better.

Other than that, this looks good to me. If you re-post the patch but including llvm-commits, I can LGTM it on-list.

dsanders accepted this revision.Jan 17 2018, 8:15 AM

Hi Aditya,

You forgot to include llvm-commits as a subscriber. Phabricator won't send the patch to the list if you add it now so you'll need to abandon this revision and create a new one.
<snip>
Other than that, this looks good to me. If you re-post the patch but including llvm-commits, I can LGTM it on-list.

Sorry, ignore that bit. You did include llvm-commits, it's just that Phabricator has moved where the subscribers are listed. They used to be just under the reviewers but now they're off to the side.

LGTM with the subject line change.

This revision is now accepted and ready to land.Jan 17 2018, 8:15 AM

Thanks Daniel. Committed in r322743.