This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add a RegAllocHint for hinting t2DoLoopStart towards LR
ClosedPublic

Authored by dmgreen on Oct 21 2020, 7:16 AM.

Details

Summary

This hints the operand of a t2DoLoopStart towards using LR, which can help make it more likely to become t2DLS lr, lr. This makes it easier to move if needed (as the input is the same as the output), or potentially remove entirely.

The hint is added after others (from COPY's etc) which still take precedence. It needed to find a place to add the hint, which currently uses the post isel custom inserter. The AMDGPU looks like it checks all the uses of the register in getRegAllocationHints, which sounds a little slower but may be preferable.

Diff Detail

Event Timeline

dmgreen created this revision.Oct 21 2020, 7:16 AM
dmgreen requested review of this revision.Oct 21 2020, 7:16 AM
samparker accepted this revision.Oct 23 2020, 12:33 AM

I'm kind of surprised these sort of hints aren't handled in tablegen, but I guess not much c++ is needed. Looks like it works well enough too, cheers.

This revision is now accepted and ready to land.Oct 23 2020, 12:33 AM