[LLVMdev] Question on register class

Manjunath Kudlur keveman at gmail.com
Sat May 9 13:20:35 PDT 2009


Hello,

Given a TargetRegisterClass *RC, I was wondering if there is a way to
find out what register class it is directly, instead of comparing it
against all the &mytarget::Class1, &mytarget::Class2 etc. This goes
back to my original intention of having special query functions for a
subset of register classes. Suppose I wanted vector register classes
(more than one, say 2-elements and 4-elements). I want to define
special query functions for these classes, like getVectorLength etc. I
can define them using MethodProtos and MethodBodies, but I have to
define them for each one the classes in the set. It will be nice if
there is a way to build a hierarchy of register classes, and dispatch
handlers by finding what class a given RC is. I will appreciate
suggestions on how to do this, or alternative ways to solve this
problem.

Thanks,
Manjunath



More information about the llvm-dev mailing list