[Mesa-dev] [PATCH 3/4] nir/glsl: make emit() take nir_ssa_def * sources

2015-10-31 Thread Connor Abbott
Again, this matches what the builder will have to do. Signed-off-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index

[Mesa-dev] [PATCH 0/4] Make glsl-to-nir use the builder

2015-10-31 Thread Connor Abbott
p.org/~cwabbott0/mesa glsl-to-nir-builder Connor Abbott (4): nir/glsl: make evaluate_rvalue() return a nir_ssa_def * nir/glsl: convert nir_visitor::result to a nir_ssa_def * nir/glsl: make emit() take nir_ssa_def * sources nir/glsl: switch to using the builder src/glsl/nir/glsl_to_nir.cpp

Re: [Mesa-dev] RFC: parallel shader compiles in mesa

2015-11-01 Thread Connor Abbott
There was already some work done for this (with i965) a while back: http://lists.freedesktop.org/archives/mesa-dev/2014-July/063008.html IIRC the reason it didn't get merged was that Chia never actually made sure that the compiler was threadsafe (despite some patches fixing some things). I can't

Re: [Mesa-dev] [PATCH] nir: Silence GCC maybe-uninitialized warnings.

2015-11-02 Thread Connor Abbott
Reviewed-by: Connor Abbott On Mon, Nov 2, 2015 at 4:30 AM, Vinson Lee wrote: > nir/nir_control_flow.c: In function ‘split_block_cursor.isra.11’: > nir/nir_control_flow.c:460:15: warning: ‘after’ may be used uninitialized in > this function [-Wmaybe-uninitialized] >*_a

Re: [Mesa-dev] Unused (?) duplicated GLSL IR state in NIR

2015-11-02 Thread Connor Abbott
On Mon, Nov 2, 2015 at 8:35 AM, Emil Velikov wrote: > Hi all, > > From a quick look, it seems that NIR copies (almost ?) all the state > from GLSL IR even if it doesn't use it. > > The particular piece that I'm thinking about is nir_variable::data. > Afaict this is a remnant from the early days, w

Re: [Mesa-dev] Unused (?) duplicated GLSL IR state in NIR

2015-11-03 Thread Connor Abbott
On Tue, Nov 3, 2015 at 5:08 AM, Emil Velikov wrote: > On 2 November 2015 at 19:41, Jason Ekstrand wrote: >> On Mon, Nov 2, 2015 at 9:33 AM, Connor Abbott wrote: >>> On Mon, Nov 2, 2015 at 8:35 AM, Emil Velikov >>> wrote: >>>> Hi all, >>>&g

[Mesa-dev] The i965 vec4 backend, exec_masks, and 64-bit types

2015-11-03 Thread Connor Abbott
Hi all, While working on FP64 for i965, there's an issue that I thought of with the vec4 backend that I'm not sure how to resolve. From what I understand, the execmask works the same way in Align16 mode as Align1 mode, except that you only use the first 8 channels in practice for SIMD4x2, and the

Re: [Mesa-dev] [PATCH] i965/fs: Use regs_read/written for post-RA scheduling in calculate_deps

2015-11-06 Thread Connor Abbott
Reviewed-by: Connor Abbott On Fri, Nov 6, 2015 at 1:59 PM, Jason Ekstrand wrote: > Previously, we were assuming that everything read/wrote exactly 1 logical > GRF (1 in SIMD8 and 2 in SIMD16). This isn't actually true. In > particular, the PLN instruction reads 2 logical regis

Re: [Mesa-dev] [PATCH 0/2] A couple of patches to fix the build

2015-11-07 Thread Connor Abbott
Both are r-b me, go ahead and push them. On Sat, Nov 7, 2015 at 3:03 PM, Jason Ekstrand wrote: > These are pretty trivial fixes. I pushed a patch that I'd pulled of > another branch and forgot I had these in it. > > Jason Ekstrand (2): > nir/types: Add an is_vector_or_scalar helper > nir: Ad

Re: [Mesa-dev] The i965 vec4 backend, exec_masks, and 64-bit types

2015-11-08 Thread Connor Abbott
On Tue, Nov 3, 2015 at 8:04 PM, Francisco Jerez wrote: > Francisco Jerez writes: > >> Connor Abbott writes: >> >>> Hi all, >>> >>> While working on FP64 for i965, there's an issue that I thought of >>> with the vec4 backend that I

Re: [Mesa-dev] nir/i965: Source modifiers on vecN opcodes

2015-11-09 Thread Connor Abbott
On Mon, Nov 9, 2015 at 6:55 AM, Iago Toral wrote: > Hi, > > Currently, NIR defines vecN operations as unsigned (integer). The fp64 > patches from Connor change this to float (I guess because we need to > know the case where we are packing vectors of 64-bit floats). However, > this makes it so that

Re: [Mesa-dev] nir/i965: Source modifiers on vecN opcodes

2015-11-09 Thread Connor Abbott
On Mon, Nov 9, 2015 at 10:41 AM, Jason Ekstrand wrote: > > On Nov 9, 2015 7:24 AM, "Connor Abbott" wrote: >> >> On Mon, Nov 9, 2015 at 6:55 AM, Iago Toral wrote: >> > Hi, >> > >> > Currently, NIR defines vecN operations as unsigned (int

Re: [Mesa-dev] [RFCv2 06/13] mesa/st: add support for NIR as possible driver IR

2015-11-10 Thread Connor Abbott
On Sun, Nov 8, 2015 at 3:12 PM, Rob Clark wrote: > --- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 410 > - > src/mesa/state_tracker/st_glsl_to_tgsi.h | 5 + > src/mesa/state_tracker/st_program.c| 118 +++-- > src/mesa/state_tracker/st_program.h

Re: [Mesa-dev] [PATCH] nir/validate: Allow subroutine types for the tails of derefs

2015-11-10 Thread Connor Abbott
Since subroutine types are really just integers, should we just make glsl_type_is_vector_or_scalar() return true for them? On Tue, Nov 10, 2015 at 5:18 PM, Jason Ekstrand wrote: > The shader-subroutine code creates uniforms of type SUBROUTINE for > subroutines that are then read as integers in th

Re: [Mesa-dev] [PATCH] nir: fix typo in idiv lowering, causing large-udiv-udiv failures

2015-11-10 Thread Connor Abbott
On Tue, Nov 10, 2015 at 7:02 PM, Ilia Mirkin wrote: > On Tue, Nov 10, 2015 at 6:44 PM, Eric Anholt wrote: >> Ilia Mirkin writes: >> >>> In nv50, and in the python script that Rob circulated, we do: >>> >>>bld.mkCmp(OP_SET, CC_GE, TYPE_U32, (s = bld.getSSA()), TYPE_U32, m, b); >>> >>> Do the

Re: [Mesa-dev] [PATCH] nir/validate: Allow subroutine types for the tails of derefs

2015-11-10 Thread Connor Abbott
On Tue, Nov 10, 2015 at 7:49 PM, Jason Ekstrand wrote: > On Tue, Nov 10, 2015 at 4:18 PM, Connor Abbott wrote: >> Since subroutine types are really just integers, should we just make >> glsl_type_is_vector_or_scalar() return true for them? > > That's an interesting ques

Re: [Mesa-dev] [PATCH] nir/vars_to_ssa: Rework copy set handling in lower_copies_to_load_store

2015-11-12 Thread Connor Abbott
Reviewed-by: Connor Abbott On Thu, Nov 12, 2015 at 10:02 PM, Jason Ekstrand wrote: > Previously, we walked through a given deref_node's copies and, after > lowering the copy away, removed it from both the source and destination > copy sets. This commit changes this to only remo

Re: [Mesa-dev] [PATCH] nir/validate: Allow subroutine types for the tails of derefs

2015-11-12 Thread Connor Abbott
On Thu, Nov 12, 2015 at 9:36 PM, Jason Ekstrand wrote: > bump! Where are we at on this? Go ahead and push it with my r-b. I still think glsl_type::is_vector_or_scalar() should return true for subroutine types, but that might require some more fixing and testing. > > On Tue, Nov 10, 2015 at 6:16

Re: [Mesa-dev] [PATCH] nir/vars_to_ssa: Delete dead output set code

2015-11-12 Thread Connor Abbott
Reviewed-by: Connor Abbott On Fri, Nov 13, 2015 at 12:53 AM, Jason Ekstrand wrote: > This was a remnant of an early attempt to handle output reads in > vars_to_ssa. That attempt was abandon a long time ago but these few lines > were aparently left in the pass and managed to eva

Re: [Mesa-dev] [Nouveau] llvm TGSI backend (WIP) questions

2015-11-13 Thread Connor Abbott
On Fri, Nov 13, 2015 at 9:38 AM, Ilia Mirkin wrote: > On Fri, Nov 13, 2015 at 9:25 AM, Emil Velikov > wrote: >> Hello Hans, >> >> Not to muddy the waters or anything, have you thought about the NIR >> integration that Rob was thinking about ? >> I'm pretty sure he'll be happy to have extra peopl

Re: [Mesa-dev] [PATCH 02/11] nir: add array length field

2015-11-14 Thread Connor Abbott
I think it would be better if we kept track of the type of the constant instead. That would also allow us to simplify the constant construction code in, err, something else... On Wed, Nov 11, 2015 at 8:23 PM, Jason Ekstrand wrote: > From: Rob Clark > > This will simplify things somewhat in clone

Re: [Mesa-dev] [PATCH 02/11] nir: add array length field

2015-11-14 Thread Connor Abbott
On Sat, Nov 14, 2015 at 11:55 AM, Jason Ekstrand wrote: > On Sat, Nov 14, 2015 at 8:19 AM, Connor Abbott wrote: >> I think it would be better if we kept track of the type of the >> constant instead. That would also allow us to simplify the constant >> construction code in

Re: [Mesa-dev] [PATCH 02/11] nir: add array length field

2015-11-14 Thread Connor Abbott
suppose, but for now this makes clone possible. glsl_get_array_length() will do the right thing for everything except matrices and vectors/scalars, so it should be possible to get the number of elements in only a few lines. > > BR, > -R > > On Sat, Nov 14, 2015 at 11:19 AM, Connor A

Re: [Mesa-dev] [PATCH] nir/glsl: Fix copy-n-paste mistakes from commit 213f864.

2015-11-14 Thread Connor Abbott
Whoops. Reviewed-by: Connor Abbott On Sat, Nov 14, 2015 at 8:49 PM, Matt Turner wrote: > --- > src/glsl/nir/glsl_to_nir.cpp | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp > inde

Re: [Mesa-dev] [PATCH 0/6] i965: Do textures swizzle work-arounds in NIR.

2015-11-14 Thread Connor Abbott
Series is Reviewed-by: Connor Abbott Although I'm not as familiar now with the code touched in the last patch. On Thu, Nov 12, 2015 at 3:13 PM, Jason Ekstrand wrote: > The subject says it all. This little series adds texture swizzle support > to nir_lower_tex and makes the i965

[Mesa-dev] [PATCH 2/5] util/hash_table: don't compare deleted entries

2015-11-14 Thread Connor Abbott
The equivalent of the last patch for the hash table. I'm not aware of any issues this fixes. Signed-off-by: Connor Abbott --- src/util/hash_table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/hash_table.c b/src/util/hash_table.c index 3247593..466519f 1

Re: [Mesa-dev] [PATCH] nir: Make vec-to-movs handle src/dest aliasing.

2015-01-22 Thread Connor Abbott
What happens if you have something like foo = vec3(foo.z, bar.x, foo.x)? I don't think emitting vector mov's for only the contiguous components is enough. On Thu, Jan 22, 2015 at 4:51 PM, Eric Anholt wrote: > It now emits vector MOVs instead of a series of individual MOVs, which > should be usefu

Re: [Mesa-dev] [PATCH] nir: Make vec-to-movs handle src/dest aliasing.

2015-01-22 Thread Connor Abbott
Argh, nevermind, I was reading it wrong... On Thu, Jan 22, 2015 at 8:18 PM, Connor Abbott wrote: > What happens if you have something like foo = vec3(foo.z, bar.x, > foo.x)? I don't think emitting vector mov's for only the contiguous > components is enough. > > On Thu

Re: [Mesa-dev] [PATCH 3/5] nir: Fix setup of constant bool initializers.

2015-01-22 Thread Connor Abbott
On Wed, Jan 21, 2015 at 11:03 PM, Jason Ekstrand wrote: > Connor wrote *exactly* the same patch: > > http://lists.freedesktop.org/archives/mesa-dev/2015-January/074522.html > > This version can have my R-B too. And, fwiw, I like your commit message > better. Indeed... let's push this version, si

[Mesa-dev] [PATCH v2 5/5] nir/opt_algebraic: be more careful about constant types

2015-01-22 Thread Connor Abbott
We can do this now that we have opcode info available in Python. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_algebraic.py | 38 ++ src/glsl/nir/nir_opt_algebraic.py | 6 ++ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src

[Mesa-dev] [PATCH v2 4/5] nir/constant_folding: use the new constant folding infrastructure

2015-01-22 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_constant_folding.c | 179 1 file changed, 21 insertions(+), 158 deletions(-) diff --git a/src/glsl/nir/nir_opt_constant_folding.c b/src/glsl/nir/nir_opt_constant_folding.c index 878436b..e8a361f 100644 --- a

[Mesa-dev] [PATCH v2 1/5] nir: add generated file to .gitignore

2015-01-22 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/glsl/nir/.gitignore diff --git a/src/glsl/nir/.gitignore b/src/glsl/nir/.gitignore new file mode 100644 index 000..6d954fe --- /dev/null +++ b/src/glsl/nir/.gitignore

[Mesa-dev] [PATCH v2 3/5] nir: add new constant folding infrastructure

2015-01-22 Thread Connor Abbott
taken from ir_constant_expressions.cpp. v2: use Python formatting and get rid of regex's v2.5: - fixup Makefile changes - remove unused global wr(), rename wr() to wrap() (Jason) - remove optional arguments in wr() and a few functions in unop_reduce() and binop_reduce() that were unnecessary Signed-off-by

[Mesa-dev] [PATCH v2 2/5] nir: use Python to autogenerate opcode information

2015-01-22 Thread Connor Abbott
rom object (Dylan) - don't use assert like it's a function (Dylan) - style fixes for fnoise, use xrange (Dylan) - use iterkeys() in nir_opcodes_h.py (Dylan) - use pydoc-style comments (Jason) - don't make fmin/fmax commutative and associative yet (Jason) Signed-off-by: Con

[Mesa-dev] [PATCH v2 0/5] NIR opcodes and constant folding

2015-01-22 Thread Connor Abbott
r-opcodes-cleanup-v2 Connor Abbott (5): nir: add generated file to .gitignore nir: use Python to autogenerate opcode information nir: add new constant folding infrastructure nir/constant_folding: use the new constant folding infrastructure nir/opt_algebraic: be more careful about const

Re: [Mesa-dev] [PATCH v2 2/5] nir: use Python to autogenerate opcode information

2015-01-23 Thread Connor Abbott
On Fri, Jan 23, 2015 at 1:07 PM, Jason Ekstrand wrote: > > > On Thu, Jan 22, 2015 at 8:32 PM, Connor Abbott wrote: >> >> Before, we used a system where a file, nir_opcodes.h, defined some macros >> that >> were included to generate the enum values and th

Re: [Mesa-dev] [PATCH 2/4] nir: add new constant folding infrastructure

2015-01-23 Thread Connor Abbott
> diff --git a/src/glsl/nir/.gitignore b/src/glsl/nir/.gitignore > index 4c28193..261f64f 100644 > --- a/src/glsl/nir/.gitignore > +++ b/src/glsl/nir/.gitignore > @@ -1,3 +1,4 @@ > nir_opt_algebraic.c > nir_opcodes.c > nir_opcodes.h > +nir_constant_expressions.c > diff -

Re: [Mesa-dev] [PATCH] nir: Make vec-to-movs handle src/dest aliasing.

2015-01-23 Thread Connor Abbott
On Fri, Jan 23, 2015 at 5:34 PM, Eric Anholt wrote: > Connor Abbott writes: > >> Argh, nevermind, I was reading it wrong... >> >> On Thu, Jan 22, 2015 at 8:18 PM, Connor Abbott wrote: >>> What happens if you have something like foo = vec3(foo.z, bar.x, >>

Re: [Mesa-dev] [PATCH v4 2/4] nir: add new constant folding infrastructure

2015-01-23 Thread Connor Abbott
Other than the one comment fix below, Reviewed-by: Connor Abbott On Fri, Jan 23, 2015 at 7:17 PM, Jason Ekstrand wrote: > Add a required field to the Opcode class, const_expr, that contains an > expression or statement that computes the result of the opcode given known > constant inp

Re: [Mesa-dev] [PATCH v2 1/3] nir: Add a pass to lower vector phi nodes to scalar phi nodes

2015-01-24 Thread Connor Abbott
On Sat, Jan 24, 2015 at 1:00 AM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 2 + > src/glsl/nir/nir_lower_phis_to_scalar.c | 238 > > 3 files changed, 241 insertions(+) > create mo

Re: [Mesa-dev] [PATCH v2 1/3] nir: Add a pass to lower vector phi nodes to scalar phi nodes

2015-01-24 Thread Connor Abbott
On Sat, Jan 24, 2015 at 12:22 PM, Jason Ekstrand wrote: > > On Jan 24, 2015 8:18 AM, "Connor Abbott" wrote: >> >> On Sat, Jan 24, 2015 at 1:00 AM, Jason Ekstrand >> wrote: >> > --- >> > src/glsl/Makefile.sources | 1 +

[Mesa-dev] [PATCH 1/2] nir: add a helper function for getting the number of source components

2015-01-25 Thread Connor Abbott
r per-component instructions to say how many source components are being used. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 0ef83a1..efcaa9d 100644 --- a/src/glsl/nir/nir.h +++

[Mesa-dev] [PATCH 2/2] nir: fix a bug with constant folding non-per-component instructions

2015-01-25 Thread Connor Abbott
the last patch. Signed-off-by: Connor Abbott --- Whoops, sorry I missed this during review... src/glsl/nir/nir_opt_constant_folding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_opt_constant_folding.c b/src/glsl/nir/nir_opt_constant_folding.c index

Re: [Mesa-dev] [PATCH 2/2] nir/opcodes: Don't go through doubles when constant-folding iabs

2015-01-26 Thread Connor Abbott
Reviewed-by: Connor Abbott On Mon, Jan 26, 2015 at 12:43 PM, Jason Ekstrand wrote: > Previously, we called the abs() function in math.h. However, this involves > unnecessarily going through double. This commit changes it to use integers > directly with a ternary. > --- >

Re: [Mesa-dev] [PATCH 1/2] nir/opcodes: Simplify and fix the unpack_half_*_split_* constant expressions

2015-01-26 Thread Connor Abbott
Indeed, I guess I misunderstood the purpose of this opcode when I was writing the constant expression. I see now that it's supposed to be used for scalarizing unpack_half_2x16. Goes to show how useful this self-documenting stuff is, I guess. Reviewed-by: Connor Abbott On Mon, Jan 26, 2015

Re: [Mesa-dev] [PATCH] nir: Use pointers for nir_src_copy and nir_dest_copy

2015-01-26 Thread Connor Abbott
Reviewed-by: Connor Abbott On Fri, Jan 23, 2015 at 7:59 PM, Jason Ekstrand wrote: > This avoids the overhead of copying structures and better matches the newly > added nir_alu_src_copy and nir_alu_dest_copy. > --- > > This should be obvious, but this applies on top of Eric An

Re: [Mesa-dev] [PATCH v2 1/3] nir: Add a pass to lower vector phi nodes to scalar phi nodes

2015-01-26 Thread Connor Abbott
On Mon, Jan 26, 2015 at 2:21 PM, Eric Anholt wrote: > I just notied: When do I need to all nir_metadata_preserve()? I didn't > in my pass. It dirties all the metadata (topologically-sorted block indices, dominance info, liveness info, etc.) except the stuff you tell it to preserve via the flags.

Re: [Mesa-dev] [PATCH] nir: Make vec-to-movs handle src/dest aliasing.

2015-01-26 Thread Connor Abbott
On Mon, Jan 26, 2015 at 2:31 PM, Eric Anholt wrote: > Connor Abbott writes: > >> On Fri, Jan 23, 2015 at 5:34 PM, Eric Anholt wrote: >>> Connor Abbott writes: >>> >>>> Argh, nevermind, I was reading it wrong... >>>> >>>> On Thu,

Re: [Mesa-dev] [PATCH 1/2] nir: add a helper function for getting the number of source components

2015-01-26 Thread Connor Abbott
On Sun, Jan 25, 2015 at 7:51 PM, Jason Ekstrand wrote: > > > On Sun, Jan 25, 2015 at 8:56 AM, Connor Abbott wrote: >> >> Unlike with non-SSA ALU instructions, where if they're per-component >> you have to look at the writemask to know which source channels are >

Re: [Mesa-dev] [PATCH 3/3] nir/opcodes: Use a return type of tfloat for ldexp

2015-01-28 Thread Connor Abbott
The rest of the series seems reasonable although I'm not an expert, but this one is definitely Reviewed-by: Connor Abbott On Wed, Jan 28, 2015 at 3:46 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_opcodes.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > &

Re: [Mesa-dev] [PATCH 3/3] nir: Add an ALU op builder kind of like ir_builder.h

2015-01-28 Thread Connor Abbott
Hi Eric, A general suggestion: I think that we should rename these functions to "nir_op_create()" so that we can make a more specific "nir_op()" function that takes and returns a nir_ssa_def *, so that we can do stuff like: nir_builder *b = ... nir_ssa_def *new_index = nir_iadd(b, nir_imul(b, o

Re: [Mesa-dev] [PATCH] nir: Add an ALU op builder kind of like ir_builder.h

2015-01-30 Thread Connor Abbott
I mentioned this on IRC, but it would be good to add the ability to append the sequence of instructions before/after an instruction as well as at the beginning or end of a basic block. We would need to store the current basic block, the current instruction, and an enum consisting of "insert before

Re: [Mesa-dev] [PATCH 5/9] nir: Add a flag for lowering fneg/ineg.

2015-02-01 Thread Connor Abbott
I think this logic should be flipped around... you should have a flag 'lower_sub' which is false for vc4 but true for i965, and then if the flag is true we lower sub to add+neg and if false we try and reconstruct sub (and do other things like pulling neg's out of multiplies). That way, eventually w

Re: [Mesa-dev] [PATCH 7/9] nir: Fix broken fsat recognizer.

2015-02-01 Thread Connor Abbott
rate have to do this already. Rather, what probably saves us is that we already recognize this pattern in GLSL IR. Other than that, Reviewed-by: Connor Abbott > --- > src/glsl/nir/nir_opt_algebraic.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/

Re: [Mesa-dev] [PATCH 7/9] nir: Fix broken fsat recognizer.

2015-02-01 Thread Connor Abbott
On Sun, Feb 1, 2015 at 6:54 PM, Eric Anholt wrote: > Connor Abbott writes: > >> On Sun, Feb 1, 2015 at 4:17 PM, Eric Anholt wrote: >>> We've probably never seen this ridiculous pattern in the wild, so it >>> didn't matter. >> >> I don't

Re: [Mesa-dev] [PATCH 2/9] nir: Conditionalize the POW reconstruction on shader compiler options.

2015-02-02 Thread Connor Abbott
A few comments here... 1. We should really split this up into a patch that adds nir_shader_compiler_options (which would be empty at this point) and the nir_algebraic infrastructure for conditionalizing transforms (actually, maybe we should split these up into two patches) and a patch which adds l

[Mesa-dev] [PATCH 1/2] nir: add an optimization to remove useless phi nodes

2015-02-02 Thread Connor Abbott
This removes phi nodes whose sources all point to the same thing. Only compile tested. Signed-off-by: Connor Abbott --- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_opt_remove_phis.c | 111 + 3

[Mesa-dev] [PATCH 2/2] i965/nir: use redundant phi optimization

2015-02-02 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index de0d780..4305e14 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b

Re: [Mesa-dev] [PATCH 1/2] nir: add an optimization to remove useless phi nodes

2015-02-02 Thread Connor Abbott
On Tue, Feb 3, 2015 at 1:54 AM, Connor Abbott wrote: > This removes phi nodes whose sources all point to the same thing. > > Only compile tested. > > Signed-off-by: Connor Abbott > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h

Re: [Mesa-dev] [PATCH] nir/validate: Ensure that phi sources are SSA-only

2015-02-03 Thread Connor Abbott
On Tue, Feb 3, 2015 at 1:49 PM, Jason Ekstrand wrote: > For whatever reason, I thought we might have non-ssa phi sources. However, > I looked again and I don't think it's possible. Also, this patch applies > with no piglit regressions. Yeah, the only reason I made it so that phi instructions co

Re: [Mesa-dev] [PATCH] i965/fs: Fix saturate for nir_opcode_bcsel.

2015-02-03 Thread Connor Abbott
On Tue, Feb 3, 2015 at 3:27 PM, Kenneth Graunke wrote: > On Tuesday, February 03, 2015 07:10:20 AM you wrote: >> On Feb 3, 2015 2:35 AM, "Kenneth Graunke" wrote: >> > Caught by lit_sat.shader_test. >> > >> > Signed-off-by: Kenneth Graunke >> > --- >> > src/mesa/drivers/dri/i965/brw_fs_nir.cpp |

Re: [Mesa-dev] [PATCH 1/2] nir/lower_source_mods: Don't lower saturate for non-float outputs

2015-02-03 Thread Connor Abbott
Reviewed-by: Connor Abbott On Tue, Feb 3, 2015 at 3:43 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_lower_to_source_mods.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/glsl/nir/nir_lower_to_source_mods.c > b/src/glsl/nir/nir_lower_to_source_mods

Re: [Mesa-dev] [PATCH 2/2] nir/validate: Validate that only float ALU outputs are saturated

2015-02-03 Thread Connor Abbott
Reviewed-by: Connor Abbott Funny, I thought we already did this... whoops. On Tue, Feb 3, 2015 at 3:43 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_validate.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir

Re: [Mesa-dev] [PATCH 5/9] nir: Add a flag for lowering fneg/ineg.

2015-02-03 Thread Connor Abbott
On Tue, Feb 3, 2015 at 5:20 PM, Eric Anholt wrote: > Connor Abbott writes: > >> I think this logic should be flipped around... you should have a flag >> 'lower_sub' which is false for vc4 but true for i965, and then if the >> flag is true we lower sub

Re: [Mesa-dev] [PATCH 02/10] nir: Properly clean up CF nodes when we remove them

2015-02-05 Thread Connor Abbott
While we're cleaning this up, we should go a little farther - we should also see if anything is using the SSA result of any of these instructions, and if so make it point to an undef_instr instead to avoid dangling pointers. This doesn't come up yet but it will when we start cleaning up constant co

Re: [Mesa-dev] [PATCH 01/10] nir: use nir_foreach_ssa_def for indexing ssa defs

2015-02-05 Thread Connor Abbott
Reviewed-by: Connor Abbott On Thu, Feb 5, 2015 at 5:28 PM, Jason Ekstrand wrote: > This is both simpler and more correct. The old code didn't properly index > load_const instructions. > --- > src/glsl/nir/nir.c | 26 -- > 1 file changed, 4 inserti

Re: [Mesa-dev] [PATCH 04/10] nir/validate: Validate SSA defs the same way we do for registers

2015-02-05 Thread Connor Abbott
Other than one small comment below, 3 and 4 are Reviewed-by: Connor Abbott On Thu, Feb 5, 2015 at 5:28 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_validate.c | 87 > - > 1 file changed, 79 insertions(+), 8 deletions(-) > >

Re: [Mesa-dev] [PATCH 05/10] nir/from_ssa: Don't try to read an invalid instruction

2015-02-05 Thread Connor Abbott
Could use a comment here explaining that nir_instr_prev() may return NULL above if the only instruction in the block is a jump instruction. On Thu, Feb 5, 2015 at 5:29 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_from_ssa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff -

Re: [Mesa-dev] [PATCH 06/10] nir: Make nir_[cf_node/instr]_[prev/next] return null if at the end

2015-02-05 Thread Connor Abbott
This should go before the previous patch, or else that patch won't work as intended, and also it confused me a little by using a behavior (the returning NULL) before introducing it. On Thu, Feb 5, 2015 at 5:29 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.h | 28 ++--

Re: [Mesa-dev] [PATCH 07/10] nir/dominance: Also record the dominance depth

2015-02-05 Thread Connor Abbott
Reviewed-by: Connor Abbott On Thu, Feb 5, 2015 at 5:29 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.h | 3 +++ > src/glsl/nir/nir_dominance.c | 9 - > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/src/glsl/nir/nir.h b/src/glsl

Re: [Mesa-dev] [PATCH 09/10] nir: Add a global code motion (GCM) pass

2015-02-05 Thread Connor Abbott
On Thu, Feb 5, 2015 at 5:29 PM, Jason Ekstrand wrote: > --- > src/glsl/Makefile.sources | 1 + > src/glsl/nir/nir.h | 2 + > src/glsl/nir/nir_opt_gcm.c | 499 > + > 3 files changed, 502 insertions(+) > create mode 100644 src/glsl/nir/nir_

Re: [Mesa-dev] [PATCH 10/10] i965/nir: Use Global Code Motion

2015-02-05 Thread Connor Abbott
Maybe we should run this after DCE so that we don't do unnecessary work by scheduling stuff that we then delete. On Thu, Feb 5, 2015 at 5:29 PM, Jason Ekstrand wrote: > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/mesa/drivers/dri/

Re: [Mesa-dev] [PATCH 08/10] nir: Add an instruction index

2015-02-05 Thread Connor Abbott
On the one hand, this really should use the metadata framework since it is metadata. On the other hand, this would get invalidated *all the time* so it doesn't seem so useful to have a dirty flag for it. Maybe add a comment explaining this? Other than that, Connor Abbott On Thu, Feb 5, 20

Re: [Mesa-dev] [PATCH 09/10] nir: Add a global code motion (GCM) pass

2015-02-05 Thread Connor Abbott
On Thu, Feb 5, 2015 at 9:33 PM, Jason Ekstrand wrote: > > On Feb 5, 2015 5:07 PM, "Connor Abbott" wrote: >> >> On Thu, Feb 5, 2015 at 5:29 PM, Jason Ekstrand >> wrote: >> > --- >> > src/glsl/Makefile.sources | 1 + >> > src/gl

Re: [Mesa-dev] [PATCH 01/32] i965: Factor out virtual GRF allocation to a separate object.

2015-02-06 Thread Connor Abbott
On Fri, Feb 6, 2015 at 9:42 AM, Francisco Jerez wrote: > Right now virtual GRF book-keeping and allocation is performed in each > visitor class separately (among other hundred different things), > leading to duplicated logic in each visitor and preventing layering as > it forces any code that mani

Re: [Mesa-dev] [PATCH 1/3] nir/dominance: Simplify and expose the dominance intersection function

2015-02-06 Thread Connor Abbott
I'd rather keep it the way it was, since that's how it's presented as pseudocode in the paper and someone reading this is more likely to be confused by a function with the exact same name as in the paper but a different implementation. On Fri, Feb 6, 2015 at 5:12 PM, Jason Ekstrand wrote: > Befor

Re: [Mesa-dev] [PATCH 2/3] nir/dominance: Add a constant-time mechanism for comparing blocks

2015-02-06 Thread Connor Abbott
; + return child->dom_pre_index >= parent->dom_pre_index && > + child->dom_pre_index <= parent->dom_post_index; It doesn't matter too much, but I think doing child->dom_post_index <= parent->dom_post_index will make it less likely fo

Re: [Mesa-dev] [PATCH 3/3] nir/from_ssa: Use the nir_block_dominance function instead of our own

2015-02-06 Thread Connor Abbott
Reviewed-by: Connor Abbott On Fri, Feb 6, 2015 at 5:12 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_from_ssa.c | 9 ++--- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/src/glsl/nir/nir_from_ssa.c b/src/glsl/nir/nir_from_ssa.c > index 2e7ad

Re: [Mesa-dev] [PATCH 2/3] nir/dominance: Add a constant-time mechanism for comparing blocks

2015-02-06 Thread Connor Abbott
On Fri, Feb 6, 2015 at 7:22 PM, Jason Ekstrand wrote: > > > On Fri, Feb 6, 2015 at 5:38 PM, Connor Abbott wrote: >> >> On Fri, Feb 6, 2015 at 5:12 PM, Jason Ekstrand >> wrote: >> > This is mostly thanks to Connor. The idea is to do a depth-first search >

Re: [Mesa-dev] [PATCH] nir: Add an ALU op builder kind of like ir_builder.h

2015-02-06 Thread Connor Abbott
Hi Eric, Sorry for not responding to this in a while. I'm replying to this comment instead of the new version because it has the relevant discussion. On Mon, Feb 2, 2015 at 7:30 PM, Eric Anholt wrote: > Connor Abbott writes: > >> I mentioned this on IRC, but it would be good t

Re: [Mesa-dev] [PATCH 3/3] nir: Add algebraic optimizations for comparisons with identical operands.

2015-02-06 Thread Connor Abbott
Reviewed-by: Connor Abbott On Sat, Feb 7, 2015 at 12:16 AM, Eric Anholt wrote: > No change on shader-db on i965. > --- > src/glsl/nir/nir_opt_algebraic.py | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/src/glsl/nir/nir_opt_algebraic.py > b/src/glsl/nir

Re: [Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-06 Thread Connor Abbott
On Sat, Feb 7, 2015 at 12:16 AM, Eric Anholt wrote: > NIR instruction count results on i965: > total instructions in shared programs: 1261954 -> 1261937 (-0.00%) > instructions in affected programs: 455 -> 438 (-3.74%) > > One in yofrankie, two in tropics. Apparently i965 had also optimized a

Re: [Mesa-dev] [PATCH 2/3] nir: Fix load_const comparisons for CSE.

2015-02-06 Thread Connor Abbott
Maybe value.f[0] since it's an array and not a pointer? Other than that, Reviewed-by: Connor Abbott On Sat, Feb 7, 2015 at 12:16 AM, Eric Anholt wrote: > We want the size of a float per component, not the size of a whole vec4. > > NIR instructions on i965: > total instr

[Mesa-dev] [PATCH 0/3] NIR constant reassociation

2015-02-07 Thread Connor Abbott
tests. Note that for pigliting it might be wise to turn off opt_algebraic since in some cases (but not all) it will do the same optimization so we don't get a chance to exercise the code. This series is also available at git://people.freedesktop.org/~cwabbott0/mesa nir-reassociate-consts Connor

[Mesa-dev] [PATCH 2/3] nir/search: constant fold as we're building expressions

2015-02-07 Thread Connor Abbott
expression tree. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_search.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c index 79cfdba..af41578 100644 --- a/src/glsl/nir/nir_search.c

[Mesa-dev] [PATCH 1/3] nir/search: add support for opcode variables

2015-02-07 Thread Connor Abbott
nd @ which we already use, suggestions welcome...) or '!name@property1,property2'. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_algebraic.py | 68 +-- src/glsl/nir/nir_search.c | 40 + src/glsl/nir/n

[Mesa-dev] [PATCH 3/3] nir/opt_algebraic: add constant reassociation rules

2015-02-07 Thread Connor Abbott
ll have to think carefully to make sure they don't fight. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_algebraic.py | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py index a5fe19a..f4466b4 100644 ---

Re: [Mesa-dev] glsl: Making logical operations per-component?

2015-02-08 Thread Connor Abbott
Yeah, I find it really surprising that GLSL doesn't have per-compoent and or, and xor, given that it already has per-component not. I didn't even realize this was the case until I just looked at the spec. At the very least, we can relax the restriction as long as st/glsl_to_tgsi will work. NIR shou

Re: [Mesa-dev] [PATCH v2 11/12] nir: Add a global code motion (GCM) pass

2015-02-09 Thread Connor Abbott
So last time you posted this, I had some suggestions but I realized that in light of the fact that we want to do value numbering, it didn't seem like my suggestions were any good. But now that I've thought about it a little bit, it seems to me like a better plan might be to pull instructions out of

Re: [Mesa-dev] [PATCH v2 11/12] nir: Add a global code motion (GCM) pass

2015-02-09 Thread Connor Abbott
On Mon, Feb 9, 2015 at 5:04 PM, Jason Ekstrand wrote: > > > On Mon, Feb 9, 2015 at 3:01 PM, Connor Abbott wrote: >> >> So last time you posted this, I had some suggestions but I realized >> that in light of the fact that we want to do value numbering, it >> did

Re: [Mesa-dev] [PATCH v2 11/12] nir: Add a global code motion (GCM) pass

2015-02-09 Thread Connor Abbott
On Mon, Feb 9, 2015 at 6:11 PM, Jason Ekstrand wrote: > > > On Mon, Feb 9, 2015 at 12:01 PM, Connor Abbott wrote: >> >> So last time you posted this, I had some suggestions but I realized >> that in light of the fact that we want to do value numbering, it >> did

Re: [Mesa-dev] [PATCH 02/10] nir: Properly clean up CF nodes when we remove them

2015-02-09 Thread Connor Abbott
For some reason, the v2 version of this disappeared from my inbox, so I'll say Reviewed-by: Connor Abbott I'm not convinced this is enough for when we optimize constant if-statement conditions, but I'll leave that be for now. On Thu, Feb 5, 2015 at 5:28 PM, Jason Ekstrand wrot

Re: [Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-10 Thread Connor Abbott
On Tue, Feb 10, 2015 at 1:32 PM, Eric Anholt wrote: > Connor Abbott writes: > >> On Sat, Feb 7, 2015 at 12:16 AM, Eric Anholt wrote: >>> NIR instruction count results on i965: >>> total instructions in shared programs: 1261954 -> 1261937 (-0.00%) >>>

Re: [Mesa-dev] [PATCH 2/4] nir: add missing header to the sources list

2015-02-10 Thread Connor Abbott
Reviewed-by: Connor Abbott On Tue, Feb 10, 2015 at 11:08 AM, Emil Velikov wrote: > Cc: "10.5" > Signed-off-by: Emil Velikov > --- > src/glsl/Makefile.sources | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/glsl/Makefile.sources b/src/glsl/M

Re: [Mesa-dev] [PATCH 2/3] nir: Replace assert(0) with unreachable().

2015-02-10 Thread Connor Abbott
Reviewed-by: Connor Abbott On Tue, Feb 10, 2015 at 2:24 PM, Matt Turner wrote: > --- > src/glsl/nir/glsl_to_nir.cpp | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp > inde

Re: [Mesa-dev] [PATCH 3/3] nir: Remove casts from void*.

2015-02-10 Thread Connor Abbott
Reviewed-by: Connor Abbott On Tue, Feb 10, 2015 at 2:24 PM, Matt Turner wrote: > --- > src/glsl/nir/nir.c | 16 > src/glsl/nir/nir_dominance.c | 6 +++--- > src/glsl/nir/nir_lower_atomics.c | 3 +-- >

Re: [Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-11 Thread Connor Abbott
On Wed, Feb 11, 2015 at 2:36 PM, Eric Anholt wrote: > Connor Abbott writes: > >> On Tue, Feb 10, 2015 at 1:32 PM, Eric Anholt wrote: >>> Connor Abbott writes: >>> >>>> On Sat, Feb 7, 2015 at 12:16 AM, Eric Anholt wrote: >>>>> NIR instr

Re: [Mesa-dev] [PATCH 1/3] nir: Add support for CSE on textures.

2015-02-11 Thread Connor Abbott
On Wed, Feb 11, 2015 at 3:17 PM, Eric Anholt wrote: > Connor Abbott writes: > >> On Wed, Feb 11, 2015 at 2:36 PM, Eric Anholt wrote: >>> Connor Abbott writes: >>> >>>> On Tue, Feb 10, 2015 at 1:32 PM, Eric Anholt wrote: >>>>> Connor Abb

Re: [Mesa-dev] [PATCH v3 01/12] nir/dominance: Expose the dominance intersection function

2015-02-11 Thread Connor Abbott
Reviewed-by: Connor Abbott On Mon, Feb 9, 2015 at 11:24 PM, Jason Ekstrand wrote: > Being able to find the least common anscestor in the dominance tree is a > useful thing that we may want to do in other passes. In particular, we > need it for GCM. > > v2: Handle NULL inputs b

Re: [Mesa-dev] [PATCH 7/7] mesa: Drop dependency on mtypes.h for core NIR.

2015-02-11 Thread Connor Abbott
Given that this commit only changes NIR code, I think it should be prefixed by "nir: ", e.g. "nir: Drop dependency on mtypes.h in nir.h." Once that's done, this gets my r-b. On Wed, Feb 11, 2015 at 7:48 PM, Eric Anholt wrote: > One less new directory necessary for gallium code that wants to inter

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