Re: do -fprofile-arcs and -fbranch-probabilities help to set bb->count?

2006-02-23 Thread Liu Haibin
, I can do some configuration, so that the executable will be able to output to Host PC through normal fputs or fwrite. So is it feasible that I can make executable to output gcda file to my Host PC via fputs or fwrite? Regards, Haibin On 2/21/06, Paolo Bonzini <[EMAIL PROTECTED]> wrote: &g

do -fprofile-arcs and -fbranch-probabilities help to set bb->count?

2006-02-21 Thread Liu Haibin
Hi, I wanted to use bb->count, so I expected that -fprofile-arcs and -fbranch-probabilities would help. I added printf just before peephole2 optimization and ran the following. $gcc -O3 -fprofile-arcs test.c -o test $./test (which produced test.gcno only, but no test.gcda) $gcc -O3 -fprofile-arcs

about REG_DEP_OUTPUT dependence

2006-01-03 Thread Liu Haibin
Hi, Can someone help me explain that why there's an REG_DEP_OUTPUT (write after write dependence) between jump_insn 547 and insn 82? (insn 82 543 478 3 (set (mem/s:SI (reg/f:SI 6 r6 [224]) [4 W S4 A32]) (reg:SI 2 r2 [95])) 8 {movsi_internal} (insn_list 81 (nil)) (expr_list:REG_DEAD (r

extract register input, output and operator from rtl right before peepholes

2005-12-29 Thread Liu Haibin
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]) (

on data depenence

2005-12-28 Thread Liu Haibin
Hi, I got a dump of sha.c.27.flow2 from gcc 3.4.1. I don't quite understand the LOG_LINKS of insn 498. LOG_LINKS in insn 498 shows that it has a data dependence (a read after write dependence) with insn 3. Why is it so? I don't see any dependence between "mov r14 r4" and "addi r3, r4, 28". The bot

how to add source or header file in gcc

2005-12-22 Thread Liu Haibin
Hi, I'd like to add some source and header files into gcc. I think I probably need to make some change in Makefile.in. But the Makefile.in looks very complicated. Could anyone give some advice on this? Regards, Haibin

arguements used in .c.26.flow2 are not used in assembly codes

2005-09-22 Thread Liu Haibin
Hi, I compiled the following code using nios gcc -da -O3 (gcc version 3.3.3) #include #define PI (4*atan(1)) double rad2deg(double rad) { return (180.0 * rad / (PI)); } The begining of the .s file is rad2deg: addisp, sp, -16 stw fp, 8(sp) mov r6

some seemingly redundant register uses in nios gcc compiled assembly code

2005-09-06 Thread Liu Haibin
Hi, I compiled the following code using nios gcc -da -O3 (gcc version 3.3.3) #include #define PI (4*atan(1)) double rad2deg(double rad) { return (180.0 * rad / (PI)); } In .s file, it has some codes like this mov r4, zero movhi r5, %hiadj(107269324

Re: how to write a define_peephole2 that uses custom registers in nios2

2005-07-28 Thread Liu Haibin
altera.com/mysupport> for instructions. I think the reason it failed is there's no more define_insn "custom_inii" with general registers because I already changed the "r" to "c". However, it seems very difficult here.

how to write a define_peephole2 that uses custom registers in nios2

2005-07-26 Thread Liu Haibin
Hi, nios2 has a set of custom registers for custom instructions. They all start with "c", like custom 1 c4, c2, c0 I want to define a peephole to replace a sequence of codes with this above custom instruction. custom instruction is defined as following in nios2.md (define_insn "custom_inii"

How can I create a const rtx other than 0, 1, 2

2005-07-22 Thread Liu Haibin
Hi, There's const0_rtx, const1_rtx and const2_rtx. How can I create a const rtx other than 0, 1, 2? I want to use it in md file, like operand[1] = 111. I know I must use const rtx here. How can I do it? A simple question, but just no idea where to find the answer. Regards, Timothy

Re: on define_peephole2

2005-07-21 Thread Liu Haibin
On 7/21/05, Liu Haibin <[EMAIL PROTECTED]> wrote: > Hi, > > I have a problem on the define_peephole2. In nois2.md, there's such a > define_insn > > (define_insn "addsi3" > [(set (match_operand:SI 0 "register_operand" "=r,r&q

on define_peephole2

2005-07-21 Thread Liu Haibin
Hi, I have a problem on the define_peephole2. In nois2.md, there's such a define_insn (define_insn "addsi3" [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operand:SI 1 "register_operand" "%r,r") (match_operand:SI 2 "arith_operand" "r,

on nios2 difine_insn indirect_call

2005-07-17 Thread Liu Haibin
Hi, The nios2.md has a define_insn "indirect_call" (define_insn "indirect_call" [(call (mem:QI (match_operand:SI 0 "register_operand" "r")) (match_operand 1 "" "")) (clobber (reg:SI RA_REGNO))] "" "callr\\t%0" [(set_attr "type" "control")]) But I find that in test.c.26.flow2

Re: -fprofile-arcs changes the structure of basic blocks

2005-06-27 Thread Liu Haibin
I found that the optimization must be on in order to see the frequency. Timothy On 6/24/05, Liu Haibin <[EMAIL PROTECTED]> wrote: > Then I think I shouldn't use -fprofile-arcs. The reason why I used > -fprofile-arcs is when I debugged a program without any flags, I saw > th

Re: -fprofile-arcs changes the structure of basic blocks

2005-06-23 Thread Liu Haibin
else return 0; } int main() { int i; i = 0; if (i < 100) i = 3; else i = foo(i); return 0; } On 6/24/05, Daniel Berlin <[EMAIL PROTECTED]> wrote: > On Thu, 23 Jun 2005, Liu Haibin wrote: >

-fprofile-arcs changes the structure of basic blocks

2005-06-23 Thread Liu Haibin
Hi, I want to use profiling information. I know there're two relevent fields in each basic block, count and frequency. I want to use frequency because the compiled program is for another architecture so it cannot run on the host. I use -fprofile-arcs. And I can see the frequency value when I debu