This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][NFC] Cleanup load/store spilling code
ClosedPublic

Authored by lei on May 11 2020, 11:57 AM.

Details

Summary

Cleanup and commonize code used for spilling to the stack.

Diff Detail

Event Timeline

lei created this revision.May 11 2020, 11:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2020, 11:57 AM
lei retitled this revision from [rton,PowerPC][NFC] Cleanup load/store spilling code to [PowerPC][NFC] Cleanup load/store spilling code.May 11 2020, 12:29 PM
jsji added a reviewer: Restricted Project.May 13 2020, 8:15 AM
jsji added a project: Restricted Project.
kamaub added a subscriber: kamaub.May 14 2020, 12:02 PM

I think the index for the StoreSpillOpcodesArray and LoadSpillOpcodesArray arrays are incorrect.

Besides that the patch LGTM and I want to approve it.

llvm/lib/Target/PowerPC/PPCInstrInfo.h
138

The indentation in these code blocks needs to be unified.

177

enums start at 0 so i think this should be SOK_LastOpcodeSpill +1 right?

179

Same as above comment.

kamaub accepted this revision as: kamaub.May 14 2020, 12:07 PM
kamaub marked an inline comment as done.

LGTM, one pre-commit nit with the indentation.

llvm/lib/Target/PowerPC/PPCInstrInfo.h
177

I realise now that this is on purpose as the #define opcodes only have 15 entries, my apologies.

This revision is now accepted and ready to land.May 14 2020, 12:07 PM
lei marked 2 inline comments as done.May 14 2020, 2:30 PM
lei added inline comments.
llvm/lib/Target/PowerPC/PPCInstrInfo.h
138

this was actually done by clang-format.

nemanjai accepted this revision.May 14 2020, 2:42 PM

LGTM.

This revision was automatically updated to reflect the committed changes.