public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* thread_jumps does nothing for ix86
@ 2000-09-22  0:46 Greg McGary
  2000-09-22  1:24 ` Greg McGary
  0 siblings, 1 reply; 2+ messages in thread
From: Greg McGary @ 2000-09-22  0:46 UTC (permalink / raw)
  To: law; +Cc: gcc

I discovered that thread_jumps spins its wheels but amounts to a no-op
for ix86.  I assume this is a bug.

Here is a typical sequence of insns for a conditional jump:

(insn 403 402 404 (set (reg:CC 17 flags)
        (compare:CC (reg:SI 136)
            (reg:SI 137))) -1 (nil)
    (nil))

(jump_insn 404 403 405 (set (pc)
        (if_then_else (ltu (reg:CC 17 flags)
                (const_int 0 [0x0]))
            (label_ref 409)
            (pc))) -1 (nil)
    (nil))

Call the first one the "compare insn" and the second the "jump insn".

The compare insn always sets reg:CC, and immediately after, the jump
insn is always conditional on a relop between reg:CC and const0_rtx.

Now, consider thread_jumps.  We locate a conditional branch b1, then
scan forward from b1's target to find b2.  While scanning for b2, we
note registers that are modified.  Immediately prior to finding b2 (a
jump insn) we scan past b2's compare insn which sets reg:CC, and we
remember by setting modified_regs[17].

When it comes time to check for threadability, rtx_equal_for_thread_p
considers equivalence of b1's reg:CC and b2's reg:CC, but
modified_regs[17] is nonzero, and hard regs are never considered
equivalent if modified, so rtx_equal_for_thread_p always returns false
in this context, hence thread_jumps does nothing for ix86.

Has this ever worked?  Was there a time when a jump insn's condition
referred directly to the operands of what's now in the compare insn,
so that we didn't trip over the intervening set of reg:CC?

Any suggestions for a machine-independent way to fix this?

Greg

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

* Re: thread_jumps does nothing for ix86
  2000-09-22  0:46 thread_jumps does nothing for ix86 Greg McGary
@ 2000-09-22  1:24 ` Greg McGary
  0 siblings, 0 replies; 2+ messages in thread
From: Greg McGary @ 2000-09-22  1:24 UTC (permalink / raw)
  To: law; +Cc: gcc

Greg McGary <greg@mcgary.org> writes:

> Any suggestions for a machine-independent way to fix this?

Nevermind.  I see how it can be done.

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

end of thread, other threads:[~2000-09-22  1:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-22  0:46 thread_jumps does nothing for ix86 Greg McGary
2000-09-22  1:24 ` Greg McGary

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