Re: [Mesa-dev] [PATCH 025/133] i965/fs_nir: Use the correct types for texture inputs

2014-12-16 Thread Connor Abbott
I know I had another solution to this problem, but... meh. I don't particularly care what solution gets chosen. Reviewed-by: Connor Abbott On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 32 > +---

Re: [Mesa-dev] [PATCH 029/133] i965/fs_nir: Add support for sample_pos and sample_id

2014-12-16 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp > b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp > index 22f4c0

Re: [Mesa-dev] [PATCH 031/133] nir: Add fine and coarse derivative opcodes

2014-12-16 Thread Connor Abbott
As a future cleanup, would it be worth getting rid of fddx and fddy entirely and just generating the correct variant based on the glHint/drirc configuration? On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_opcodes.h | 4 > 1 file changed, 4 insertions(+) > >

Re: [Mesa-dev] [PATCH 037/133] nir: Add NIR_TRUE and NIR_FALSE constants and use them for boolean immediates

2014-12-16 Thread Connor Abbott
To be fully correct here, we should be plumbing through ctx->Const.NativeIntegers and setting it to 1.0f if that's false, but other things are already broken for hw without native integers so that can probably wait. Still, might be worth adding a TODO. In any case, Reviewed-by: Connor Abb

Re: [Mesa-dev] [PATCH 045/133] nir: Add a basic metadata management system

2014-12-16 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources| 1 + > src/glsl/nir/nir.c | 19 +++- > src/glsl/nir/nir.h | 21 -- > src/glsl/nir/nir_dominance.c | 6 ++--- > src/glsl/nir/nir_metadata.c | 52 > +

Re: [Mesa-dev] [PATCH 000/123] Reintroducing NIR, a new IR for mesa

2014-12-16 Thread Connor Abbott
Patches 23-26, 28, 30-35, 37-38, 40, (41 gets killed later so I didn't review it), 42-44 are Reviewed-by: Connor Abbott I'm going to bed now, but I'll try to do some more later. On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > NIR (pronounced "ner&

Re: [Mesa-dev] [PATCH 031/133] nir: Add fine and coarse derivative opcodes

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 6:52 AM, Jason Ekstrand wrote: > > > On Tue, Dec 16, 2014 at 10:31 PM, Connor Abbott wrote: >> >> As a future cleanup, would it be worth getting rid of fddx and fddy >> entirely and just generating the correct variant based on the >> glHin

Re: [Mesa-dev] [PATCH 045/133] nir: Add a basic metadata management system

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 7:04 AM, Jason Ekstrand wrote: > > > On Tue, Dec 16, 2014 at 10:58 PM, Connor Abbott wrote: >> >> On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand >> wrote: >> > --- >> > src/glsl/Makefile.sources|

Re: [Mesa-dev] [PATCH 046/133] nir: Add an assert

2014-12-17 Thread Connor Abbott
Sorry to ask, but... this one is so trivial and touches code that no earlier patch touches, why don't we just squash it into the commit that adds nir.c? On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/

Re: [Mesa-dev] [PATCH 045/133] nir: Add a basic metadata management system

2014-12-17 Thread Connor Abbott
One thing I'm a little worried about is that passes might forget to require the right metadata, and they'll just happen to work since the pass before also requires the same metadata and preserves it. I think a good thing to do to combat this is to have a debug mode that dirties *all* the metadata i

Re: [Mesa-dev] [PATCH 018/133] nir: add an SSA-based copy propagation pass

2014-12-17 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > From: Connor Abbott > > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h| 3 + > src/glsl/nir/nir_opt_copy_propagate.c | 313 > ++ &g

Re: [Mesa-dev] [PATCH 049/133] nir: Add a function to detect if a block is immediately followed by an if

2014-12-17 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > Since we don't actually have an "if" instruction, this is a very common > pattern when iterating over instructions. This adds a helper function for > it to make things a little less painful. > --- > src/glsl/nir/nir.c | 17 +++

Re: [Mesa-dev] [PATCH 050/133] nir: Make the nir_index_* functions return the nuber of items

2014-12-17 Thread Connor Abbott
This patch needs to get renamed, probably something like "nir: set reg_alloc and ssa_alloc when indexing registers and SSA values" On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.c | 3 +++ > src/glsl/nir/nir.h | 4 ++-- > 2 files changed, 5 insertions(+), 2 delet

Re: [Mesa-dev] [PATCH 051/133] nir: Add an SSA-based liveness analysis pass.

2014-12-17 Thread Connor Abbott
I'm sure you're already aware, but there are two things we could do to speed this up: 1. Pre-compute def/kill sets for each block similar to what i965 does. 2. Use a worklist + an array of flags for "this block is in the worklist" rather than walking all the basic blocks in reverse to find the few

Re: [Mesa-dev] [PATCH 051/133] nir: Add an SSA-based liveness analysis pass.

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 5:11 PM, Jason Ekstrand wrote: > On Wed, Dec 17, 2014 at 1:52 PM, Connor Abbott wrote: >> >> I'm sure you're already aware, but there are two things we could do to >> speed this up: >> >> 1. Pre-compute def/kill sets for each

Re: [Mesa-dev] [PATCH 018/133] nir: add an SSA-based copy propagation pass

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 5:20 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 1:10 PM, Jason Ekstrand > wrote: >> >> >> >> On Wed, Dec 17, 2014 at 12:07 PM, Connor Abbott >> wrote: >>> >>> On Tue, Dec 16, 2014 at 1

Re: [Mesa-dev] [PATCH 055/133] nir: Add a parallel copy instruction type

2014-12-17 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.c | 45 - > src/glsl/nir/nir.h | 23 +++ > src/glsl/nir/nir_print.c | 21 + > 3 files changed, 88 insertions(+), 1 deleti

Re: [Mesa-dev] [PATCH 057/133] nir: Add a better out-of-SSA pass

2014-12-17 Thread Connor Abbott
Whew! Other than a few minor things below, Reviewed-by: Connor Abbott I tried to understand it all as much as I could, but it is rather tricky... but I can't suggest anything to make it easier to understand, after all the paper itself is rather tricky and your comments help a lot. If anyon

Re: [Mesa-dev] [PATCH 045/133] nir: Add a basic metadata management system

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 5:59 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 11:51 AM, Connor Abbott wrote: >> >> One thing I'm a little worried about is that passes might forget to >> require the right metadata, and they'll just happen to work since

Re: [Mesa-dev] [PATCH 018/133] nir: add an SSA-based copy propagation pass

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 6:02 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 2:26 PM, Connor Abbott wrote: >> >> On Wed, Dec 17, 2014 at 5:20 PM, Jason Ekstrand >> wrote: >> > >> > >> > On Wed, Dec 17, 2014 at 1:10 PM, Jason Ekstra

Re: [Mesa-dev] [PATCH 060/133] nir: Validate all lists in the validator

2014-12-17 Thread Connor Abbott
I think we're missing a few things: * Phi node sources * Parallel copy entries Whether you care enough to validate those is up to you. Otherwise Reviewed-by: Connor Abbott On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_validate.c | 13 +++

Re: [Mesa-dev] [PATCH 060/133] nir: Validate all lists in the validator

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 8:00 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 4:52 PM, Connor Abbott wrote: >> >> I think we're missing a few things: >> >> * Phi node sources > > > Added > >> >> * Parallel copy entries >

Re: [Mesa-dev] [PATCH 071/133] nir: Add a fused multiply-add peephole

2014-12-17 Thread Connor Abbott
Would it be possible to drop this patch since this all gets deleted later? On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources| 1 + > src/glsl/nir/nir.h | 1 + > src/glsl/nir/nir_opcodes.h | 1 + > sr

Re: [Mesa-dev] [PATCH 074/133] i965/fs_nir: Use an array rather than a hash table for register lookup

2014-12-17 Thread Connor Abbott
We shouldn't ever have global registers until we start dealing with subroutines, so you don't need to handle them here. On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand wrote: > --- > src/mesa/drivers/dri/i965/brw_fs.h | 4 +-- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 46 > +++

Re: [Mesa-dev] [PATCH 075/133] i965/fs_nir: Handle SSA constants

2014-12-17 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_from_ssa.c | 40 - > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 50 > +--- > 2 files changed, 65 insertions(+), 25 deletions(-) > > diff --git a/src/gl

Re: [Mesa-dev] [PATCH 088/133] nir: Use the enum for the variable mode

2014-12-17 Thread Connor Abbott
Again, this looks pretty self-contained and pretty easy to squash. On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h > index b04a137..fc16cb5 100644 >

Re: [Mesa-dev] [PATCH 089/133] nir: Automatically update SSA if uses

2014-12-17 Thread Connor Abbott
Can we move this right after patch 53 (nir: Automatically handle SSA uses when an instruction is inserted), since they're doing similar things? On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.c | 9 - > 1 file changed, 4 insertions(+), 5 deletions(-) > > d

Re: [Mesa-dev] [PATCH 090/133] nir: Add a copy splitting pass

2014-12-17 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 2 + > src/glsl/nir/nir_split_var_copies.c | 225 > > 3 files changed, 228 insertions(+) > create mode 10064

Re: [Mesa-dev] [PATCH 051/133] nir: Add an SSA-based liveness analysis pass.

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 8:48 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 2:23 PM, Connor Abbott wrote: >> >> On Wed, Dec 17, 2014 at 5:11 PM, Jason Ekstrand >> wrote: >> > On Wed, Dec 17, 2014 at 1:52 PM, Connor Abbott >> > wrote: &

Re: [Mesa-dev] [PATCH 075/133] i965/fs_nir: Handle SSA constants

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 8:41 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 5:30 PM, Connor Abbott wrote: >> >> On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand >> wrote: >> > --- >> > src/glsl/nir/nir_from_ssa.c | 40 +++

Re: [Mesa-dev] [PATCH 091/133] nir: Add a pass to lower local variable accesses to SSA values

2014-12-17 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > This pass analizes all of the load/store operations and, when a variable is > never aliased (potentially used by an indirect operation), it is lowered > directly to an SSA value. This pass translates to SSA directly and does > not require a

Re: [Mesa-dev] [PATCH 090/133] nir: Add a copy splitting pass

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 9:38 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 6:01 PM, Connor Abbott wrote: >> >> > + >> > +static nir_deref * >> > +get_deref_tail(nir_deref *deref) >> > +{ >> > + while (deref->child !

Re: [Mesa-dev] [PATCH 091/133] nir: Add a pass to lower local variable accesses to SSA values

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 10:13 PM, Connor Abbott wrote: > On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: >> This pass analizes all of the load/store operations and, when a variable is >> never aliased (potentially used by an indirect operation), it is lowered >> dir

Re: [Mesa-dev] [PATCH 000/123] Reintroducing NIR, a new IR for mesa

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 1:59 AM, Connor Abbott wrote: > Patches 23-26, 28, 30-35, 37-38, 40, (41 gets killed later so I didn't > review it), 42-44 are > > Reviewed-by: Connor Abbott > > I'm going to bed now, but I'll try to do some more later. Patches 47-48,

Re: [Mesa-dev] [PATCH 091/133] nir: Add a pass to lower local variable accesses to SSA values

2014-12-17 Thread Connor Abbott
On Wed, Dec 17, 2014 at 10:50 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 7:13 PM, Connor Abbott wrote: >> >> On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand >> wrote: >> > This pass analizes all of the load/store operations and, when a

Re: [Mesa-dev] [PATCH 007/133] nir: add a validation pass

2014-12-18 Thread Connor Abbott
On Thu, Dec 18, 2014 at 2:01 AM, Eric Anholt wrote: > Jason Ekstrand writes: > >> From: Connor Abbott >> >> This is similar to ir_validate.cpp. >> >> v2: Jason Ekstrand : >>whitespace fixes > > I have again not reviewed the control

Re: [Mesa-dev] [PATCH 007/133] nir: add a validation pass

2014-12-18 Thread Connor Abbott
On Thu, Dec 18, 2014 at 1:49 PM, Eric Anholt wrote: > Connor Abbott writes: > >> On Thu, Dec 18, 2014 at 2:01 AM, Eric Anholt wrote: >>> Jason Ekstrand writes: >>> >>>> From: Connor Abbott >>>> >>>> This is similar to ir_val

Re: [Mesa-dev] [PATCH 006/133] nir: add a printer

2014-12-18 Thread Connor Abbott
On Thu, Dec 18, 2014 at 5:01 PM, Jason Ekstrand wrote: > > > On Wed, Dec 17, 2014 at 10:22 PM, Eric Anholt wrote: >> >> Jason Ekstrand writes: >> >> > From: Connor Abbott >> > >> > This is similar to ir_print_visitor.cpp. >> >>

Re: [Mesa-dev] [PATCH 144/133] nir: Add some documentation

2014-12-18 Thread Connor Abbott
On Thu, Dec 18, 2014 at 8:15 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.h | 43 +-- > 1 file changed, 33 insertions(+), 10 deletions(-) > > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h > index 19781c1..aa128ad 100644 > --- a/src/glsl/nir/nir

Re: [Mesa-dev] [PATCH v2 144/133] nir: Add some documentation

2014-12-18 Thread Connor Abbott
Reviewed-by: Connor Abbott On Thu, Dec 18, 2014 at 9:44 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.h | 53 +++-- > 1 file changed, 43 insertions(+), 10 deletions(-) > > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h

Re: [Mesa-dev] [PATCH 091/133] nir: Add a pass to lower local variable accesses to SSA values

2015-01-04 Thread Connor Abbott
Ok, I'm going to try reviewing this again. I'm pasting the latest version of the file from review/nir-v1 and replying to that so that I won't get confused between all the various changes and reorganizing things. Here we go! > /* > * Copyright © 2014 Intel Corporation > * > * Permission is hereb

Re: [Mesa-dev] [PATCH 094/133] nir: Add a pass to lower global variables to local variables

2015-01-04 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h| 2 + > src/glsl/nir/nir_lower_global_vars_to_local.c | 107 > ++ > 3 files changed, 110 insertions(+)

Re: [Mesa-dev] [PATCH 092/133] nir: Add a pass to lower local variables to registers

2015-01-04 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 2 + > src/glsl/nir/nir_lower_locals_to_regs.c | 313 > > 3 files changed, 316 insertions(+) > create mo

Re: [Mesa-dev] [PATCH 092/133] nir: Add a pass to lower local variables to registers

2015-01-04 Thread Connor Abbott
Oh, and I forgot... can we rename this to lower_local_to_regs_scalar or at least add a note that this won't work for vec4 backends yet due to the different indexing? On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/n

Re: [Mesa-dev] [PATCH 093/133] nir: Add a pass for lowering input/output loads/stores

2015-01-04 Thread Connor Abbott
I'd also like to rename or at least note that this is a scalar-only thing for now... otherwise, Reviewed-by: Connor Abbott On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 2 + > src/glsl/n

Re: [Mesa-dev] [PATCH 095/133] nir/glsl: Generate SSA NIR

2015-01-04 Thread Connor Abbott
Except for the minor stale comment and assuming you checked that we don't call nir_create_local_reg() anymore, Reviewed-by: Connor Abbott On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > With this commit, the GLSL IR -> NIR pass generates NIR in more-or-less SSA > form

Re: [Mesa-dev] [PATCH 097/133] nir/validate: Ensure that outputs are write-only and inputs are read-only

2015-01-04 Thread Connor Abbott
I'm not so sure how I feel about checking that outputs are write-only... eventually we'll want to do lower_input_reads in NIR itself, at which point we'll need to remove that part from the validator. At the same time, for now this is somewhat useful. I'm just not sure if it's worth it (making sure

Re: [Mesa-dev] [PATCH 096/133] i965/fs_nir: Use the new variable lowering code

2015-01-04 Thread Connor Abbott
Reviewed-by: Connor Abbott Nice job getting this variable lowering stuff all done! On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > This commit switches us over to the new variable lowering code which is > capable of properly handling lowering indirects as we go. > --- &g

Re: [Mesa-dev] [PATCH 099/133] nir: Vectorize intrinsics

2015-01-04 Thread Connor Abbott
Reviewed-by: Connor Abbott Nice to see that this idea worked out well! On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > We used to have the number of components built into the intrinsic. This > meant that all of our load/store intrinsics had vec1, vec2, vec3, and vec4 >

Re: [Mesa-dev] [PATCH 098/133] nir: Remove the old variable lowering code

2015-01-04 Thread Connor Abbott
Reviewed-by: Connor Abbott On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources |1 - > src/glsl/nir/nir_lower_variables_scalar.c | 1249 > - > 2 files changed, 1250 deletions(-) > delete mo

Re: [Mesa-dev] [PATCH 105/133] i965/fs_nir: Implement the ARB_gpu_shader5 interpolation intrinsics

2015-01-04 Thread Connor Abbott
This is a general question for the interpolation support: Why are we using the variable-based intrinsics directly, instead of lowering it to something index-based in the lower_io pass just like we do for normal inputs? On Tue, Dec 16, 2014 at 1:12 AM, Jason Ekstrand wrote: > --- > src/mesa/dri

Re: [Mesa-dev] [PATCH 101/133] nir: Add gpu_shader5 interpolation intrinsics

2015-01-04 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:12 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_intrinsics.h | 32 +++- > src/glsl/nir/nir_lower_io.c | 16 ++-- > 2 files changed, 21 insertions(+), 27 deletions(-) > > diff --git a/src/glsl/nir/nir_intrinsics.h b/src/gls

Re: [Mesa-dev] [PATCH 110/133] nir: Add an expression matching framework

2015-01-05 Thread Connor Abbott
Hi, Was it your intention to not support non-per-component things like dot product at all? I've made a few inline comments about how to do it, and it doesn't seem like it's that hard. On Tue, Dec 16, 2014 at 1:12 AM, Jason Ekstrand wrote: > > This framework provides a simple way to do simple sea

Re: [Mesa-dev] [PATCH 111/133] nir: Add infastructure for generating algebraic transformation passes

2015-01-05 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:12 AM, Jason Ekstrand wrote: > This commit builds on the nir_search.h infastructure by adds a bit of adding > python code that makes it stupid easy to write an algebraic transformation > pass. The nir_algebraic.py file contains four python classes that > correspond dir

Re: [Mesa-dev] [PATCH 112/133] nir: Add an algebraic optimization pass

2015-01-05 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:12 AM, Jason Ekstrand wrote: > This pass uses the previously built algebraic transformations framework and > should act as an example for anyone else wanting to make an algebraic > transformation pass for NIR. > --- > src/glsl/Makefile.am | 10 - >

Re: [Mesa-dev] [PATCH 113/133] nir: Add a basic constant folding pass

2015-01-05 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:12 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources| 1 + > src/glsl/nir/nir.h | 1 + > src/glsl/nir/nir_opt_constant_folding.c | 283 > +++ > src/mesa/drivers/dri/i965/brw_fs_nir.cpp |

Re: [Mesa-dev] [PATCH 091/133] nir: Add a pass to lower local variable accesses to SSA values

2015-01-05 Thread Connor Abbott
>> >> I was mislead by the "leaf" name the first time I reviewed this; having a >> comment explaining what it does helps, but I still think that it's a pretty >> misleading name. "Leaf," at least to me, implies that it's a leaf of the >> dereference tree, which in this case isn't true unless I'm mi

Re: [Mesa-dev] [PATCH 118/133] nir: Add a sampler index indirect to nir_tex_instr

2015-01-05 Thread Connor Abbott
I created nir_tex_src_sampler_index for exactly this purpose, which fits in with the "stick all the sources in an array so we can easily iterate over them" philosophy. If you decide to keep with this solution, though, at least remove that. On Tue, Dec 16, 2014 at 1:13 AM, Jason Ekstrand wrote: >

Re: [Mesa-dev] [PATCH 119/133] nir: Rework the way samplers are lowered

2015-01-05 Thread Connor Abbott
I don't really feel qualified to review this, since I didn't write any of the original code (I just copied-n-pasted it from what i965 was doing...). I'm not sure who would be able to, maybe Chris Forbes since he did the indirect sampler work? On Tue, Dec 16, 2014 at 1:13 AM, Jason Ekstrand wrote:

Re: [Mesa-dev] [PATCH 120/133] i965/fs_nir: Add support for indirect texture arrays

2015-01-05 Thread Connor Abbott
Again, not my area of expertise here. On Tue, Dec 16, 2014 at 1:13 AM, Jason Ekstrand wrote: > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 24 ++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp > b/src/mesa/

Re: [Mesa-dev] [PATCH 132/133] nir: Make nir_ssa_undef_instr_create take a number of components

2015-01-05 Thread Connor Abbott
The commit message should probably say something like "nir: Make nir_ssa_undef_instr_create initialize the destination". That we now need to pass in the number of components is just a side effect. On Tue, Dec 16, 2014 at 1:13 AM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.c |

Re: [Mesa-dev] [PATCH 139/133] nir/from_ssa: Clean up parallel copy handling and document it better

2015-01-05 Thread Connor Abbott
On Wed, Dec 17, 2014 at 8:04 PM, Jason Ekstrand wrote: > Previously, we were doing a lazy creation of the parallel copy > instructions. This is confusing, hard to get right, and involves some > extra state tracking of the copies. This commit adds an extra walk over > the basic blocks to add the

Re: [Mesa-dev] [PATCH 147/133] nir: Make intrinsic flags into an enum

2015-01-05 Thread Connor Abbott
Can you make the fields lowercase to match the algebraic properties enum? Or did you make that uppercase? Lowercase feels better to me since it's an enum, but I don't really care too much. On Fri, Dec 19, 2014 at 8:02 PM, Jason Ekstrand wrote: > This should be much better for debugging as GDB wil

Re: [Mesa-dev] [PATCH 000/123] Reintroducing NIR, a new IR for mesa

2015-01-05 Thread Connor Abbott
Patches 100, 102-104, 106-109, 114-117, 121-146 are: Reviewed-by: Connor Abbott Whew! I think I've looked through everything. On Tue, Dec 16, 2014 at 1:04 AM, Jason Ekstrand wrote: > NIR (pronounced "ner") is a new IR (internal representation) for the Mesa > shader c

Re: [Mesa-dev] [PATCH 118/133] nir: Add a sampler index indirect to nir_tex_instr

2015-01-07 Thread Connor Abbott
On Tue, Jan 6, 2015 at 6:36 PM, Jason Ekstrand wrote: > > > On Mon, Jan 5, 2015 at 10:45 PM, Connor Abbott wrote: >> >> I created nir_tex_src_sampler_index for exactly this purpose, which >> fits in with the "stick all the sources in an array so we can easily >

Re: [Mesa-dev] [PATCH 147/133] nir: Make intrinsic flags into an enum

2015-01-08 Thread Connor Abbott
On Tue, Jan 6, 2015 at 6:27 PM, Jason Ekstrand wrote: > > > On Mon, Jan 5, 2015 at 11:26 PM, Connor Abbott wrote: >> >> Can you make the fields lowercase to match the algebraic properties >> enum? Or did you make that uppercase? Lowercase feels better to me >>

Re: [Mesa-dev] [PATCH 05/22] glsl: Add sqrt, rsq, exp, exp2 to get_range

2015-01-08 Thread Connor Abbott
On Sat, Jan 3, 2015 at 2:18 PM, Thomas Helland wrote: > Also handle undefined behaviour for sqrt(x) where x < 0 > and rsq(x) where x <= 0. > > This gives us some reduction in instruction count on three > Dungeon Defenders shaders as they are doing: max(exp(x), 0) So initially when you said that D

Re: [Mesa-dev] [PATCH 149/133] nir: Use the actual FNV-1a hash for hashing derefs

2015-01-09 Thread Connor Abbott
; > + break; > + default: > + assert("Invalid deref chain"); > return false; > - break; > - } > - case nir_deref_type_struct: > - if (nir_deref_as_struct(a)->index != nir_deref_as_struct(b)->index) > + } > + > + assert((a->child == NULL) == (b->child == NULL)); > + if((a->child == NULL) != (b->child == NULL)) > return false; Hmm, if you're already doing the assert I don't think the if is really necessary? > - break; > - default: > - unreachable("Invalid dreference type"); > } > > - assert((a->child == NULL) == (b->child == NULL)); > - if (a->child) > - return derefs_equal(a->child, b->child); > - else > - return true; > + return true; > } > > static int > -- > 2.2.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev Other than the a few minor things, Reviewed-by: Connor Abbott ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 152/133] nir/validate: Don't build anything unless we're in

2015-01-09 Thread Connor Abbott
With Matt's suggested commit message, Reviewed-by: Connor Abbott On Tue, Jan 6, 2015 at 7:34 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.h | 4 > src/glsl/nir/nir_validate.c | 7 +++ > 2 files changed, 11 insertions(+) > > diff --git a/src/gl

Re: [Mesa-dev] [PATCH 149/133] nir: Use the actual FNV-1a hash for hashing derefs

2015-01-09 Thread Connor Abbott
Whoops... I was looking over the actual file (instead of the patch), and there's a comment above (at least in lower_variables) about magic numbers that needs to be deleted or rewritten. On Fri, Jan 9, 2015 at 1:30 PM, Connor Abbott wrote: > As you mentioned, you should add somethin

Re: [Mesa-dev] [PATCH 091/133] nir: Add a pass to lower local variable accesses to SSA values

2015-01-09 Thread Connor Abbott
On Sun, Jan 4, 2015 at 4:01 PM, Connor Abbott wrote: [...] >> static bool >> deref_may_be_aliased(nir_deref_var *deref, >> struct lower_variables_state *state) >> { >>nir_deref_var var_deref = *deref; >>var_deref.deref.child =

Re: [Mesa-dev] [PATCH 151/133] nir/lower_variables: Improve documentation

2015-01-09 Thread Connor Abbott
On Tue, Jan 6, 2015 at 7:34 PM, Jason Ekstrand wrote: > Additional description was added to a variety of places. Also, we no > longer use the term "leaf" to describe fully-qualified direct derefs. > Instead, we simply use the term "direct" or spell it out completely. > --- > src/glsl/nir/nir_low

Re: [Mesa-dev] [PATCH v2 118/133] nir/tex_instr: Rename the indirect source type

2015-01-09 Thread Connor Abbott
Reviewed-by: Connor Abbott On Wed, Jan 7, 2015 at 9:03 PM, Jason Ekstrand wrote: > In particular, we rename nir_tex_src_sampler_index to _sampler_offset and > add a sampler_array_size field to nir_tex_instr. This way we can pass the > size of sampler arrays through to backends e

Re: [Mesa-dev] [PATCH v2 118.5/133] nir/tex_instr_create: Initialize all 4 sources

2015-01-09 Thread Connor Abbott
BTW, now that we're adding an extra possible source, do we need to expand the size of the source array? Anyways, Reviewed-by: Connor Abbott On Wed, Jan 7, 2015 at 9:03 PM, Jason Ekstrand wrote: > This helps a lot with things like lowering passes that may need to add > sources. &

Re: [Mesa-dev] [PATCH v2 118.5/133] nir/tex_instr_create: Initialize all 4 sources

2015-01-09 Thread Connor Abbott
On Fri, Jan 9, 2015 at 5:41 PM, Jason Ekstrand wrote: > > > On Fri, Jan 9, 2015 at 11:34 AM, Connor Abbott wrote: >> >> BTW, now that we're adding an extra possible source, do we need to >> expand the size of the source array? > > > I don't know that

Re: [Mesa-dev] [PATCH 092/133] nir: Add a pass to lower local variables to registers

2015-01-09 Thread Connor Abbott
+ case nir_intrinsic_copy_var: + unreachable("There should be no copies whatsoever at this point"); + break; >>> >>> >>> Are you sure about this? My impression is that lower_variables will lower >>> copies involving things that aren't indirectly referenced,

Re: [Mesa-dev] [PATCH 153/133] nir/tex_instr: Add a nir_tex_src struct and

2015-01-09 Thread Connor Abbott
Ok, with the assert removed, Reviewed-by: Connor Abbott On Fri, Jan 9, 2015 at 11:16 PM, Jason Ekstrand wrote: > > > On Fri, Jan 9, 2015 at 8:04 PM, Jason Ekstrand wrote: >> >> This solves a number of problems. First is the ability to change the >> numbe

Re: [Mesa-dev] [PATCH 153/133] nir/tex_instr: Add a nir_tex_src struct and

2015-01-09 Thread Connor Abbott
On Fri, Jan 9, 2015 at 11:04 PM, Jason Ekstrand wrote: > This solves a number of problems. First is the ability to change the > number of sources that a texture instruction has. Second, it solves the > delema that may occur if a texture instruction has more than 4 sources. > --- > src/glsl/nir/

Re: [Mesa-dev] [PATCH 105/133] i965/fs_nir: Implement the ARB_gpu_shader5 interpolation intrinsics

2015-01-09 Thread Connor Abbott
On Tue, Jan 6, 2015 at 1:04 AM, Jason Ekstrand wrote: > > > On Sun, Jan 4, 2015 at 9:15 PM, Connor Abbott wrote: >> >> This is a general question for the interpolation support: >> >> Why are we using the variable-based intrinsics directly, instead of >>

Re: [Mesa-dev] [PATCH 05/22] glsl: Add sqrt, rsq, exp, exp2 to get_range

2015-01-11 Thread Connor Abbott
o standard because of D3D. It seems worth preserving this behavior, and more generally being careful about NaN's when doing range analysis (unless the hardware is known to never return NaN's), to keep games from potentially breaking on edge cases like these. > > On Fri, Jan 9, 2015

Re: [Mesa-dev] [PATCH 090/133] nir: Add a copy splitting pass

2015-01-11 Thread Connor Abbott
On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 2 + > src/glsl/nir/nir_split_var_copies.c | 225 > > 3 files changed, 228 insertions(+) > create mode 10064

Re: [Mesa-dev] [PATCH 110/133] nir: Add an expression matching framework

2015-01-11 Thread Connor Abbott
On Tue, Jan 6, 2015 at 5:21 PM, Jason Ekstrand wrote: > > > On Mon, Jan 5, 2015 at 10:00 PM, Jason Ekstrand > wrote: >> >> >> >> On Mon, Jan 5, 2015 at 9:12 PM, Connor Abbott wrote: >>> >>> Hi, >>> >>> Was it your inten

Re: [Mesa-dev] [PATCH 150/133] nir/lower_variables: Use a for loop for get_deref_node

2015-01-11 Thread Connor Abbott
Reviewed-by: Connor Abbott On Tue, Jan 6, 2015 at 7:34 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_lower_variables.c | 111 > + > 1 file changed, 50 insertions(+), 61 deletions(-) > > diff --git a/src/glsl/nir/nir_lower_variables.c

Re: [Mesa-dev] [PATCH 000/123] Reintroducing NIR, a new IR for mesa

2015-01-11 Thread Connor Abbott
actly how that > all gets hooked up for other gallium drivers beyond vc4 is outside the > scope of this series. > > I have pushed a branch to my personal freedesktop.org account. For certain > types of review, it may be easier to look at the end result rather than the > patc

Re: [Mesa-dev] [PATCH 151/133] nir/lower_variables: Improve documentation

2015-01-14 Thread Connor Abbott
On Wed, Jan 14, 2015 at 3:36 PM, Jason Ekstrand wrote: > > > On Fri, Jan 9, 2015 at 11:31 AM, Connor Abbott wrote: >> >> On Tue, Jan 6, 2015 at 7:34 PM, Jason Ekstrand >> wrote: >> > Additional description was added to a variety of places. Also, we n

Re: [Mesa-dev] [PATCH 092/133] nir: Add a pass to lower local variables to registers

2015-01-14 Thread Connor Abbott
On Fri, Jan 9, 2015 at 8:27 PM, Jason Ekstrand wrote: > > > On Fri, Jan 9, 2015 at 4:38 PM, Connor Abbott wrote: >> >> >>>> + case nir_intrinsic_copy_var: >> >>>> + unreachable("There should be no copies wha

Re: [Mesa-dev] [PATCH 154/133] nir: Rename lower_variables to lower_vars_to_ssa

2015-01-14 Thread Connor Abbott
Reviewed-by: Connor Abbott On Wed, Jan 14, 2015 at 3:43 PM, Jason Ekstrand wrote: > The original name wasn't particularly descriptive. This one indicates that > it actually gives you SSA values as opposed to the old pass which lowered > variables to registers. >

Re: [Mesa-dev] [PATCH 90.1/133] SQUASH/nir: Add documentation for nir_split_var_copies

2015-01-14 Thread Connor Abbott
With this squashed in, patch 90 is Reviewed-by: Connor Abbott On Wed, Jan 14, 2015 at 2:57 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_split_var_copies.c | 96 > ++--- > 1 file changed, 78 insertions(+), 18 deletions(-) > > diff --

Re: [Mesa-dev] [PATCH 155/133] nir/vars_to_ssa: Refactor get_deref_node

2015-01-14 Thread Connor Abbott
Reviewed-by: Connor Abbott On Wed, Jan 14, 2015 at 5:02 PM, Jason Ekstrand wrote: > This refactor allows you to more easily get the deref node associated with > a given variable. We then use that new functionality in the > deref_may_be_aliased function instead of creating a 1-elem

Re: [Mesa-dev] [PATCH 151/133] nir/lower_variables: Improve documentation

2015-01-14 Thread Connor Abbott
On Wed, Jan 14, 2015 at 5:05 PM, Jason Ekstrand wrote: > > > On Wed, Jan 14, 2015 at 1:05 PM, Connor Abbott wrote: >> >> On Wed, Jan 14, 2015 at 3:36 PM, Jason Ekstrand >> wrote: >> > >> > >> > On Fri, Jan 9, 2015 at 11:31 AM, Connor Abbot

Re: [Mesa-dev] [PATCH 110/133] nir: Add an expression matching framework

2015-01-14 Thread Connor Abbott
On Wed, Jan 14, 2015 at 5:15 PM, Jason Ekstrand wrote: > > > On Sun, Jan 11, 2015 at 7:08 PM, Connor Abbott wrote: >> >> On Tue, Jan 6, 2015 at 5:21 PM, Jason Ekstrand >> wrote: >> > >> > >> > On Mon, Jan 5, 2015 at 10:00 PM, Jason Ekstr

Re: [Mesa-dev] [PATCH 156/133] nir: Add a pass for lowering copy instructions

2015-01-14 Thread Connor Abbott
This, patch 157, and patch 158 are Reviewed-by: Connor Abbott On Wed, Jan 14, 2015 at 6:28 PM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 3 + > src/glsl/nir/nir_lower_var_co

Re: [Mesa-dev] [PATCH 092/133] nir: Add a pass to lower local variables to registers

2015-01-14 Thread Connor Abbott
Together with the patches to lower all wildcard copies, Reviewed-by: Connor Abbott On Tue, Dec 16, 2014 at 1:11 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 2 + > src/glsl/nir/nir_lower_locals_to_

Re: [Mesa-dev] [PATCH 000/123] Reintroducing NIR, a new IR for mesa

2015-01-14 Thread Connor Abbott
On Wed, Jan 14, 2015 at 6:53 PM, Jason Ekstrand wrote: > > > On Sun, Jan 11, 2015 at 7:52 PM, Connor Abbott wrote: >> >> Patches without my Reviewed-by on them on your branch are: >> >> "i965/fs_nir: Add support for sample_pos and sample_id" >> &g

Re: [Mesa-dev] [PATCH] nir/algebraic: Only replace an instruction once

2015-01-14 Thread Connor Abbott
Reviewed-by: Connor Abbott Just curious, how did this come about? On Wed, Jan 14, 2015 at 10:15 PM, Jason Ekstrand wrote: > Without the break, it was possible that an instruction would match multiple > expressions. If this happened, you could end up trying to replace it > multiple

Re: [Mesa-dev] [PATCH 1/2] nir: Add a worklist helper structure

2015-01-15 Thread Connor Abbott
Series is Reviewed-by: Connor Abbott As you know, I have a branch that generalizes this and adds a worklist for SSA definitions as well. But I think we won't want the SSA-def worklist for DCE, since just like with phi-node placement we only ever push something onto the worklist once, and w

Re: [Mesa-dev] [PATCH] nir: silence compiler warning from visit_src() call

2015-01-15 Thread Connor Abbott
On Thu, Jan 15, 2015 at 5:28 PM, Brian Paul wrote: > Warning seen with gcc 4.8.2 > --- > src/glsl/nir/nir.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c > index f112db8..6d6f910 100644 > --- a/src/glsl/nir/nir.c > +++ b/src/glsl/

Re: [Mesa-dev] [PATCH] nir: silence compiler warning from visit_src() call

2015-01-15 Thread Connor Abbott
Reviewed-by: Connor Abbott On Thu, Jan 15, 2015 at 6:16 PM, Brian Paul wrote: > v2: use proper argument > --- > src/glsl/nir/nir.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c > index f112db8..81dec1c 10

Re: [Mesa-dev] [PATCH] nir: silence compiler warning from visit_src() call

2015-01-15 Thread Connor Abbott
Btw, apparently nir_validate.c has the same problem on line 391. On Thu, Jan 15, 2015 at 6:31 PM, Connor Abbott wrote: > Reviewed-by: Connor Abbott > > On Thu, Jan 15, 2015 at 6:16 PM, Brian Paul wrote: >> v2: use proper argument >> --- >> src/glsl/nir/nir.c |

Re: [Mesa-dev] [PATCH] nir: fix incorrect argument passed to validate_src() in validate_tex_instr()

2015-01-15 Thread Connor Abbott
Reviewed-by: Connor Abbott On Thu, Jan 15, 2015 at 7:39 PM, Brian Paul wrote: > Silences a compiler warning. > --- > src/glsl/nir/nir_validate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate

<    1   2   3   4   5   6   7   8   9   10   >