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
Details
Details
Diff Detail
Diff Detail
Event Timeline
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? |
Comment Actions
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.
Comment Actions
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.
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?