This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add tGPRwithpc register class and use it for TBB/THH
ClosedPublic

Authored by fhahn on Jun 26 2017, 2:27 AM.

Details

Summary

TBB and THH allow using a Thumb GPR or the PC as destination operand.
A few machine verifier failures where due to those instructions not
expecting PC as destination operand.

Add -verify-machineinstrs to test/CodeGen/ARM/jump-table-tbh.ll to add
test coverage even if expensive checks are disabled.

Diff Detail

Event Timeline

fhahn created this revision.Jun 26 2017, 2:27 AM
fhahn retitled this revision from [ARM] Add tGPRWithPC register class and use it for TBB/THH. to [ARM] Add tGPRwithpc register class and use it for TBB/THH..Jun 26 2017, 2:28 AM
fhahn added a comment.Jun 26 2017, 2:30 AM

This patch brings down the machineinstr verifier failures on ARM to CodeGen/ARM/unschedule-first-call.ll.

Note that on ARM we have GPR and GPRnopc. I decided to add tGPRwithpc rather than changing tGPR to include the PC and adding tGPRnopc, because that would create a much bigger diff.

MatzeB accepted this revision.Jun 26 2017, 4:40 PM

LGTM.

While I think you are fine here, you should probably double check that TargetRegisterInfo::getMinimalPhysRegClass() does not start returning your new register class for the "normal" go regs or if it does at least keep an eye on the performance bots to make sure it doesn't accidentally change.

This revision is now accepted and ready to land.Jun 26 2017, 4:40 PM
fhahn added a comment.Jun 27 2017, 9:31 AM

@MatzeB I'll run some benchmarks before committing.

fhahn retitled this revision from [ARM] Add tGPRwithpc register class and use it for TBB/THH. to [ARM] Add tGPRwithpc register class and use it for TBB/THH.Jun 29 2017, 1:45 AM
fhahn closed this revision.Jun 29 2017, 1:45 AM