This is an archive of the discontinued LLVM Phabricator instance.

[MIPS GlobalISel] Select all instructions required to load and store i32 on stack
ClosedPublic

Authored by Petar.Avramovic on Jul 5 2018, 12:00 AM.

Details

Summary

Add code for selection of G_LOAD, G_STORE, G_GEP, G_FRAMEINDEX and G_CONSTANT.
Support loads and stores of i32 values.

Diff Detail

Repository
rL LLVM

Event Timeline

Does anybody have any comment?

atanasyan added inline comments.Jul 12 2018, 4:28 AM
lib/Target/Mips/MipsInstructionSelector.cpp
135 ↗(On Diff #154172)

Redundant empty line.

143 ↗(On Diff #154172)

Ditto

152 ↗(On Diff #154172)

I suggest to remove the selectLoadStoreOpcode function and inline the code as follow. I think it explicitly show when we do nothing and when need to call BuildMM.

if (DestRegBank != Mips::GPRBRegBankID || OpSize != 32)
  return false;

const unsigned NewOpc =
    I.getOpcode() == G_STORE ? Mips::SW : Mips::LW;
162 ↗(On Diff #154172)

Redundant empty line.

Addressed review comments

Petar.Avramovic marked 4 inline comments as done.Jul 12 2018, 6:39 AM
This revision is now accepted and ready to land.Jul 13 2018, 8:05 AM
This revision was automatically updated to reflect the committed changes.