1. We are expecting that pass_sched and pass_sched2, each will enter
schedule_insns() function once per pass. However, we found that it is
entering schedule_insns() function per function(in the program) per
pass. (If there are two functions in the input program, pass_sched
will enter schedule_insns() twice and pass_sched2 will also enter
schedule_insns() twice.)We are not able to track this flow in the
code. Kindly help us as to what are we missing out?
2. We are trying to visualize the code into regions and then into
basic blocks i.e., what all insns form a basic block and what basic
blocks form a region.
Also we are trying to figure out - the before and after scenarios -
when an insn moves from one basic block to another.
However we are not able to map this information looking at any of
the rtl dump files.
Kindly help us as to what should be our approach?
3. We are trying to figure out the difference and need of 2 passes,
both calling the same function(schedule_insns()). However, we are
unable to find any difference in the two calls to schedule_insns() in
two schedule passes(pass_sched and pass_sched2). Kindly help us as to
what are we missing out?
Target language for which optimization is being done: C
Target machine architecture: i686
GCC version: 4.4.1
Kindly help us with our issues.
Thanking You,
Dhiraj P.
BIG FAT HINT:
I have nearly no clue of GCC internals.
> 1. We are expecting that pass_sched and pass_sched2, each will enter
> schedule_insns() function once per pass. However, we found that it is
> entering schedule_insns() function per function(in the program) per
> pass. (If there are two functions in the input program, pass_sched
> will enter schedule_insns() twice and pass_sched2 will also enter
> schedule_insns() twice.)We are not able to track this flow in the
> code. Kindly help us as to what are we missing out?
>
I have no idea where the call-site of schedule_isns() is, but a guess why you
get a call per function:
Scheduling instructions _between_ functions is "freaky", to say the least.
So i guess it was decided to break the problem space at the function level to
make things for schedule_isns() easier. This way schedule_isns() only needs to
understand the stuff within a function, not the metadata which seperates
functions (abstraction, isolation).
> 2. We are trying to visualize the code into regions and then into
> basic blocks i.e., what all insns form a basic block and what basic
> blocks form a region.
> Also we are trying to figure out - the before and after scenarios -
> when an insn moves from one basic block to another.
> However we are not able to map this information looking at any of
> the rtl dump files.
> Kindly help us as to what should be our approach?
>
Here i would guess, since you say RTL, you are a little late in the game.
This should happen at earlier levels. A pass which changes such things can and
should happen at Tree-SSA or GIMPLE.
AFAIK RTL-Instruction sheduling is about the last little "Oh, i can unstall my
pipeline if i move this add 2 slots backwards, oh wait, i can only go one slot"
and so on. The "Big Picture" things (Block reodering, branch propabilities,
partioning, GCSE, Folding, Transforming, etc.) were already done.
> 3. We are trying to figure out the difference and need of 2 passes,
> both calling the same function(schedule_insns()). However, we are
> unable to find any difference in the two calls to schedule_insns() in
> two schedule passes(pass_sched and pass_sched2). Kindly help us as to
> what are we missing out?
>
That between the first and the second run other RTL-Passes are run, which may
uncover more possiblities for schedule_isns() to do it's magic?
Or that the Algo within shedule_isns() can get stuck within a local minima, and
restarting it may fix this.
But that's all a guess.
> Target language for which optimization is being done: C
> Target machine architecture: i686
> GCC version: 4.4.1
>
> Kindly help us with our issues.
>
> Thanking You,
> Dhiraj P.
Greetings
Jan
--
/home
sweet
/home