This is an archive of the discontinued LLVM Phabricator instance.

[mips][micromips] Make getPointerRegClass() result depend on the instruction.
ClosedPublic

Authored by dsanders on May 3 2016, 9:31 AM.

Details

Summary

Previously, it returned the GPR16MMRegClass for all instructions which was
incorrect for instructions like lwsp/lwgp and unnecesarily restricted the
permitted registers for instructions like lw32.

This fixes quite a few of the -verify-machineinstrs errors reported in PR27458.
I've only added -verify-machineinstrs to one test in this change since I
understand there is a plan to enable the verifier by default.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 56016.May 3 2016, 9:31 AM
dsanders retitled this revision from to [mips][micromips] Make getPointerRegClass() result depend on the instruction..
dsanders updated this object.
dsanders added a subscriber: llvm-commits.
sdardis accepted this revision.May 6 2016, 7:02 AM
sdardis edited edge metadata.

Unless I'm mistaken in my reading of the instruction definition, lwgp takes a signed offset.

LGTM with that changed.

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
1096

isInt instead of isUInt. LWGP takes a signed offset, not an unsigned one.

This revision is now accepted and ready to land.May 6 2016, 7:02 AM
dsanders updated this revision to Diff 56548.May 9 2016, 4:07 AM
dsanders edited edge metadata.

Fix the incorrect sign of the offset field

dsanders added inline comments.May 9 2016, 6:30 AM
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
1096

Well spotted. That's remarkably subtle in the docs and it's the opposite of the near-identical LWSP that's next to it.

dsanders closed this revision.May 9 2016, 6:44 AM