[sel-sched] Fix middle-end issues found in review

Andrey Belevantsev abel@ispras.ru
Thu Jul 3 15:44:00 GMT 2008


Hello Steven,

Steven Bosscher wrote:
> My understanding of the reasons for these hooks (after reading
> http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00678.html, but I only
> half followed the discussion) is you only need them to keep track of
> new insns (and more specifically jump insns) appearing when you modify
> the CFG.
> 
> If that is true, then may I remind you what I said two years ago in
> Moscow?  I suggested you should use cfglayout mode, because I expected
> you would run into exactly this problem.  I wrote my talk around this
> subject specifically to get all you ISP-RAS guys to use it (slides
> still here: http://gcc.gelato.org/MoscowMeeting?action=AttachFile&do=get&target=Steven_Bosscher.pdf,
> page 22-41).  
First of all, thank you for doing this!  You were one of the few people 
who paid attention to this project, and I appreciate it.

> You said back then that you it probably was a good idea,
> but you expected to have the scheduler ready in a matter of months and
> you'd rather focus on finishing it, and think about using cfglayout
> mode later. But, if you had used cfglayout mode, you'd have had full
> control over your jump insns as well (you even have to create and
> insert them yourself, in fact).
We didn't try cfglayout mode mainly for two reasons:

o After the scheduler was finished, we spent a lot of time for tuning it 
and speeding it up.  We didn't have much time for exploring alternative 
implementations.

o There were always some problems with using cfglayout from the first 
glance.  First of all, we need to schedule jumps as well as other insns. 
   I.e., when cfg_layout_finalize produces extra jumps, these need to be 
scheduled too.  And, this is to be done before bundling, as otherwise 
we'd spoil it, but after we quit cfglayout, i.e. in cfgrtl, which in 
turn means that the scheduler should be able to handle both modes. 
Second, what to do if a jump became redundant during scheduling?  Would 
cfg_layout_finalize remove it for me, or should I look for it?  (We do, 
atm, with cfgrtl.)  If it would, how this would play with bundling then? 
  I am sorry I didn't ask these questions earlier, but as I said, that 
was mainly because lack of time.

> I really dislike these hooks. They are a very bad way to work around
> the real problem.  The hooks are only necessary because you use an
> unfriendly CFG manipulation API.  A friendlier API is available, and
> if you'd use it, you would not need these hooks.
If both Ian and you think the hooks is a bad idea, and we can't come up 
with an interface that you would agree on as reasonable, then I can try 
to remove them and find the emitted jumps from the scheduler.  Also, I 
would be happy to give cfglayout a try as a followup, as hopefully I'd 
have more time in upcoming months, but I'm not ready to start this work 
right away.

Andrey



More information about the Gcc-patches mailing list