This is an archive of the discontinued LLVM Phabricator instance.

[RISCV GlobalISel] Adding initial GlobalISel infrastructure
ClosedPublic

Authored by wwei on Jul 24 2019, 9:25 AM.

Diff Detail

Event Timeline

wwei created this revision.Jul 24 2019, 9:25 AM
dsanders accepted this revision.Jul 25 2019, 11:17 AM
dsanders added a subscriber: dsanders.

LGTM. This looks like the normal initial boilerplate

This revision is now accepted and ready to land.Jul 25 2019, 11:17 AM

Since there are no generic instructions in test function you can run all globalisel passes for it, not just irtranslator.
I got two compiler/tablegen warnings. Other then that look good.

llvm/lib/Target/RISCV/RISCVInstructionSelector.cpp
65–67

This defines RISCVInstructionSelector::selectImpl , but it is unused at the moment.

llvm/lib/Target/RISCV/RISCVRegisterBanks.td
13

RegisterBankEmitter emits warning here:
Register bank names should be distinct from register classes to avoid ambiguous MIR
RegisterBank was declared here
def GPRRegBank : RegisterBank<"GPR", [GPR]>;
RegisterClass was declared here
def GPR : RegisterClass<"RISCV", [XLenVT], 32, (add

wwei updated this revision to Diff 212113.Jul 28 2019, 9:20 AM

Some changes for this update:

  1. Rename the GPRRegBank from GPR to GPRB
  2. Add using of RISCVInstructionSelector::selectImpl in RISCVInstructionSelector.cpp.
  3. Add a seperate test case for running all globalisel passes.
wwei marked an inline comment as done.Jul 28 2019, 9:34 AM
wwei added inline comments.
llvm/lib/Target/RISCV/RISCVRegisterBanks.td
13

Done. GPR was changed into GPRB

wwei marked an inline comment as done.Jul 28 2019, 9:43 AM
wwei added inline comments.
llvm/lib/Target/RISCV/RISCVInstructionSelector.cpp
65–67

Done. I have add the call for selectImpl in RISCVInstructionSelector::select function.,

dsanders edited the summary of this revision. (Show Details)Aug 20 2019, 2:40 PM
This revision was automatically updated to reflect the committed changes.