Page MenuHomePhabricator

TargetRegisterInfo: Add getAsmName() to MCRegisterInfo.
AbandonedPublic

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

Details

Summary

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: http://reviews.llvm.org/D15614

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.
utils/TableGen/RegisterInfoEmitter.cpp
921–925

I think there may be concerns about increasing the binary size with this new table. Aren't we emitting the same table in GenXXXAsmWriter.inc? 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.