public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Delay branch scheduling vs. the CFG
@ 2005-11-13 20:20 Steven Bosscher
  2005-11-13 21:02 ` Jeffrey A Law
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Bosscher @ 2005-11-13 20:20 UTC (permalink / raw)
  To: gcc

Hi,

I'm trying to figure out how much effort it would take to make
dbr_schedule CFG aware.  One of the issues I'm running into is
that the RTL CFG stuff doesn't support SEQUENCEs at all.  So if
I have a delay slot filled, e.g.,

(sequence [
    (jump_insn (...))   ;; The branch with delay slots
    (insn (...))        ;; An insn in a delay slot
    ])

verify_flow_info immediately dies on this because the last insn
in a basic block is not a branch instruction.  It sees just the
sequence and not the instructions in it.

Now I could add some kind of flag "reorg_completed" and go hack
all the RTL cfg routines to support SEQUENCEs.  But I'd rather
not do that unless I'm really sure nobody thinks that is a Very
Bad Idea.  ;-)

Thoughts?

Gr.
Steven

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Delay branch scheduling vs. the CFG
@ 2005-11-16 22:42 Joern RENNECKE
  0 siblings, 0 replies; 7+ messages in thread
From: Joern RENNECKE @ 2005-11-16 22:42 UTC (permalink / raw)
  To: Jeffrey A Law; +Cc: Steven Bosscher, gcc

 > > >   4. An entirely new basic block on its own.
 > >
 > > When can option 4 happen??
 > IIRC it occurs when there was only 1 insn in either the target
 > or fall-thru block.    When it gets sucked into the delay
 > slot of a branch, then it is effectively its own basic
 > block.

When the fall-through is ended by a code label, and has only one insn, 
and that is eligible for
a delay-slot which can be annulled-true, the fall-through block can end 
up in the delay slot.

When the target block is ended by an unconditional jump, and otherwise 
has only one insn,
which is elegible for a delay slot in preceding branch that can be 
anulled-false, the fall-through
block can end up in the delay slot.
Likwise if the fall-through block consists only of a branch-delay-slot 
eligible insn  and
an unconditional jump, the branch and fall-through block can be 
converted into an inverted
branch with anulled-false delay slot insn.

And finally, sometimes earlier reorg changes have changed the data flow 
so that actually
no anulled slots are required (if there were no changes before, jump 
optimization should
have caught these opportunities, placing the lone insn in front of the 
branch); or the only
data anti-dependency might have the branch condition itself.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-11-16 23:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-13 20:20 Delay branch scheduling vs. the CFG Steven Bosscher
2005-11-13 21:02 ` Jeffrey A Law
2005-11-13 21:20   ` Steven Bosscher
2005-11-13 21:26     ` Jeffrey A Law
2005-11-16 20:07       ` Richard Henderson
2005-11-16 23:19         ` Jeffrey A Law
2005-11-16 22:42 Joern RENNECKE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).