This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
extract register input, output and operator from rtl right before peepholes
- From: Liu Haibin <liu dot haibin at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 29 Dec 2005 22:21:51 +0800
- Subject: extract register input, output and operator from rtl right before peepholes
Hi,
I'd doing some coding right before peephole2 pass. I'd like to have a
function that takes rtl as input and returns the values of register
inputs, register output and operator. For example,
input:
(insn 496 34 29 1 (set (reg/f:SI 3 r3 [235])
(plus:SI (reg/f:SI 3 r3 [235])
(const_int 4 [0x4]))) 20 {addsi3} (insn_list:REG_DEP_ANTI 28 (nil))
(nil))
returns:
inputs: r3, 4. ouput r3. operator: plus.
I know sched_analyze() in sched-deps.c builds the dependencies in
basic blocks and hope I can find some useful functions there. I
roughly went through the code and didn't really understand.
Because the rtl's are right before peephole2, they're much processed,
which makes things easier. I hope I can find some existing function to
use instead of using something like REGNO(XEXP(SET_SRC(PATTERN(x)),
0)). I believe sched-deps.c has something useful. Can someone help on
this?
Regards,
Haibin