[llvm-dev] get instruction destination register

fateme Hoseini via llvm-dev llvm-dev at lists.llvm.org
Sat Dec 19 11:34:34 PST 2015


Hello everyone,
I am trying to write a code to do the following:
1. Get an ARM machine instruction
2. Find destination register of that instruction that has been written
3. set a bit in a vector, according to that register number. (Since it's
ARM, I have a 15 bit vector)
It means if I have :
add r0, r1, r0
I want to get r0 as dest reg and set the index 0 of my vector to 1.

I get my machine instruction, but I don't know how to get dest reg. I
looked at MachineInstr.h but couldn't find it out.
Also I want to know which instructions to excluse from this routine, for
example str instruction does not write to a dest reg or branch instruction.
Are there any other instruction.
Thanks for your help,
Fami
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151219/7da5c7e7/attachment.html>


More information about the llvm-dev mailing list