[LLVMdev] tablegen and ptr_rc: PointerLikeRegClass

Will Schmidt will_schmidt at vnet.ibm.com
Fri Sep 14 11:10:53 PDT 2012

Hi all, 

I've been poking at AsmParser support for powerpc64
(ppc64-elf-linux-abi) and have run into some behavior I don't understand
with the ptr_rc references coming out of the PPC*.td files when
generating the asm-matcher files.

For instance : 
$  ./build/bin/llvm-tblgen llvm/lib/Target/PowerPC/PPC.td -I
~/llvm-head/llvm/include -I ~/llvm-head/llvm/lib/Target/PowerPC/


Included from llvm/lib/Target/PowerPC/PPC.td:16:
error: Operand `ptr_rc' does not derive from class Operand!

def ptr_rc : PointerLikeRegClass<0>;

The comments in Target.td suggest to me that tablegen should be able to
handle this in some way, but it's not clear to me what I'm missing that
would enable this to begin working. 

/// PointerLikeRegClass -  ...   TableGen treats the register class as having a symbolic
/// type that it doesn't know, and resolves the actual regclass to use by using
/// the TargetRegisterInfo::getPointerRegClass() hook at codegen time.

I do see ptr_rc and ptr_rc_nosp references in X86/X86InstrInfo.td ; but I can't
tell how or why it works differently there than in PowerPC/PPCInstr64Bit.td



More information about the llvm-dev mailing list