This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add ADDW/AND/OR/XOR/SUB/SUBW to getRegAllocHints.
ClosedPublic

Authored by craig.topper on Dec 1 2022, 12:11 AM.

Details

Summary

These instructions requires both register operands to be compressible
so I've only applied the hint if we already have a GPRC physical register
assigned for the other register operand.

Diff Detail

Event Timeline

craig.topper created this revision.Dec 1 2022, 12:11 AM
craig.topper requested review of this revision.Dec 1 2022, 12:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2022, 12:11 AM
asb added inline comments.Dec 1 2022, 8:27 AM
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
440–441

I missed this on the previous patch, but this comment is no longer accurate now there's support for some GPRC instructions.

472

"require need" => "require"

474

Not a huge deal either way as it's fairly clear from the context, but perhaps isCompressibleOpnd would be marginally better?

475

The fact this returns true for any non-register operand could perhaps be noted in the comment above?

Address review comments

reames accepted this revision.Dec 1 2022, 10:46 AM

LGTM

This revision is now accepted and ready to land.Dec 1 2022, 10:46 AM
This revision was landed with ongoing or failed builds.Dec 1 2022, 11:10 AM
This revision was automatically updated to reflect the committed changes.
piggynl added a subscriber: piggynl.Dec 6 2022, 6:05 AM