[LLVMdev] instruction/register identifier?

Juan Nicolas Ruiz juanruiz at students.uiuc.edu
Wed Nov 20 22:46:01 PST 2002


Is there a way get the register on the LHS of a llvm instruction? (in
case there is one)

for example, given a "free %reg773", I want to find the matching
"%something = malloc %", where %something is not necessarily %reg773.
One way I found was to inmediately follow the use-def chain up from
the free to the malloc. But instead, I want to put %reg773 in a set
(possibly with many other %things), and when I find
"%something = malloc" look for %something in the set. One way to do it
(as far as I see) is to store the "defs" in the set. But I was
thinking about storing only the "%reg" (the name, a unique
identifier), but I don't see how to get it from an Instruction.

I'm not sure the above explanation makes much sense. Too much
caffeine, I guess.

thanks in advance
nicolas




More information about the llvm-dev mailing list