All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [Bug 90887] PhiMovesPass in register allocator broken
Date: Thu, 20 Aug 2015 18:35:02 +0000	[thread overview]
Message-ID: <bug-90887-8800-paq3DQBUKu@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-90887-8800-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>


[-- Attachment #1.1: Type: text/plain, Size: 4710 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=90887

--- Comment #22 from Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> ---
(In reply to jr from comment #21)
> Created attachment 117077 [details] [review]
> Prototype of a more highlevel graph modification api
> 
> After I realized that the prev/next arrays actually represent *two* linked
> lists (one for the source and one for the target side) and that these are
> circular it became easier:-)
> 
> I have attached a prototype of what I was hinting at in my first post. This
> is only lightly tested (but seems to work for Lifeless Planet at least) and
> I'm not sure that Pass is the correct place for the new method to live. It
> would probably also be nice if edge splitting kept both the outgoing and the
> incoming list of source and target resp. intact.
> 
> One improvement of this patch above my original proposal is that it produces
> the same edge types as the current code. My earlier patch would keep the
> edge type instead of setting it to FORWARD. While fixing that I was
> wondering whether TREE is always correct for the edge into the new BB.

Hrm, I was about to (try to) push this out, but it doesn't seem to work. I made
a few local adjustments, like

RegAlloc::PhiMovesPass::isCriticalEdge(BasicBlock *b, BasicBlock *p)
{
   return b->cfg.incidentCount() > 1 && p->cfg.outgoingCount() > 1;
}

instead of that needNewElseBlock thing, which seems like it's potentially wrong
or at least I don't understand wtf it's counting. And more generally the logic
is that you should avoid critical edges because it's unclear where to put the
computation. Anyways, this makes it easy to trigger the code for me without
TXL, and I get this before the RA passes:

MAIN:-1 ()
BB:0 (6 instructions) - df = { }
 -> BB:5 (tree)
 -> BB:2 (tree)
  0: ld u64 { %r32 %r34 } c0[0x10] (0)
  1: ld u64 { %r36 %r38 } c0[0x18] (0)
  2: mov u32 %r41 0x00000001 (0)
  3: joinat BB:6 (0)
  4: set u8 %p43 ne u32 %r41 c0[0x0] (0)
  5: not %p43 bra BB:5 (0)
BB:2 (4 instructions) - idom = BB:0, df = { BB:6 }
 -> BB:4 (forward)
 -> BB:3 (tree)
  6: mov u32 %r45 0x00000002 (0)
  7: joinat BB:4 (0)
  8: set u8 %p47 eq u32 %r45 c0[0x0] (0)
  9: not %p47 bra BB:4 (0)
BB:3 (2 instructions) - idom = BB:2, df = { BB:4 }
 -> BB:4 (forward)
 10: ld u64 { %r48 %r50 } c0[0x20] (0)
 11: bra BB:4 (0)
BB:4 (4 instructions) - idom = BB:2, df = { BB:6 }
 -> BB:6 (forward)
 12: phi u32 %r52 %r32 %r48 (0)
 13: phi u32 %r53 %r34 %r50 (0)
 14: join (0)
 15: bra BB:6 (0)
BB:5 (3 instructions) - idom = BB:0, df = { BB:6 }
 -> BB:6 (forward)
 16: ld u64 { %r66 %r68 } c0[0x20] (0)
 17: ld u64 { %r70 %r72 } c0[0x28] (0)
 18: bra BB:6 (0)
BB:6 (5 instructions) - idom = BB:0, df = { }
 -> BB:1 (tree)
 19: phi u32 %r54 %r52 %r66 (0)
 20: phi u32 %r55 %r53 %r68 (0)
 21: phi u32 %r56 %r36 %r70 (0)
 22: phi u32 %r57 %r38 %r72 (0)
 23: join (0)
BB:1 (5 instructions) - idom = BB:6, df = { }
 24: mov (SUBOP:1) f32 $r0 %r54 (0)
 25: mov (SUBOP:1) f32 $r1 %r55 (0)
 26: mov (SUBOP:1) f32 $r2 %r56 (0)
 27: mov (SUBOP:1) f32 $r3 %r57 (0)
 28: exit - # (0)


and then this after the RA passes:

MAIN:-1 ()
BB:0 (8 instructions) - df = { }
 -> BB:5 (tree)
 -> BB:2 (tree)
  0: ld u64 %r74d c0[0x10] (0)
  1: split u64 { %r32 %r34 } %r74d (0)
  2: ld u64 %r75d c0[0x18] (0)
  3: split u64 { %r36 %r38 } %r75d (0)
  4: mov u32 %r41 0x00000001 (0)
  5: joinat BB:6 (0)
  6: set u8 %p43 ne u32 %r41 c0[0x0] (0)
  7: not %p43 bra BB:5 (0)
BB:2 (4 instructions) - idom = BB:0, df = { BB:6 }
 -> BB:7 (tree)
 -> BB:3 (tree)
  8: mov u32 %r45 0x00000002 (0)
  9: joinat BB:4 (0)
 10: set u8 %p47 eq u32 %r45 c0[0x0] (0)
 11: not %p47 bra BB:7 (0)
BB:3 (5 instructions) - idom = BB:2, df = { BB:4 }
 -> BB:4 (forward)
 12: ld u64 %r76d c0[0x20] (0)
 13: split u64 { %r48 %r50 } %r76d (0)
 14: mov u32 %r89 %r48 (0)
 15: mov u32 %r90 %r50 (0)
 16: bra BB:4 (0)
BB:7 (3 instructions) - df = { }
 -> BB:4 (cross)
 17: mov u32 %r87 %r32 (0)
 18: mov u32 %r88 %r34 (0)
 19: bra BB:4 (0)
BB:5 (9 instructions) - idom = BB:0, df = { BB:6 }
 -> BB:6 (forward)
 20: ld u64 %r77d c0[0x20] (0)
 21: split u64 { %r66 %r68 } %r77d (0)
 22: ld u64 %r78d c0[0x28] (0)
 23: split u64 { %r70 %r72 } %r78d (0)
 24: mov u32 %r83 %r66 (0)
 25: mov u32 %r84 %r68 (0)
 26: mov u32 %r85 %r70 (0)
 27: mov u32 %r86 %r72 (0)
 28: bra BB:6 (0)

where did BB:4 go? poof. not great :( this is with piglit's
tests/shaders/ssa/fs-critical-edge.shader_test

I guess I'll go with either your or my first patches. Want to get this fixed
for Mesa 11, which is going to get branched off some time tomorrow.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 5980 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

  parent reply	other threads:[~2015-08-20 18:35 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07 19:32 [Bug 90887] New: PhiMovesPass in register allocator broken bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
     [not found] ` <bug-90887-8800-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>
2015-06-07 19:36   ` [Bug 90887] " bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-07 19:42   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-07 20:33   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-16 11:28   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17  4:44   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 14:06   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 15:40   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 18:59   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 23:32   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-18 18:13   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-18 19:19   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-18 20:52   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-22 12:24   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  6:17   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  6:23   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  6:25   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  7:51   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  8:37   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-29 21:43   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-29 23:06   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-07-12 18:41   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 18:35   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ [this message]
2015-08-20 20:20   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 20:21   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 22:16   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 22:23   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 22:45   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 23:34   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21  0:03   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 20:34   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 20:39   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 21:53   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 21:56   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 22:24   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 14:16   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 15:08   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 20:15   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 22:41   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-09-10  7:17   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-12-07 19:50   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
     [not found]     ` <bug-90887-8800-19WTPVxGXI-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>
2015-12-07 19:57       ` Craig Garner
2015-12-07 19:56   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
     [not found]     ` <bug-90887-8800-goEQduK9MX-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>
2015-12-07 20:04       ` Craig Garner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-90887-8800-paq3DQBUKu@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon-cc+yj3umiyqdupfqwhejaq@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.