Re: [Mesa-dev] [PATCH] i965: Re-index SSA definitions before printing NIR code.

2015-06-11 Thread Connor Abbott
The one thing this will hurt is that diff'ing shaders from before and after an optimization becomes harder, since just printing the shader will re-order the numbers and add spurious changes. If we want to make the result of doing INTEL_DEBUG=fs more reasonable, we could just do it at the end of the

Re: [Mesa-dev] [PATCH] i965: Re-index SSA definitions before printing NIR code.

2015-06-11 Thread Connor Abbott
On Thu, Jun 11, 2015 at 8:27 AM, Jason Ekstrand wrote: > On Thu, Jun 11, 2015 at 8:12 AM, Connor Abbott wrote: >> The one thing this will hurt is that diff'ing shaders from before and >> after an optimization becomes harder, since just printing the shader >> will re

Re: [Mesa-dev] [PATCH] nir: add helper to get # of src/dest components

2015-06-17 Thread Connor Abbott
So, as is, this patch isn't quite correct. When I originally wrote NIR, the idea was that the size of each instruction would be explicit -- that is, each instruction has it's own size, and the size of registers/SSA values was merely a hint to say "by the way, you actually need this many components

Re: [Mesa-dev] [PATCH] nir: add helper to get # of src/dest components

2015-06-17 Thread Connor Abbott
On Wed, Jun 17, 2015 at 12:02 PM, Rob Clark wrote: > On Wed, Jun 17, 2015 at 2:27 PM, Connor Abbott wrote: >> So, as is, this patch isn't quite correct. When I originally wrote >> NIR, the idea was that the size of each instruction would be explicit >> -- that is, eac

Re: [Mesa-dev] [PATCH] nir: add helper to get # of src/dest components

2015-06-18 Thread Connor Abbott
On Thu, Jun 18, 2015 at 4:48 AM, Rob Clark wrote: > On Thu, Jun 18, 2015 at 1:23 AM, Connor Abbott wrote: >> On Wed, Jun 17, 2015 at 12:02 PM, Rob Clark wrote: >>> On Wed, Jun 17, 2015 at 2:27 PM, Connor Abbott wrote: >>>> So, as is, this patch isn't qui

Re: [Mesa-dev] [PATCH] nir: add helper to get # of src/dest components

2015-06-18 Thread Connor Abbott
On Thu, Jun 18, 2015 at 9:42 AM, Rob Clark wrote: > On Thu, Jun 18, 2015 at 11:01 AM, Connor Abbott wrote: >>>>> (really I want phi's for variables too.. the way I turn arrays into >>>>> fanin/collect fanout/split works on the backend for dealing with >&

Re: [Mesa-dev] [PATCH] nir: add helper to get # of src/dest components

2015-06-18 Thread Connor Abbott
On Thu, Jun 18, 2015 at 11:19 AM, Rob Clark wrote: > On Thu, Jun 18, 2015 at 1:27 PM, Connor Abbott wrote: >> On Thu, Jun 18, 2015 at 9:42 AM, Rob Clark wrote: >>> On Thu, Jun 18, 2015 at 11:01 AM, Connor Abbott wrote: >>>>>>> (really I want phi'

Re: [Mesa-dev] [PATCH] nir: add helper to get # of src/dest components

2015-06-19 Thread Connor Abbott
On Thu, Jun 18, 2015 at 12:04 PM, Rob Clark wrote: > On Thu, Jun 18, 2015 at 2:34 PM, Connor Abbott wrote: >> On Thu, Jun 18, 2015 at 11:19 AM, Rob Clark wrote: >>> On Thu, Jun 18, 2015 at 1:27 PM, Connor Abbott wrote: >>>> On Thu, Jun 18, 2015 at 9:42 AM, Rob C

Re: [Mesa-dev] [PATCH] nir: add helper to get # of src/dest components

2015-06-19 Thread Connor Abbott
On Thu, Jun 18, 2015 at 12:04 PM, Rob Clark wrote: > It is only vaguely an issue at the moment > because the priority-queue scheduler that replaced what is on master > does very badly with wide/shallow shaders, ie. like > glsl-fs-convolution-1... ie. shaders with a lot of instructions at > minimum

Re: [Mesa-dev] [PATCH 1/2] [RFC] i965/vec4: Reward spills in if/else/endif blocks

2015-06-19 Thread Connor Abbott
I don't think this is doing what you think it's doing. This code is for calculating the *cost* of spills, so a higher cost means a lower priority for choosing the register. We increase the cost for things inside loops because we don't want to spill inside loops, and by doing the same thing for if's

Re: [Mesa-dev] [PATCH] Fix strict-aliasing violations in GLSL shader list implementation

2015-06-24 Thread Connor Abbott
On Wed, Jun 24, 2015 at 3:59 PM, Davin McCall wrote: > Hi Ian, > > On 23/06/15 23:26, Ian Romanick wrote: > > On 06/23/2015 02:36 PM, Thomas Helland wrote: > > 2015-06-24 23:05 GMT+02:00 Davin McCall : > > Hi - I'm new here. > > I've recently started poking the Mesa codebase for little reason othe

[Mesa-dev] [PATCH 1/4] nir/from_ssa: add a flag to not convert everything to SSA

2015-06-25 Thread Connor Abbott
e careful about deleting them. Signed-off-by: Connor Abbott --- src/gallium/drivers/vc4/vc4_program.c | 2 +- src/glsl/nir/nir.h| 7 ++- src/glsl/nir/nir_from_ssa.c | 25 ++--- src/mesa/drivers/dri/i965/brw_nir.c | 2 +- 4 files changed, 26 in

[Mesa-dev] [PATCH 0/4] i965: use SSA values when we can

2015-06-25 Thread Connor Abbott
str, based on my grepping. I tried to compile-test it, but it assumed I was using the simulator and died, so it would be nice to at least compile-test it. The changes are also available at: git://people.freedesktop.org/~cwabbott0/mesa i965-use-ssa Connor Abbott (4): nir/from_ssa: add a flag to

[Mesa-dev] [PATCH 3/4] nir: remove nir_src_get_parent_instr()

2015-06-25 Thread Connor Abbott
It's now unused. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.h | 10 -- 1 file changed, 10 deletions(-) diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 2116f60..b33c9c5 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -565,16 +565,6 @@ nir_src_fo

[Mesa-dev] [PATCH 4/4] nir: remove parent_instr from nir_register

2015-06-25 Thread Connor Abbott
It's no longer used Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 1 - src/glsl/nir/nir.h | 8 src/glsl/nir/nir_from_ssa.c | 8 3 files changed, 17 deletions(-) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index f03e80a..f661249 100644

[Mesa-dev] [PATCH 2/4] i965/fs: use SSA values directly

2015-06-25 Thread Connor Abbott
;re not allocating a nir_register for every value. It also makes our handling of load_const more consistent compared to the other instructions. Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.h | 5 ++ src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 73 +++

Re: [Mesa-dev] [PATCH 1/4] nir/from_ssa: add a flag to not convert everything to SSA

2015-06-25 Thread Connor Abbott
On Thu, Jun 25, 2015 at 1:36 PM, Jason Ekstrand wrote: > On Thu, Jun 25, 2015 at 12:29 PM, Connor Abbott wrote: >> We already don't convert constants out of SSA, and in our backend we'd >> like to have only one way of saying something is still in SSA. >> >> T

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-27 Thread Connor Abbott
On Sat, Jun 27, 2015 at 6:48 AM, Rob Clark wrote: > I had a quick look at enabling this for freedreno.. although looks > like it is going to take some work in tgsi_to_nir and/or nir.. the > problem is we end up w/ a register array (rather than variable array > like we do for TEMP arrays).. ie. for

Re: [Mesa-dev] [RFC] gallium/hud: fix issue w/ tgsi_to_nir

2015-06-27 Thread Connor Abbott
On Sat, Jun 27, 2015 at 11:39 AM, Rob Clark wrote: > On Sat, Jun 27, 2015 at 12:57 PM, Connor Abbott wrote: >> On Sat, Jun 27, 2015 at 6:48 AM, Rob Clark wrote: >>> I had a quick look at enabling this for freedreno.. although looks >>> like it is going to take some

Re: [Mesa-dev] [PATCH] gallium/ttn: mark location specially in nir for color0-writes-all

2015-06-27 Thread Connor Abbott
On Sat, Jun 27, 2015 at 2:54 PM, Rob Clark wrote: > Connor, btw, how does glsl_to_nir handle this? The variable for gl_FragColor a special location (FRAG_RESULT_COLOR), whereas normal outputs (i.e. gl_FragData[] or out variables) start at FRAG_RESULT_DATA0. > > I guess at some point we want to t

Re: [Mesa-dev] [PATCH 3/4] nir/lower_phis_to_scalar: undef is trivially scalarizable

2015-07-01 Thread Connor Abbott
now, but it should be easy enough to handle and Jason is writing an undef propagation pass that should clean it up. Reviewed-by: Connor Abbott ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 4/5] i965/fs: remove special case in setup_payload_interference()

2015-07-01 Thread Connor Abbott
From: Connor Abbott regs_read() will handle LINTERP for us since the previous commit. In addition, we were being too conservative, since it will only read 2 registers on SIMD8. instructions in affected programs: 9061 -> 8893 (-1.85%) helped:10 H

[Mesa-dev] [PATCH 3/5] i965/fs: Mark last used ip for all regs read in the payload

2015-07-01 Thread Connor Abbott
because of some bogus interferences which the next commit removes. (Connor: added bit about gl_FragCoord to commit message) Reviewed-by: Connor Abbott Signed-off-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff -

[Mesa-dev] [PATCH 2/5] i965/fs: fix stride and type for hw_reg's in regs_read()

2015-07-01 Thread Connor Abbott
sources with file == HW_REG get all their information from the fixed_hw_reg field, so we need to get the stride and type from there when computing the size. Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.cpp | 24 ++-- 1 file changed, 18 insertions(+), 6

[Mesa-dev] [PATCH 1/5] i965/fs: fix regs_read() for LINTERP

2015-07-01 Thread Connor Abbott
The second source always stays within the same SIMD8 register. Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index dd95519

[Mesa-dev] [PATCH 5/5] i965/fs: don't make unused payload registers interfere

2015-07-01 Thread Connor Abbott
From: Connor Abbott Before, we were setting payload_last_use_ip for unused payload registers to 0, which made them interfere with whatever the first instruction wrote to due to the workaround for SIMD16 uniform arguments. Just use -1 to mean "unused" instead, and then skip s

Re: [Mesa-dev] [PATCH] nir: Don't allow copying SSA destinations

2015-07-01 Thread Connor Abbott
Assuming this passes piglit, Reviewed-by: Connor Abbott On Wed, Jul 1, 2015 at 4:00 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.c | 22 +++--- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c

Re: [Mesa-dev] [PATCH] nir: Fix comment above nir_convert_from_ssa() prototype.

2015-07-08 Thread Connor Abbott
Whoops! Reviewed-by: Connor Abbott On Wed, Jul 8, 2015 at 1:57 AM, Kenneth Graunke wrote: > Presumably Connor renamed the parameter, inverting the sense. > Update the comment accordingly. > > Cc: Connor Abbott > Signed-off-by: Kenneth Graunke > --- > src/glsl/nir/nir.h

Re: [Mesa-dev] [PATCH 2/5] i965/fs: fix stride and type for hw_reg's in regs_read()

2015-07-14 Thread Connor Abbott
On Tue, Jul 14, 2015 at 6:02 AM, Francisco Jerez wrote: > Connor Abbott writes: > >> sources with file == HW_REG get all their information from the >> fixed_hw_reg field, so we need to get the stride and type from there >> when computing the size. >> &

Re: [Mesa-dev] Register spilling issues in the NIR->vec4 backend

2015-07-15 Thread Connor Abbott
On Wed, Jul 15, 2015 at 7:49 AM, Iago Toral wrote: > Hi, > > when we sent the patches for the new nir->vec4 backend we mentioned that > we had a few dEQP tests that would fail to link because of register > spilling. Now that we have added GS support we see a few instances of > this problem popping

Re: [Mesa-dev] Seeking advice speeding up glsl optimisation passes for AoA

2015-07-15 Thread Connor Abbott
On Wed, Jul 15, 2015 at 11:53 AM, Eric Anholt wrote: > Timothy Arceri writes: > >> Hi guys, >> >> As I've mentioned a couple of times in previous patches some of the cts AoA >> tests are taking very long time to compile. This is due to excessive >> optimisation passes mainly in the glsl optimisat

Re: [Mesa-dev] [PATCH 3/3] nir: add the ability insert a CF node after an instruction

2015-07-17 Thread Connor Abbott
On Thu, Jul 16, 2015 at 3:18 PM, Kenneth Graunke wrote: > From: Connor Abbott > > This will split the block containing the instruction and put the CF node > in between. > > v2: (by Kenneth Graunke) > - Simplify split_block_after_instr()'s implementation by using >

Re: [Mesa-dev] [PATCH 0/5] [RFC] Value range propagation for NIR

2015-07-20 Thread Connor Abbott
On Tue, Jul 14, 2015 at 3:08 PM, Thomas Helland wrote: > The deadline for GSoC is aproaching a bit faster than I'm > comfortable with, so I need to get this out on the list > for some review-action. It's not yet complete, but I think > it's getting there. At least it should be possible to infer >

[Mesa-dev] [PATCH 00/21] NIR control flow modification

2015-07-21 Thread Connor Abbott
it a small wrapper around the new API instead. The series can also be found at: git://people.freedesktop.org/~cwabbott0/mesa nir-control-flow-mod Connor Connor Abbott (21): nir/validate: check successors/predecessors more carefully nir: inline block_add_pred() a few places nir:

[Mesa-dev] [PATCH 07/21] nir/cf: add remove_phi_src() helper

2015-07-21 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index bb94652..bf25813 100644 --- a/src/glsl/nir/nir_control_flow.c +++ b/src/glsl/nir

[Mesa-dev] [PATCH 08/21] nir/cf: split up and improve nir_handle_remove_jumps()

2015-07-21 Thread Connor Abbott
elete the control flow containing the jump, which removes the entry in the predecessors and any phi node sources. Split up nir_handle_remove_jumps() to accomodate this, and add the missing support for removing phi node sources. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c

[Mesa-dev] [PATCH 01/21] nir/validate: check successors/predecessors more carefully

2015-07-21 Thread Connor Abbott
We should be checking almost everything now. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_validate.c | 95 +++-- 1 file changed, 84 insertions(+), 11 deletions(-) diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index dc79941

[Mesa-dev] [PATCH 04/21] nir: move control flow modification to its own file

2015-07-21 Thread Connor Abbott
ntrol flow modification code, but for now we expose them and put them in a separate, private header. Signed-off-by: Connor Abbott --- src/gallium/auxiliary/nir/tgsi_to_nir.c | 1 + src/glsl/Makefile.sources | 3 + src/glsl/nir/glsl_to_nir.cpp| 1 + src/glsl

[Mesa-dev] [PATCH 10/21] nir/cf: add block_ends_in_jump()

2015-07-21 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 8 1 file changed, 8 insertions(+) diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index b416a58..b99bf89 100644 --- a/src/glsl/nir/nir_control_flow.c +++ b/src/glsl/nir/nir_control_flow.c

[Mesa-dev] [PATCH 14/21] nir/cf: clean up jumps when cleaning up CF nodes

2015-07-21 Thread Connor Abbott
h the new API it shouldn't be an issue, since blocks that don't end in a jump must either point to another block in the same extracted CF list or not point to anything at all. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 5 - 1 file changed, 4 insertions

[Mesa-dev] [PATCH 05/21] nir/cf: add insert_phi_undef() helper

2015-07-21 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 25 + 1 file changed, 25 insertions(+) diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index 8d146c4..bb94652 100644 --- a/src/glsl/nir/nir_control_flow.c +++ b/src/glsl/nir

[Mesa-dev] [PATCH 09/21] nir/cf: handle phi nodes better in split_block_beginning()

2015-07-21 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index 205b608..b416a58 100644 --- a/src/glsl/nir/nir_control_flow.c +++ b/src/glsl/nir

[Mesa-dev] [PATCH 03/21] nir: make cleanup_cf_node() not use remove_defs_uses()

2015-07-21 Thread Connor Abbott
calls remove_defs_uses() and then removes the instruction from the list. nir_instr_remove() does do extra things for jumps, though, so we avoid calling it on jumps which matches the previous behavior (this will be fixed later in the series). Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 6 -- 1

[Mesa-dev] [PATCH 06/21] nir: add nir_foreach_phi_src_safe()

2015-07-21 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 2029dc9..e9f1363 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1101,6 +1101,8 @@ typedef struct { #define nir_foreach_phi_src

[Mesa-dev] [PATCH 16/21] nir/cf: add a cursor structure

2015-07-21 Thread Connor Abbott
ning which variant to use down to the split function, which will be shared with nir_cf_node_insert(). In the future, we may want to make the instruction insertion API's as well as the builder use this, but that's a future cleanup. Signed-off-by: Connor Abbott --- src/glsl/nir/nir

[Mesa-dev] [PATCH 19/21] nir/cf: use a cursor for inserting control flow

2015-07-21 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 197 ++-- src/glsl/nir/nir_control_flow.h | 27 +- 2 files changed, 49 insertions(+), 175 deletions(-) diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index

[Mesa-dev] [PATCH 20/21] nir/cf: add new control modification API's

2015-07-21 Thread Connor Abbott
These will help us do a number of things, including: - Early return elimination. - Dead control flow elimination. - Various optimizations, such as replacing: if (foo) { ... } if (!foo) { ... } with: if (foo) { ... } else { ... } Signed-off-by: Connor Abbott --- src/glsl/nir

[Mesa-dev] [PATCH 17/21] nir/cf: add split_block_before_instr()

2015-07-21 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/glsl/nir/nir_control_flow.c b/src/glsl/nir/nir_control_flow.c index 9ae113f..fcdabc7 100644 --- a/src/glsl/nir/nir_control_flow.c +++ b/src/glsl/nir

[Mesa-dev] [PATCH 21/21] nir/cf: reimplement nir_cf_node_remove() using the new API

2015-07-21 Thread Connor Abbott
This gives us some testing of it. Also, the old nir_cf_node_remove() wasn't handling phi nodes correctly and was calling cleanup_cf_node() too late. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 31 --- src/glsl/nir/nir_control_flow.h

[Mesa-dev] [PATCH 11/21] nir/cf: handle jumps in split_block_end()

2015-07-21 Thread Connor Abbott
a side effect, when removing jumps we now correctly insert undef phi sources in some corner cases, which can't hurt. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_control_flow.c

[Mesa-dev] [PATCH 02/21] nir: inline block_add_pred() a few places

2015-07-21 Thread Connor Abbott
It was being used to initialize function impls and loops, even though it's really a control flow modification helper. It's pretty trivial, so just inline it to avoid the dependency. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 5 ++--- 1 file changed, 2 insertions(+), 3

[Mesa-dev] [PATCH 18/21] nir/cf: add split_block_cursor()

2015-07-21 Thread Connor Abbott
This is a helper that will be shared between the new control flow insertion and modification code. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 48 + 1 file changed, 48 insertions(+) diff --git a/src/glsl/nir/nir_control_flow.c b

[Mesa-dev] [PATCH 15/21] nir/cf: fix link_blocks() when there are no successors

2015-07-21 Thread Connor Abbott
d yet. So in move_successors(), we need to handle the case where the block whose successors are to be moved doesn't have any successors. Fixing link_blocks() here prevents a segfault and makes it work correctly. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 3 ++- 1 fi

[Mesa-dev] [PATCH 12/21] nir/cf: handle jumps better in stitch_blocks()

2015-07-21 Thread Connor Abbott
ommon occurance, but we'll need it to handle inserting a control flow list which ends in a jump, which should be more common/useful. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sr

[Mesa-dev] [PATCH 13/21] nir/cf: remove uses of SSA definitions that are being deleted

2015-07-21 Thread Connor Abbott
e for deletion, we must clean up any uses of the deleted instructions by making them point to undef instructions instead. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_control_flow.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/gls

[Mesa-dev] [PATCH 3/7] nir: add nir_block_get_following_loop() helper

2015-07-21 Thread Connor Abbott
From: Connor Abbott Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 16 src/glsl/nir/nir.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index e9af1a7..f2b60d4 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c

[Mesa-dev] [PATCH 5/7] nir/dead_cf: add support for removing useless loops

2015-07-21 Thread Connor Abbott
From: Connor Abbott v2: fix detecting if the loop has any phi nodes after it. v2: use nir_foreach_ssa_def() instead of nir_foreach_dest() when checking for values live after the loop to catch const_load instructions. v2: fix handling return instructions v2: add some documentation to

[Mesa-dev] [PATCH 1/7] nir: add an optimization for removing dead control flow

2015-07-21 Thread Connor Abbott
From: Connor Abbott v2: use nir_cf_node_remove_after() instead of our own broken thing. v3: use the new control flow modification helpers. Signed-off-by: Connor Abbott --- src/glsl/Makefile.sources | 1 + src/glsl/nir/nir.h | 2 + src/glsl/nir/nir_opt_dead_cf.c | 155

[Mesa-dev] [PATCH 6/7] i965/fs/nir: enable the dead control flow optimization

2015-07-21 Thread Connor Abbott
From: Connor Abbott Doesn't do anything on the public shader-db. Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_nir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c index 3e154c1..df3be22 1

[Mesa-dev] [PATCH 4/7] nir: add a helper for iterating over blocks in a cf node

2015-07-21 Thread Connor Abbott
From: Connor Abbott We were already doing this internally for iterating over a function implementation, so just expose it directly. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 7 +++ src/glsl/nir/nir.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/glsl/nir/nir.c b

[Mesa-dev] [PATCH 0/7] NIR dead control flow, take two

2015-07-21 Thread Connor Abbott
roduce it so it seems like a spurious failure. Other than that, there are no piglit regressions. Connor Abbott (7): nir: add an optimization for removing dead control flow nir/dead_cf: delete code that's unreachable due to jumps nir: add nir_block_get_following_loop() helper nir: add a

[Mesa-dev] [PATCH 7/7] XXX disable opt_if_simplification

2015-07-21 Thread Connor Abbott
From: Connor Abbott This helps with testing the NIR dead cf pass. Signed-off-by: Connor Abbott --- src/glsl/glsl_parser_extras.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index 5412f0b..2948607

[Mesa-dev] [PATCH 2/7] nir/dead_cf: delete code that's unreachable due to jumps

2015-07-21 Thread Connor Abbott
From: Connor Abbott v2: use nir_cf_node_remove_after(). v2: use foreach_list_typed() instead of hardcoding a list walk. v3: update to new control flow modification helpers. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_dead_cf.c | 123 ++--- 1 file

Re: [Mesa-dev] [PATCH 0/7] NIR dead control flow, take two

2015-07-21 Thread Connor Abbott
On Tue, Jul 21, 2015 at 9:53 PM, Connor Abbott wrote: > This is another spin of my dead control flow elimination series, this > time based on the control flow modification series I sent out earlier. > It's much shorter, since it now uses the much-more-reusable modification > A

Re: [Mesa-dev] [PATCH 08/10] radeonsi: re-enable unsafe-fp-math for LLVM 3.8

2015-10-10 Thread Connor Abbott
FWIW, this isn't quite correct with ARB_shader_precision or GL4.1 -- it specifies that infinities should be correctly generated through division by 0, which unsafe-fp-math doesn't guarantee. At least, that's assuming this is similar to the "fast" per-instruction flag (http://llvm.org/docs/LangRef.h

Re: [Mesa-dev] [PATCH 08/10] radeonsi: re-enable unsafe-fp-math for LLVM 3.8

2015-10-11 Thread Connor Abbott
On Sun, Oct 11, 2015 at 7:08 AM, Marek Olšák wrote: > On Sun, Oct 11, 2015 at 4:12 AM, Connor Abbott wrote: >> FWIW, this isn't quite correct with ARB_shader_precision or GL4.1 -- >> it specifies that infinities should be correctly generated through >> division by 0, wh

Re: [Mesa-dev] [PATCH 2/3] i965: Implement a new type_size_4x() function.

2015-10-15 Thread Connor Abbott
On Thu, Oct 15, 2015 at 6:17 PM, Kenneth Graunke wrote: > Often, shader inputs/outputs are required to be aligned to vec4 slots > for one reason or another. When working with the scalar backend, we > want to count the number of scalar components, yet still respect the > vec4 packing rules as requ

[Mesa-dev] [PATCH v2 4/6] i965: dump scheduling cycle estimates

2015-10-16 Thread Connor Abbott
compatible with older shader-db. - Make loop heuristic 10x to match with spilling code. Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_cfg.h | 4 src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 11 ++- .../drivers/dri/i965/brw_schedule_instru

[Mesa-dev] [PATCH v2 shader-db] report.py: rework and update for cycle info

2015-10-16 Thread Connor Abbott
list of measurements due to the above. Signed-off-by: Connor Abbott --- report.py | 164 ++ 1 file changed, 89 insertions(+), 75 deletions(-) diff --git a/report.py b/report.py index 4c06714..409474a 100755 --- a/report.py +++ b/r

Re: [Mesa-dev] [PATCH 6/7] i965: Implement nir_intrinsic_shader_clock

2015-10-19 Thread Connor Abbott
On Mon, Oct 19, 2015 at 10:46 AM, Emil Velikov wrote: > Signed-off-by: Emil Velikov > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 9 + > src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 10 ++ > 2 files changed, 19 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/brw_

Re: [Mesa-dev] [PATCH 5/7] i965/fs: move the fs_reg::smear() from get_timestamp() to the callers

2015-10-19 Thread Connor Abbott
On Mon, Oct 19, 2015 at 2:29 PM, Matt Turner wrote: > On Mon, Oct 19, 2015 at 7:45 AM, Emil Velikov > wrote: >> We're about to reuse get_timestamp() for the nir_intrinsic_shader_clock. >> The in the latter the generalisation does not apply, so move the smear() >> where needed. This also makes th

Re: [Mesa-dev] [PATCHv2 6/7] i965: Implement nir_intrinsic_shader_clock

2015-10-20 Thread Connor Abbott
(BRW_REGISTER_TYPE_UD, ARRAY_SIZE(srcs)); No need to create a temporary here -- you can just do bld.LOAD_PAYLOAD(dest, srcs, ARRAY_SIZE(srcs), 0); with that, this is Reviewed-by: Connor Abbott > + > + bld.LOAD_PAYLOAD(tmp, srcs, ARRAY_SIZE(srcs), 0); > + bld.MOV(dest, tmp);

Re: [Mesa-dev] [PATCHv4 4/7] nir: add shader_clock intrinsic

2015-10-20 Thread Connor Abbott
x32ARB() > + * GLSL intrinsic. > + * The latter can be used as code motion barrier, which is currently not > + * feasible with NIR, thus we can eliminate the intrinsic when the return > + * value is unused. Just a small bikeshedding thing: technically, even if we were to make shader_clo

Re: [Mesa-dev] [PATCH 5/7] i965/fs: move the fs_reg::smear() from get_timestamp() to the callers

2015-10-20 Thread Connor Abbott
only care if the measurement was invalidated during the period we're measuring, so we can delete it from emit_shader_time_begin(). In turn, you can summarize the first paragraph here with something like "We only use the low 32 bits of the timestamp (see emit_shader_time_begin())". With that

Re: [Mesa-dev] [PATCH 0/2] Nir: Allow CSE of SSBO loads

2015-10-22 Thread Connor Abbott
On Thu, Oct 22, 2015 at 7:21 AM, Iago Toral Quiroga wrote: > I implemented this first as a separate optimization pass in GLSL IR [1], but > Curro pointed out that this being pretty much a restricted form of a CSE pass > it would probably make more sense to do it inside CSE (and we no longer have >

Re: [Mesa-dev] [PATCH 0/2] Nir: Allow CSE of SSBO loads

2015-10-22 Thread Connor Abbott
On Thu, Oct 22, 2015 at 10:37 AM, Francisco Jerez wrote: > Connor Abbott writes: > >> On Thu, Oct 22, 2015 at 7:21 AM, Iago Toral Quiroga >> wrote: >>> I implemented this first as a separate optimization pass in GLSL IR [1], but >>> Curro pointed out that

Re: [Mesa-dev] [PATCH] nir/validate: Add better validation of load/store types

2015-10-22 Thread Connor Abbott
Reviewed-by: Connor Abbott On Thu, Oct 22, 2015 at 7:53 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_validate.c | 16 ++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c > inde

Re: [Mesa-dev] [PATCH 1/6] i965: fix cycle estimates when there's a pipeline stall

2015-10-28 Thread Connor Abbott
ead to kick off each cycle and there's no extra overhead for switching. > > Reviewed-by: Jason Ekstrand > > On Fri, Oct 2, 2015 at 2:37 PM, Connor Abbott wrote: >> The issue time for an instruction is how many cycles it takes to >> actually put it into the pipelin

Re: [Mesa-dev] [PATCH 7/7] nir: add helper macros for running NIR passes

2015-10-28 Thread Connor Abbott
On Wed, Oct 28, 2015 at 1:37 PM, Rob Clark wrote: > On Wed, Oct 28, 2015 at 12:09 PM, Jason Ekstrand wrote: >> On Sat, Oct 24, 2015 at 10:08 AM, Rob Clark wrote: >>> From: Rob Clark >>> >>> Convenient place to put in some extra sanity checking, without making >>> things messy for the drivers ru

Re: [Mesa-dev] [PATCH 02/11] nir: Add a pass-running infastructure

2015-10-28 Thread Connor Abbott
While it works for now, I'm not so sure about how we're conflating the definition of a pass and its dynamic instantiation. Eventually we'll want to have passes refer to each other ("please run pass B after pass A to clean up its mess", etc.), and in that case we need to be able to have to the pass

Re: [Mesa-dev] [PATCH 02/11] nir: Add a pass-running infastructure

2015-10-28 Thread Connor Abbott
On Wed, Oct 28, 2015 at 7:06 PM, Ian Romanick wrote: > On 10/28/2015 02:32 PM, Jason Ekstrand wrote: >> --- >> src/glsl/nir/nir.h | 19 +++ >> src/glsl/nir/nir_pass.c | 64 >> - >> 2 files changed, 82 insertions(+), 1 deletion(-) >

Re: [Mesa-dev] [PATCH 02/11] nir: Add a pass-running infastructure

2015-10-28 Thread Connor Abbott
On Wed, Oct 28, 2015 at 8:00 PM, Jason Ekstrand wrote: > On Wed, Oct 28, 2015 at 4:26 PM, Connor Abbott wrote: >> While it works for now, I'm not so sure about how we're conflating the >> definition of a pass and its dynamic instantiation. Eventually we'll >&g

Re: [Mesa-dev] [PATCH 02/11] nir: Add a pass-running infastructure

2015-10-28 Thread Connor Abbott
On Wed, Oct 28, 2015 at 8:04 PM, Ian Romanick wrote: > On 10/28/2015 04:43 PM, Connor Abbott wrote: >> On Wed, Oct 28, 2015 at 7:06 PM, Ian Romanick wrote: >>> On 10/28/2015 02:32 PM, Jason Ekstrand wrote: >>>> --- >>>> src/glsl/nir/nir.h | 19 +++

Re: [Mesa-dev] [PATCH 02/11] nir: Add a pass-running infastructure

2015-10-28 Thread Connor Abbott
On Wed, Oct 28, 2015 at 8:51 PM, Jason Ekstrand wrote: > On Wed, Oct 28, 2015 at 5:41 PM, Connor Abbott wrote: >> On Wed, Oct 28, 2015 at 8:00 PM, Jason Ekstrand wrote: >>> On Wed, Oct 28, 2015 at 4:26 PM, Connor Abbott wrote: >>>> While it works for now, I

Re: [Mesa-dev] [PATCH v2 shader-db] report.py: rework and update for cycle info

2015-10-30 Thread Connor Abbott
Ping. I just pushed the corresponding mesa patch to master yesterday, so I'd like to get this landed in shader-db soon. On Fri, Oct 16, 2015 at 11:09 PM, Connor Abbott wrote: > Now that we have three separate things we want to measure (instructions, > cycles, and loops), it's imp

[Mesa-dev] [PATCH] i965/sched: don't calculate live intervals for post-RA scheduling

2015-10-30 Thread Connor Abbott
For some reason, this causes assertions on gm965 only. In any case, it's unnecessary since we don't need liveness information in the post-RA scheduler. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92744 Cc: Mark Janes Signed-off-by: Connor Abbott --- src/mesa/driver

[Mesa-dev] [PATCH 4/7] i965/sched: switch to register pressure scheduling dynamically

2015-10-30 Thread Connor Abbott
48190694 (-1.78%) cycles in affected programs: 5383866 -> 4509080 (-16.25%) helped: 1580 HURT: 407 LOST: 10 GAINED: 45 Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.cpp | 34 - src/mesa/drivers/dri/i965/brw_fs.h | 6

[Mesa-dev] [PATCH 2/7] i965/sched: use a critical path heuristic

2015-10-30 Thread Connor Abbott
ams: 6055 -> 6707 (10.77%) helped: 1 HURT: 8 total cycles in shared programs: 52874386 -> 50180046 (-5.10%) cycles in affected programs: 50336130 -> 47641790 (-5.35%) helped: 58987 HURT: 1004 LOST: 3 GAINED: 0 Signed-off-by: Connor Abbott --- .../drivers/dri/i965/brw_schedule_instructi

[Mesa-dev] [PATCH 0/7] More i965 scheduling improvements

2015-10-30 Thread Connor Abbott
gressions or lost SIMD16 shaders in any SynMark benchmark for whatever reason. This series is also available at git://people.freedesktop.org/~cwabbott0/mesa i965-sched-v3 [1] http://lists.freedesktop.org/archives/mesa-dev/2015-October/097431.html Connor Abbott (7): i965: use real latencies in the pre

[Mesa-dev] [PATCH 1/7] i965: use real latencies in the pre-RA scheduler

2015-10-30 Thread Connor Abbott
7447753 (0.10%) instructions in affected programs: 32614 -> 40237 (23.37%) helped: 4 HURT: 26 total cycles in shared programs: 56282914 -> 52733940 (-6.31%) cycles in affected programs: 34510450 -> 30961476 (-10.28%) helped: 23664 HURT: 3343 LOST: 257 GAINED: 35 Signed-off-by: Connor Abbott ---

[Mesa-dev] [PATCH 6/7] i965/sched: use Sethi-Ullman numbering

2015-10-30 Thread Connor Abbott
ograms: 51126212 -> 50217894 (-1.78%) cycles in affected programs: 8758434 -> 7850116 (-10.37%) helped: 1754 HURT: 1462 LOST: 36 GAINED: 72 Signed-off-by: Connor Abbott --- .../drivers/dri/i965/brw_schedule_instructions.cpp | 197 ++--- 1 file changed, 169 insertions(+),

[Mesa-dev] [PATCH 7/7] i965/fs: use a better heuristic for SIMD16

2015-10-30 Thread Connor Abbott
MD8 programs should take about the same time. That way, we won't miss any opportunity for SIMD16 programs to help us, even if occasionally we use ones that don't help that much. LOST: 484 GAINED: 6 Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.cpp | 24 ++-

[Mesa-dev] [PATCH 3/7] i965/sched: get rid of the LIFO heuristic

2015-10-30 Thread Connor Abbott
HURT: 10 LOST: 223 GAINED: 0 Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.cpp | 1 - .../drivers/dri/i965/brw_schedule_instructions.cpp | 61 ++ src/mesa/drivers/dri/i965/brw_shader.h | 1 - 3 files changed, 5 insertions(+), 58 de

[Mesa-dev] [PATCH 5/7] i965/sched: switch to bottom-up scheduling

2015-10-30 Thread Connor Abbott
812664 -> 37243774 (1.17%) helped: 22829 HURT: 19197 LOST: 6 GAINED: 528 Signed-off-by: Connor Abbott --- .../drivers/dri/i965/brw_schedule_instructions.cpp | 168 ++--- 1 file changed, 79 insertions(+), 89 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_schedule_i

Re: [Mesa-dev] [PATCH 00/11] nir: Add a pass management framework

2015-10-31 Thread Connor Abbott
On Sat, Oct 31, 2015 at 10:55 AM, Rob Clark wrote: > On Fri, Oct 30, 2015 at 6:42 PM, Jason Ekstrand wrote: >> On Fri, Oct 30, 2015 at 2:12 PM, Ian Romanick wrote: >>> On 10/28/2015 10:01 PM, Jason Ekstrand wrote: On Oct 28, 2015 9:12 PM, "Kenneth Graunke" >>>

Re: [Mesa-dev] [PATCH 00/11] nir: Add a pass management framework

2015-10-31 Thread Connor Abbott
On Sat, Oct 31, 2015 at 1:38 PM, Rob Clark wrote: > On Sat, Oct 31, 2015 at 11:31 AM, Connor Abbott wrote: >> On Sat, Oct 31, 2015 at 10:55 AM, Rob Clark wrote: >>> On Fri, Oct 30, 2015 at 6:42 PM, Jason Ekstrand >>> wrote: >>>> On Fri, Oct 30, 2015 at

Re: [Mesa-dev] [PATCH 00/11] nir: Add a pass management framework

2015-10-31 Thread Connor Abbott
On Sat, Oct 31, 2015 at 3:29 PM, Rob Clark wrote: > On Sat, Oct 31, 2015 at 2:26 PM, Connor Abbott wrote: >> On Sat, Oct 31, 2015 at 1:38 PM, Rob Clark wrote: >>> On Sat, Oct 31, 2015 at 11:31 AM, Connor Abbott wrote: >>>> On Sat, Oct 31, 2015 at 10:55 AM, Rob C

[Mesa-dev] [PATCH 4/4] nir/glsl: switch to using the builder

2015-10-31 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 700 --- 1 file changed, 259 insertions(+), 441 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index a5902a0..a44ded0 100644 --- a/src/glsl/nir

[Mesa-dev] [PATCH 1/4] nir/glsl: make evaluate_rvalue() return a nir_ssa_def *

2015-10-31 Thread Connor Abbott
this since the builder takes nir_ssa_def * sources directly. Signed-off-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 90 ++-- 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp

[Mesa-dev] [PATCH 2/4] nir/glsl: convert nir_visitor::result to a nir_ssa_def *

2015-10-31 Thread Connor Abbott
Its only user now returns a nir_ssa_def *, and we'll need this since the builder returns a nir_ssa_def *. Signed-off-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/gls

  1   2   3   4   5   6   7   8   9   10   >