Page MenuHomePhabricator

TargetRegisterInfo: Add getAsmName() to MCRegisterInfo.

Authored by SamWot on Apr 12 2016, 4:47 AM.



This method returns assembly name for register derived from TableGen field AsmName. getAsmName() uses generated table with assembly names. This table nad method works similar to TargetRegStrings table and MCRegisterInfo::getName().
This is needed to allow TargetLowering::getRegForInlineAsmConstraint() to use assembly names to match register constraints. Currently TargetLowering::getRegForInlineAsmConstraint() uses names of register definition in .td file.
Also watch this revision:

Diff Detail

Event Timeline

SamWot updated this revision to Diff 53382.Apr 12 2016, 4:47 AM
SamWot retitled this revision from to TargetRegisterInfo: Add getAsmName() to MCRegisterInfo..
SamWot updated this object.
SamWot added reviewers: echristo, hfinkel, MatzeB, stoklund.
SamWot added subscribers: nhaustov, vpykhtin, tstellarAMD.

I think there may be concerns about increasing the binary size with this new table. Aren't we emitting the same table in If so, could we modify the asm writer to use this new table instead?

MatzeB requested changes to this revision.Apr 12 2016, 12:10 PM
MatzeB edited edge metadata.

Some targets have a gigantic number of registers (AMDGPU has ~3500 register and I am aware of an out of tree target with >10000 registers). I'd prefer a solution which does not increase the size of MCRegisterDesc at the very least we should find a way to share the name table with the AsmWriter code.

This revision now requires changes to proceed.Apr 12 2016, 12:10 PM
SamWot abandoned this revision.Apr 13 2016, 4:49 AM

Thanks Tom and Matthias,
I didn't actually find InstPrinter::getRegisterName(). Looks like it is possible to simply use it for inline assembly and no changes in core LLVM are required.
I will close this review.