Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-04-02 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/30/2011 09:34 PM, Tom Stellard wrote: > Ok, this makes sense. It would be pretty easy to modify my original patch > to do this, but maybe it's better change the way ir_to_mesa.cpp converts > conditional assignments to Mesa IR. Do you have any

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-30 Thread Tom Stellard
On Wed, Mar 30, 2011 at 10:09:58AM -0700, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 03/29/2011 08:27 PM, Tom Stellard wrote: > > > > The reason there are reads of undefined values is because of all the > > conditional assignments generated by the IF to condition

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-30 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/29/2011 08:27 PM, Tom Stellard wrote: > On Tue, Mar 29, 2011 at 02:16:39PM -0700, Eric Anholt wrote: > >> On Tue, 29 Mar 2011 11:35:33 -0700, Tom Stellard wrote: >>> On Tue, Mar 29, 2011 at 10:19:13AM -0700, Eric Anholt wrote: On Mon, 28 M

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-29 Thread Tom Stellard
On Tue, Mar 29, 2011 at 02:11:01PM -0400, Jerome Glisse wrote: > > Long time since i have look into mesa shader but your code seems to > completely ignore program flow and thus might face wrong positive. For > instance : > > Consider a flow graph, in this flow graph consider B0 & B1 two > differe

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-29 Thread Tom Stellard
On Tue, Mar 29, 2011 at 02:16:39PM -0700, Eric Anholt wrote: > t > On Tue, 29 Mar 2011 11:35:33 -0700, Tom Stellard wrote: > > On Tue, Mar 29, 2011 at 10:19:13AM -0700, Eric Anholt wrote: > > > On Mon, 28 Mar 2011 22:59:31 -0700, Tom Stellard > > > wrote: > > > > This pass scans programs for in

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-29 Thread Eric Anholt
tOn Tue, 29 Mar 2011 11:35:33 -0700, Tom Stellard wrote: > On Tue, Mar 29, 2011 at 10:19:13AM -0700, Eric Anholt wrote: > > On Mon, 28 Mar 2011 22:59:31 -0700, Tom Stellard wrote: > > > This pass scans programs for instructions that read registers that have > > > not been written and replaces the

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-29 Thread Tom Stellard
On Tue, Mar 29, 2011 at 10:19:13AM -0700, Eric Anholt wrote: > On Mon, 28 Mar 2011 22:59:31 -0700, Tom Stellard wrote: > > This pass scans programs for instructions that read registers that have > > not been written and replaces these reads with a read from a constant > > register with the value o

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-29 Thread Jerome Glisse
On Tue, Mar 29, 2011 at 1:59 AM, Tom Stellard wrote: > This pass scans programs for instructions that read registers that have > not been written and replaces these reads with a read from a constant > register with the value of zero.  This pass prevents phantom > dependencies from being introduced

Re: [Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-29 Thread Eric Anholt
On Mon, 28 Mar 2011 22:59:31 -0700, Tom Stellard wrote: > This pass scans programs for instructions that read registers that have > not been written and replaces these reads with a read from a constant > register with the value of zero. This pass prevents phantom > dependencies from being introdu

[Mesa-dev] [PATCH 2/2] prog_optimize: Add reads without writes optimization pass

2011-03-28 Thread Tom Stellard
This pass scans programs for instructions that read registers that have not been written and replaces these reads with a read from a constant register with the value of zero. This pass prevents phantom dependencies from being introduced by the register allocator and improves the efficiency of subs