public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Incorrect DFA scheduling of output dependency.
@ 2004-12-06 11:30 Daniel Towner
  2004-12-06 12:30 ` Nathan Sidwell
  2004-12-06 12:31 ` Steven Bosscher
  0 siblings, 2 replies; 12+ messages in thread
From: Daniel Towner @ 2004-12-06 11:30 UTC (permalink / raw)
  To: gcc

Hi all,

I am using the DFA scheduler to implement VLIW scheduling for a 16-bit 
DSP. Recently I have come across an apparent bug in the scheduler. 
Consider the following sequence of instructions, with DFA scheduling 
turned off:

_L11:
        COPY.0 0,R3
        LSL.0 R3,2,R5
        ADD.0 R3,1,R3
        ADD.0 R5,FP,R5

        // etc...

(note that destination operands come last, sources come first)

To begin with, this is rather a strange sequence - a register is initialised to 0, and then various operations performed on that register - I haven't figured out why constant propogation doesn't make a better job of this. Anyway, with DFA scheduling turned on, I get the following code instead:

_L11:

        COPY.0 0,R3     \
        LSL.1 R3,2,R5

        ADD.0 R3,1,R3   \
        ADD.1 R5,FP,R5

        // etc...

Now the DFA scheduler has grouped the four instructions into two VLIW packets. However, the first of these packets contains an instruction which writes to R3, and which reads from R3. Thus, the wrong value of R3 is shifted into R5. It appears that the output dependency of the initial instruction is not being respected?

Any ideas?

thanks,

dan.

============================================================================
Daniel Towner
picoChip Designs Ltd., Riverside Buildings, 108, Walcot Street, BATH,
BA1 5BG
daniel.towner@picochip.com
07786 702589 



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

end of thread, other threads:[~2004-12-08  9:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-06 11:30 Incorrect DFA scheduling of output dependency Daniel Towner
2004-12-06 12:30 ` Nathan Sidwell
2004-12-06 12:31 ` Steven Bosscher
2004-12-06 16:27   ` Daniel Towner
2004-12-06 17:12     ` Vladimir Makarov
2004-12-07 10:59       ` Daniel Towner
2004-12-07 13:01         ` Steven Bosscher
2004-12-07 13:15           ` Steven Bosscher
2004-12-07 13:26             ` Jeffrey A Law
2004-12-07 13:40               ` Daniel Berlin
2004-12-07 22:15         ` Vladimir N. Makarov
     [not found]           ` <41B6360E.6010806@redhat.com>
2004-12-08  9:53             ` Daniel Towner

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).