[Mesa-dev] [PATCH] nir/lower_vars_to_ssa: fix a bug with boolean constants

2015-01-15 Thread Connor Abbott
Cc: Jason Ekstrand --- Seems like we missed fixing this issue during review. Jason, can you commit this? src/glsl/nir/nir_lower_vars_to_ssa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_lower_vars_to_ssa.c b/src/glsl/nir/nir_lower_vars_to_ssa.c index e3

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

2015-01-16 Thread Connor Abbott
gets included into nir.h like before. In addition to solving the above problems, using Python and Mako to generate everything means that it's much easier to add keep information centralized as we add new things like constant propagation that require per-opcode information. Signed-off-by: Con

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

2015-01-16 Thread Connor Abbott
taken from ir_constant_expressions.cpp. v2: use Python formatting and get rid of regex's Signed-off-by: Connor Abbott --- src/glsl/Makefile.am | 10 +- src/glsl/Makefile.sources| 3 +- src/glsl/nir/.gitignore | 1 + src/glsl/nir/nir_constant_expre

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

2015-01-16 Thread Connor Abbott
e had before for getting the constant expressions to a state where they could be compiled as C code. 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 con

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

2015-01-16 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 6c02582..496aa41 100644 --- a

[Mesa-dev] [PATCH 5/5] nir/lower_vars_to_ssa: fix a bug with boolean constants

2015-01-16 Thread Connor Abbott
Reviewed-by: Jason Ekstrand Signed-off-by: Connor Abbott --- src/glsl/nir/nir_lower_vars_to_ssa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_lower_vars_to_ssa.c b/src/glsl/nir/nir_lower_vars_to_ssa.c index 4df9bdd..cdf0023 100644 --- a/src/glsl/nir

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

2015-01-16 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

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

2015-01-16 Thread Connor Abbott
Oh, and I forgot... the series is also available at https://github.com/cwabbott0/mesa nir-opcodes-cleanup On Fri, Jan 16, 2015 at 4:46 PM, Connor Abbott wrote: > Hi, > > This is a series I had floating around a while. The idea is to have all the > opcode stuff, including cons

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

2015-01-16 Thread Connor Abbott
Hi Dylan, On Fri, Jan 16, 2015 at 7:01 PM, Dylan Baker wrote: > Hi Conner, I have a couple of things you should change, and a suggestion > for you below, hopefully it all makes sense. > > On Friday, January 16, 2015 04:46:07 PM Connor Abbott wrote: >> Before, we used a s

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

2015-01-16 Thread Connor Abbott
On Fri, Jan 16, 2015 at 10:48 PM, Dylan Baker wrote: > On Friday, January 16, 2015 10:18:43 PM Connor Abbott wrote: >> Hi Dylan, >> >> On Fri, Jan 16, 2015 at 7:01 PM, Dylan Baker wrote: >> > Hi Conner, I have a couple of things you should change, and a suggestion

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

2015-01-17 Thread Connor Abbott
On Sat, Jan 17, 2015 at 11:42 AM, ahmad wrote: > hi. > > "#! /usr/bin/env python" corresponds python 3.x series for some major distro > (arch,fedora ...) and python 2.x for some others. > > python 2.x and python 3.x are not source compatible each other. > > python 3.x not contains "xrange" funci

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

2015-01-19 Thread Connor Abbott
way > it worked out. A lot of the codegen stuff is very confusing and its not at > all obvious what's going on. I'll give it some thought and see if I can > come up with a good way to clean it up. > > On Jan 16, 2015 3:46 PM, "Connor Abbott" wrote: >> &

Re: [Mesa-dev] [PATCH 02/16] glsl: Add a foreach_in_list_reverse_safe macro.

2015-01-20 Thread Connor Abbott
Shouldn't the subject say "exec_list: Add a foreach_in_list_reverse_safe macro."? On Mon, Jan 19, 2015 at 6:31 PM, Matt Turner wrote: > --- > src/glsl/list.h | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/src/glsl/list.h b/src/glsl/list.h > index 330c17e..85368a4 100644 > --- a/s

Re: [Mesa-dev] [PATCH 10/16] i965/fs: Eliminate null-dst instructions without side-effects.

2015-01-20 Thread Connor Abbott
> That makes sense. However, in the vec4 backend, we do emit scratch reads > and writes prior to optimization - in move_grf_array_access_to_scratch(). > I've been meaning to port that over to the scalar backend. At which > point, SHADER_OPCODE_GEN4_SCRATCH_WRITE would be a problem. Sort of off-t

Re: [Mesa-dev] [PATCH 02/16] glsl: Add a foreach_in_list_reverse_safe macro.

2015-01-20 Thread Connor Abbott
On Tue, Jan 20, 2015 at 1:15 PM, Matt Turner wrote: > On Tue, Jan 20, 2015 at 6:16 AM, Connor Abbott wrote: >> Shouldn't the subject say "exec_list: Add a >> foreach_in_list_reverse_safe macro."? > > Meh? Shortlog on this file shows glsl2, exec_list, glsl, gls

Re: [Mesa-dev] [PATCH] nir: Add a nir_foreach_phi_src helper macro

2015-01-20 Thread Connor Abbott
Assuming you grepped for uses of foreach_list* with nir_phi_src and made sure there were no more, Reviewed-by: Connor Abbott On Tue, Jan 20, 2015 at 7:34 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.c | 4 ++-- > src/glsl/nir/nir.h | 3 +

Re: [Mesa-dev] [PATCH 1/2] nir: Add src and dest constructors

2015-01-21 Thread Connor Abbott
Reviewed-by: Connor Abbott On Wed, Jan 21, 2015 at 2:14 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir.h | 37 + > 1 file changed, 37 insertions(+) > > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h > index 5ebfc5a..7b5794d 10064

Re: [Mesa-dev] [PATCH 2/2] nir: Stop using designated initializers

2015-01-21 Thread Connor Abbott
Assuming this actually compiles with GCC 4.4... Reviewed-by: Connor Abbott On Wed, Jan 21, 2015 at 2:14 PM, Jason Ekstrand wrote: > Designated initializers with anonymous unions don't work in MSVC or > GCC < 4.6. With a couple of constructor methods, we don't need them any

Re: [Mesa-dev] [PATCH 2.1/2] SQUASH nir: Get rid of more designated initializers

2015-01-21 Thread Connor Abbott
Reviewed-by: Connor Abbbott On Wed, Jan 21, 2015 at 8:25 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_search.c | 24 ++-- > 1 file changed, 10 insertions(+), 14 deletions(-) > > diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c > index a7bd051..e69fdfd

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

2015-01-21 Thread Connor Abbott
Reviewed-by: Connor Abbott On Wed, Jan 21, 2015 at 11:23 PM, Matt Turner wrote: > Fixes a couple of warnings in the process. > --- > src/glsl/nir/glsl_to_nir.cpp | 57 > -- > src/glsl/nir/nir.h | 3 +-

Re: [Mesa-dev] [PATCH v2 04/29] nir: add support for flushing to zero denorm constants

2019-01-30 Thread Connor Abbott
On Tue, Dec 18, 2018 at 11:35 AM Samuel Iglesias Gonsálvez < sigles...@igalia.com> wrote: > v2: > - Refactor conditions and shared function (Connor) > - Move code to nir_eval_const_opcode() (Connor) > - Don't flush to zero on fquantize2f16 > From Vulkan spec, VK_KHR_shader_float_controls section

Re: [Mesa-dev] [PATCH v2 14/29] nir: fix constant expressions for rounding mode conversions

2019-01-30 Thread Connor Abbott
I think maybe it would be better if we put all this in nir_opcodes.py instead. Again, I'd like to make sure that for every opcode, what it does is right next to the definition instead of buried in nir_constant_expressions.py. Also, I don't see anywhere in the series where you handle different roun

Re: [Mesa-dev] [PATCH v3 12/44] nir: add new fadd, fsub, fmul opcodes taking into account rounding mode

2019-02-06 Thread Connor Abbott
On Wed, Feb 6, 2019 at 11:46 AM Samuel Iglesias Gonsálvez < sigles...@igalia.com> wrote: > According to Vulkan spec, the new execution modes affect only > correctly rounded SPIR-V instructions, which includes fadd, > fsub and fmul. > > Signed-off-by: Samuel Iglesias Gonsálvez > --- > src/compile

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-13 Thread Connor Abbott
Reviewed-by: Connor Abbott I'm a bit surprised it's that slow... do you have any idea what's going on? I've made flamegraphs in the past on i965 to see where most of the time is spent. On Wed, Feb 13, 2019 at 9:00 AM Timothy Arceri wrote: > Currently the radeonsi N

Re: [Mesa-dev] [PATCH] nir: remove simple dead if detection from nir_opt_dead_cf()

2019-02-15 Thread Connor Abbott
Reviewed-by: Connor Abbott I agree that if we ever need to bring this back, we should just check for both branches empty and no phis afterwards. On Thu, Feb 14, 2019 at 2:38 AM Timothy Arceri wrote: > This was probably useful when it was first written, however it > looks to be no

Re: [Mesa-dev] [PATCH] panfrost: Backport driver to Mali T600/T700

2019-02-19 Thread Connor Abbott
On Tue, Feb 19, 2019 at 5:33 PM Emil Velikov wrote: > On Fri, 15 Feb 2019 at 21:39, Alyssa Rosenzweig > wrote: > > > > > - about 1/5 of the patch seems to be white space changes > > > > ...Oops. Any tips for avoiding this type of diff churn in the future? I > > suppose it's not inherently harmfu

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-19 Thread Connor Abbott
On Wed, Feb 20, 2019 at 4:29 AM Marek Olšák wrote: > On Tue, Feb 19, 2019 at 7:57 PM Rob Clark wrote: > >> On Tue, Feb 19, 2019 at 6:49 PM Marek Olšák wrote: >> > >> > st_link_shader takes 55% of CPU time with NIR, and 9% with TGSI. >> > >> > nir_validate_shader 49% >> > >> > nir_validate_shade

Re: [Mesa-dev] [PATCH] panfrost: Use tiler fast path (performance boost)

2019-02-21 Thread Connor Abbott
On Thu, Feb 21, 2019 at 3:01 PM Rob Clark wrote: > On Thu, Feb 21, 2019 at 1:19 AM Alyssa Rosenzweig > wrote: > > > > For reasons that are still unclear (speculation included in the comment > > added in this patch), the tiler? metadata has a fast path that we were > > not enabling; there looks t

Re: [Mesa-dev] [PATCH] panfrost: Use tiler fast path (performance boost)

2019-02-21 Thread Connor Abbott
On Thu, Feb 21, 2019 at 5:07 PM Alyssa Rosenzweig wrote: > > Yes, there is a buffer for holding the results of the tiler. The way it > > works is that the userspace driver allocates a very large buffer with a > > "grow on page fault" bit, so the kernel will allocate more memory as the > > tiler a

Re: [Mesa-dev] [PATCH 3/5] panfrost: Disable PIPE_CAP_TGSI_TEXCOORD

2019-03-15 Thread Connor Abbott
On Fri, Mar 15, 2019 at 3:46 PM Ilia Mirkin wrote: > > On Fri, Mar 15, 2019 at 10:29 AM Alyssa Rosenzweig wrote: > > > > > This is needed if you can only handle point sprites on certain > > > varyings but not others. This is the case for nv30- and nvc0-based > > > GPUs, which is why the cap was i

Re: [Mesa-dev] [PATCH 3/5] panfrost: Disable PIPE_CAP_TGSI_TEXCOORD

2019-03-15 Thread Connor Abbott
On Fri, Mar 15, 2019 at 5:00 PM Ilia Mirkin wrote: > > On Fri, Mar 15, 2019 at 11:52 AM Connor Abbott wrote: > > > > On Fri, Mar 15, 2019 at 3:46 PM Ilia Mirkin wrote: > > > > > > On Fri, Mar 15, 2019 at 10:29 AM Alyssa Rosenzweig < aly...@rosenzweig.io&g

Re: [Mesa-dev] [PATCH 1/5] nir: Don't insert a fake link if unnecessary.

2015-09-04 Thread Connor Abbott
On Thu, Sep 3, 2015 at 2:32 PM, Kenneth Graunke wrote: > Prevents regressions in ~128 tests when fixing unlink_block_successors > in the next commit. > > XXX: Zero thought has been put into whether this is the right solution I'm confused as to how this can happen. The fake link is only for the si

Re: [Mesa-dev] [PATCH 2/5] nir/cf: Fix unlink_block_successors to actually unlink the second one.

2015-09-04 Thread Connor Abbott
cks(block, block->successors[0]); > if (block->successors[1] != NULL) >unlink_blocks(block, block->successors[1]); > + if (block->successors[0] != NULL) > + unlink_blocks(block, block->successors[0]); > } > > static void > -- > 2.5.0 > Patches

Re: [Mesa-dev] [PATCH 1/5] nir: Don't insert a fake link if unnecessary.

2015-09-05 Thread Connor Abbott
On Sat, Sep 5, 2015 at 2:31 AM, Kenneth Graunke wrote: > On Friday, September 04, 2015 11:56:29 AM Connor Abbott wrote: >> On Thu, Sep 3, 2015 at 2:32 PM, Kenneth Graunke >> wrote: >> > Prevents regressions in ~128 tests when fixing unlink_block_successors >> >

Re: [Mesa-dev] [PATCH 1/5] nir: Don't insert a fake link if unnecessary.

2015-09-10 Thread Connor Abbott
On Wed, Sep 9, 2015 at 1:37 AM, Kenneth Graunke wrote: > On Saturday, September 05, 2015 11:10:58 AM Connor Abbott wrote: >> On Sat, Sep 5, 2015 at 2:31 AM, Kenneth Graunke >> wrote: >> > On Friday, September 04, 2015 11:56:29 AM Connor Abbott wrote: >> >> I&

Re: [Mesa-dev] [RFC] nir: add lowering stage for user-clip-planes

2015-09-10 Thread Connor Abbott
On Thu, Sep 10, 2015 at 10:54 PM, Rob Clark wrote: > > On Sep 10, 2015 7:39 PM, "Jason Ekstrand" wrote: >> >> On Thu, Sep 10, 2015 at 2:39 PM, Rob Clark wrote: >> > From: Rob Clark >> > >> > So this is basically working as a lowering pass for handling user-clip- >> > planes, and frag-shader emu

Re: [Mesa-dev] [PATCH v2 10.1/11] nir: Add a fdot instruction that replicates the result to a vec4

2015-09-11 Thread Connor Abbott
On Fri, Sep 11, 2015 at 11:52 AM, Jason Ekstrand wrote: > Fortunately, nir_constant_expr already auto-splats if "dst" never shows up > in the constant expression field so we don't need to do anything there. > > Cc: Connor Abbott > --- > src/glsl/nir/nir.h

Re: [Mesa-dev] [PATCH 04/11] nir/print: print symbolic names from shader-enum

2015-09-15 Thread Connor Abbott
On Sun, Sep 13, 2015 at 11:51 AM, Rob Clark wrote: > From: Rob Clark > > Signed-off-by: Rob Clark > --- > src/glsl/nir/nir_print.c | 73 > ++-- > 1 file changed, 59 insertions(+), 14 deletions(-) > > diff --git a/src/glsl/nir/nir_print.c b/src/glsl/n

Re: [Mesa-dev] [PATCH 2/3] nir/print: bit of state refactoring

2015-09-15 Thread Connor Abbott
On Tue, Sep 15, 2015 at 7:33 PM, Rob Clark wrote: > From: Rob Clark > > Rename print_var_state to print_state, and stuff FILE ptr into the state > object. This avoids passing around an extra parameter everywhere. > > Signed-off-by: Rob Clark > --- > src/glsl/nir/nir_print.c | 95 > +++

Re: [Mesa-dev] [PATCH 3/3] nir/print: print symbolic names from shader-enum

2015-09-15 Thread Connor Abbott
On Tue, Sep 15, 2015 at 7:33 PM, Rob Clark wrote: > From: Rob Clark > > v2: split out moving of FILE *fp into state structure into it's own > (more complete patch) to reduce the noise in this one > > Signed-off-by: Rob Clark Rev

Re: [Mesa-dev] [PATCH 2/3] nir/print: bit of state refactoring

2015-09-15 Thread Connor Abbott
On Tue, Sep 15, 2015 at 9:42 PM, Rob Clark wrote: > On Tue, Sep 15, 2015 at 8:48 PM, Connor Abbott wrote: >> On Tue, Sep 15, 2015 at 7:33 PM, Rob Clark wrote: >>> From: Rob Clark >>> >>> Rename print_var_state to print_state, and stuff FILE ptr into the st

Re: [Mesa-dev] [PATCH 2/3] nir/print: bit of state refactoring

2015-09-16 Thread Connor Abbott
instead of > FILE ptr, and convert nir_print_instr() to use state as well > > Signed-off-by: Rob Clark 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] nir/build: add nir_vec() helper

2015-09-18 Thread Connor Abbott
Except for the thing Ilia pointed out, Reviewed-by: Connor Abbott On Fri, Sep 18, 2015 at 1:24 PM, Rob Clark wrote: > From: Rob Clark > > Signed-off-by: Rob Clark > --- > src/glsl/nir/nir_builder.h| 18 ++ > src/glsl/nir/nir_lower_load

Re: [Mesa-dev] [PATCH 05/11] nir/cf: Alter block successors before adding a fake link.

2015-09-22 Thread Connor Abbott
cf_node_as_block(last); > + /* insert fake link */ I was a little terse here with this comment, and based on how long it took to actually fix this, there seems to be a lot going on that one could easily miss from reading the code. The commit message has a pretty good summary of

Re: [Mesa-dev] [PATCH 07/11] nir/cf: Fix dominance metadata in the dead control flow pass.

2015-09-22 Thread Connor Abbott
> Signed-off-by: Kenneth Graunke Reviewed-by: Connor Abbott > --- > src/glsl/nir/nir_control_flow.c | 3 +++ > src/glsl/nir/nir_opt_dead_cf.c | 7 --- > 2 files changed, 7 insertions(+), 3 deletions(-) > > New patch! > > diff --git a/src/glsl/nir/nir_control_flow.

Re: [Mesa-dev] [PATCH 08/11] nir: Add unit tests for control flow graphs.

2015-09-22 Thread Connor Abbott
On Tue, Sep 22, 2015 at 11:01 PM, Kenneth Graunke wrote: > Signed-off-by: Kenneth Graunke > --- > src/glsl/Makefile.am | 14 +++ > src/glsl/nir/tests/control_flow_tests.cpp | 155 > ++ > 2 files changed, 169 insertions(+) > create mode 100644 s

Re: [Mesa-dev] [PATCH v2] nir/cf: Alter block successors before adding a fake link.

2015-09-23 Thread Connor Abbott
ink. In the above example, removing the break would cause block_1 to > have itself as a successor (as it becomes an infinite loop), so adding > the fake link won't cause a duplicate successor. > > v2: Add comments (requested by Connor Abbott) and fix commit message. > > Signe

Re: [Mesa-dev] [PATCH 4/5] nir: add a helper for finding duplicate instructions

2015-09-23 Thread Connor Abbott
On Tue, Aug 18, 2015 at 1:47 PM, Jason Ekstrand wrote: > On Fri, May 22, 2015 at 11:24 AM, Connor Abbott wrote: >> This can be used for both CSE and value numbering. >> >> Signed-off-by: Connor Abbott >> --- >> src/glsl/Makefile.sources | 2 + >&g

Re: [Mesa-dev] [PATCH 1/5] nir: split out instruction comparison functions

2015-09-23 Thread Connor Abbott
On Tue, Aug 18, 2015 at 1:29 AM, Jason Ekstrand wrote: > > On May 22, 2015 11:25 AM, "Connor Abbott" wrote: >> >> We'll want to use these outside of nir_opt_cse.c. Rather than adding yet >> another thing to the mess that is nir.c, create a new file

Re: [Mesa-dev] [PATCH] nir: split SSBO min/max atomic instrinsics into signed/unsigned versions

2015-09-28 Thread Connor Abbott
On Mon, Sep 28, 2015 at 4:47 AM, Iago Toral Quiroga wrote: > NIR is typeless so this is the only way to keep track of the > type to select the proper atomic to use. > --- > I decided to squash the i965 changes in because otherwise we would break > the build between the nir and i965 patches. Let me

[Mesa-dev] [PATCH v2 1/7] nir: split out instruction comparison functions

2015-09-30 Thread Connor Abbott
on texture support. Signed-off-by: Connor Abbott --- src/glsl/Makefile.sources| 1 + src/glsl/nir/nir.c | 26 -- src/glsl/nir/nir_instr_set.c | 206 +++ src/glsl/nir/nir_instr_set.h | 29 ++ src/glsl/nir/nir_opt_cse

[Mesa-dev] [PATCH v2 5/7] nir/cse: use the instruction set API

2015-09-30 Thread Connor Abbott
f the dominance tree so that the only instructions in the set are the instructions that dominate the current block. No piglit regressions. No shader-db changes. XXX perf numbers v2: - rebase on start_block removal - remove useless state struct - change commit message Signed-off-by: Connor A

[Mesa-dev] [PATCH v2 3/7] nir: constify instruction comparison functions

2015-09-30 Thread Connor Abbott
v2: rebase, don't constify nir_srcs_equal() as it's pass-by-value anyways Signed-off-by: Connor Abbott --- src/glsl/nir/nir_instr_set.c | 6 +++--- src/glsl/nir/nir_instr_set.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glsl/nir/nir_instr_set.c b/sr

[Mesa-dev] [PATCH v2 6/7] nir: make nir_instrs_equal() static

2015-09-30 Thread Connor Abbott
This was previously tied to CSE, since it would only work for instructions where nir_can_cse() (now instr_can_rewrite()) returned true. Now that CSE uses the instruction set abstraction which only uses this internally, we can make it local to nir_instr_set.c. Signed-off-by: Connor Abbott

[Mesa-dev] [PATCH v2 0/7] NIR CSE hashing

2015-09-30 Thread Connor Abbott
e the chance that one would handle less than the other without us noticing. The main missing thing is updated performance numbers from compiling shader-db, but I don't expect that they'll be too different. The series is also available at git://people.freedesktop.org/~cwabbott0/mesa nir-cse-

[Mesa-dev] [PATCH v2 2/7] nir: constify nir_ssa_alu_instr_src_components()

2015-09-30 Thread Connor Abbott
Signed-off-by: Connor Abbott --- 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 4f45770..58a86f7 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -722,7 +722,7 @@ nir_alu_instr_channel_used

[Mesa-dev] [PATCH v2 4/7] nir: add an instruction set API

2015-09-30 Thread Connor Abbott
since it's really more about whether its uses can be rewritten, and it's implicitly used by nir_instrs_equal() as well. - Rename nir_instr_set_add() to nir_instr_set_add_or_rewrite() (Jason). - Make the HASH() macro less magical (Topi). - Rewrite the commit message. Signed-off-by: Connor A

[Mesa-dev] [PATCH v2 7/7] nir/instr_set: remove unnecessary check in nir_instrs_equal()

2015-09-30 Thread Connor Abbott
tions that use an index, so we can turn the check into an assert. This also means that now nir_instrs_equal(instr, instr) will always return true unless it assert-fails. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_instr_set.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --

Re: [Mesa-dev] [PATCH v2 1/7] nir: split out instruction comparison functions

2015-09-30 Thread Connor Abbott
(CC'ing the list) On Wed, Sep 30, 2015 at 4:37 PM, Michael Schellenberger wrote: > Hi, > > Am 30.09.2015 um 17:11 schrieb Connor Abbott: >> Right now nir_instrs_equal() is tied pretty tightly to CSE, but we're >> going to introduce the idea of an instruction se

Re: [Mesa-dev] [PATCH v2 4/7] nir: add an instruction set API

2015-10-01 Thread Connor Abbott
On Wed, Sep 30, 2015 at 12:35 PM, Jason Ekstrand wrote: > On Wed, Sep 30, 2015 at 8:11 AM, Connor Abbott wrote: >> This will replace direct usage of nir_instrs_equal() in the CSE pass, >> which reduces an O(n^2) algorithm with an effectively O(n) one. It'll >> also be u

[Mesa-dev] [PATCH] nir/remove_phis: handle trivial back-edges

2015-10-02 Thread Connor Abbott
dead, and this patch will cause the loop to be deleted entirely. No piglit regressions. Shader-db results on bdw: instructions in affected programs: 5824 -> 5664 (-2.75%) helped:32 HURT: 0 Signed-off-by: Connor Abbott --- S

Re: [Mesa-dev] [PATCH] nir/remove_phis: handle trivial back-edges

2015-10-02 Thread Connor Abbott
On Fri, Oct 2, 2015 at 12:56 PM, Matt Turner wrote: > On Fri, Oct 2, 2015 at 9:28 AM, Connor Abbott wrote: >> Some loops may have phi nodes that look like: >> >> foo = ... >> loop { >> bar = phi(foo, bar) >> ... >> } >> >> in whic

Re: [Mesa-dev] [PATCH] nir/remove_phis: handle trivial back-edges

2015-10-02 Thread Connor Abbott
On Fri, Oct 2, 2015 at 1:26 PM, Connor Abbott wrote: > On Fri, Oct 2, 2015 at 12:56 PM, Matt Turner wrote: >> On Fri, Oct 2, 2015 at 9:28 AM, Connor Abbott wrote: >>> Some loops may have phi nodes that look like: >>> >>> foo = ... &

[Mesa-dev] [PATCH 3/6] i965: always run the post-RA scheduler

2015-10-02 Thread Connor Abbott
into account, and it can be more aggressive than the pre-RA scheduler since it doesn't have to worry about register pressure at all. XXX perf data Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

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

2015-10-02 Thread Connor Abbott
time. The old code had it backwards, and so we would underestimate the total time whenever we thought there would be a pipeline stall by up to the issue time of the instruction. Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp | 15 --- 1 file ch

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

2015-10-02 Thread Connor Abbott
The heuristic we're using is rather lame, since it assumes everything is non-uniform and loops execute 50 times, but it should be enough for measuring improvements in the scheduler that don't result in a change in the number of instructions. Signed-off-by: Connor Abbott --- src/mesa/d

[Mesa-dev] [PATCH 2/6] i965/sched: write-after-read dependencies are free

2015-10-02 Thread Connor Abbott
ned-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp index 76d58e2..1652261 10

[Mesa-dev] [PATCH 6/6] i965/sched: use liveness analysis for computing register pressure

2015-10-02 Thread Connor Abbott
n affected programs: 11338636 -> 11276736 (-0.55%) helped: 876 HURT: 873 LOST: 8 GAINED: 0 Signed-off-by: Connor Abbott --- The results are a wash, but this is needed for a lot of the more experimental things I want to do. I can drop this if there are any objections.

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

2015-10-02 Thread Connor Abbott
ver each measurement and report helped/hurt before reporting the gained/lost programs. Signed-off-by: Connor Abbott --- report.py | 140 ++ 1 file changed, 67 insertions(+), 73 deletions(-) diff --git a/report.py b/report.py index 4c06714.

[Mesa-dev] [PATCH 0/6] i965 scheduling improvements

2015-10-02 Thread Connor Abbott
ranch with some even-more-experimental patches, which range from "this is a good idea but it hurts some stuff" to "I'm not sure about this at all." I have some ideas about how to improve them so that they don't regress as much, but I want to get this series out of the way

[Mesa-dev] [PATCH 5/6] i965/fs: split out calculation of payload live ranges

2015-10-02 Thread Connor Abbott
We'll need this for the scheduler too, since it wants to know when the live ranges of payload registers end in order to model them in our register pressure calculations. Signed-off-by: Connor Abbott --- src/mesa/drivers/dri/i965/brw_fs.h| 2 + src/mesa/drivers/dri

[Mesa-dev] [PATCH shader-db 2/2] report.py: add an option for which measurements to report

2015-10-02 Thread Connor Abbott
Signed-off-by: Connor Abbott --- report.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/report.py b/report.py index bc3a640..f9445dd 100755 --- a/report.py +++ b/report.py @@ -48,14 +48,19 @@ def get_result_string(p, b, a): p = p + ' ' return

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

2015-10-02 Thread Connor Abbott
On Fri, Oct 2, 2015 at 5:37 PM, Connor Abbott wrote: > The heuristic we're using is rather lame, since it assumes everything is > non-uniform and loops execute 50 times, but it should be enough for > measuring improvements in the scheduler that don't result in a change

Re: [Mesa-dev] [RFC] ARB_shader_clock, hardware counters and i965

2015-10-05 Thread Connor Abbott
On Mon, Oct 5, 2015 at 11:36 AM, Emil Velikov wrote: > Hi all, > > I am looking at ARB_shader_clock with i965 in mind. > > So far I've got the most of the infra/plumbing, and a fancy a new intrinsic :) > > On the hardware side, I was thinking about using the Observability > Architecture (OA) count

Re: [Mesa-dev] [RFC] ARB_shader_clock, hardware counters and i965

2015-10-05 Thread Connor Abbott
On Mon, Oct 5, 2015 at 1:06 PM, Emil Velikov wrote: > On 5 October 2015 at 17:11, Connor Abbott wrote: >> On Mon, Oct 5, 2015 at 11:36 AM, Emil Velikov >> wrote: >>> Hi all, >>> >>> I am looking at ARB_shader_clock with i965 in mind. >>> >

Re: [Mesa-dev] [PATCH 02/10] nir: add NIR_H include guard

2015-10-07 Thread Connor Abbott
On Wed, Oct 7, 2015 at 7:59 AM, Emil Velikov wrote: > On 7 October 2015 at 12:27, Boyan Ding wrote: >> 2015-10-07 18:11 GMT+08:00 Emil Velikov : >>> We will reuse it in later commits, to check if other headers are >>> included from within nir.h. >>> >>> Signed-off-by: Emil Velikov >>> --- >>> s

Re: [Mesa-dev] [PATCH 4/6] nir: add shader_clock intrinsic

2015-10-07 Thread Connor Abbott
On Wed, Oct 7, 2015 at 7:51 AM, Emil Velikov wrote: > XXX: commit message, comment in nir_intrinsics.h > > Signed-off-by: Emil Velikov > --- > src/glsl/nir/glsl_to_nir.cpp | 6 ++ > src/glsl/nir/nir_intrinsics.h | 2 ++ > 2 files changed, 8 insertions(+) > > diff --git a/src/glsl/nir/glsl_t

Re: [Mesa-dev] [PATCH 4/6] nir: add shader_clock intrinsic

2015-10-07 Thread Connor Abbott
On Wed, Oct 7, 2015 at 4:48 PM, Emil Velikov wrote: > On 7 October 2015 at 18:04, Connor Abbott wrote: >> On Wed, Oct 7, 2015 at 7:51 AM, Emil Velikov >> wrote: >>> XXX: commit message, comment in nir_intrinsics.h >>> >>> Signed-off-by: Emil Velikov

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

2015-10-07 Thread Connor Abbott
On Wed, Oct 7, 2015 at 7:51 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_fs

Re: [Mesa-dev] [PATCH 4/6] nir: add shader_clock intrinsic

2015-10-08 Thread Connor Abbott
On Thu, Oct 8, 2015 at 6:54 AM, Emil Velikov wrote: > On 7 October 2015 at 23:50, Connor Abbott wrote: >> On Wed, Oct 7, 2015 at 4:48 PM, Emil Velikov >> wrote: >>> On 7 October 2015 at 18:04, Connor Abbott wrote: >>>> On Wed, Oct 7, 2015 at 7:51 AM,

Re: [Mesa-dev] [PATCH 4/6] nir: add shader_clock intrinsic

2015-10-08 Thread Connor Abbott
On Thu, Oct 8, 2015 at 8:54 AM, Emil Velikov wrote: > On 8 October 2015 at 11:54, Emil Velikov wrote: >> On 7 October 2015 at 23:50, Connor Abbott wrote: >>> On Wed, Oct 7, 2015 at 4:48 PM, Emil Velikov >>> wrote: >>>> On 7 October 2015 at 18:04, Co

Re: [Mesa-dev] [PATCH 4/6] nir: add shader_clock intrinsic

2015-10-08 Thread Connor Abbott
On Thu, Oct 8, 2015 at 10:09 AM, Emil Velikov wrote: > On 8 October 2015 at 14:20, Connor Abbott wrote: >> On Thu, Oct 8, 2015 at 6:54 AM, Emil Velikov >> wrote: >>> On 7 October 2015 at 23:50, Connor Abbott wrote: >>>> On Wed, Oct 7, 2015 at 4:48 PM, E

[Mesa-dev] [PATCH v3 4/7] nir: add an instruction set API

2015-10-08 Thread Connor Abbott
rces, use a VLA, store pointers to the sources, and compare the predecessor pointer directly (Jason). Signed-off-by: Connor Abbott --- Jason, does this look good to you? Still no piglit regressions -- I'm working on getting perf numbers. src/glsl/nir/n

Re: [Mesa-dev] [RFC] i965: alternative to memctx for cleaning up nir variants

2015-12-28 Thread Connor Abbott
On Mon, Dec 28, 2015 at 1:35 PM, Rob Clark wrote: > On Mon, Dec 28, 2015 at 12:37 PM, Connor Abbott wrote: >> On Mon, Dec 28, 2015 at 10:13 AM, Rob Clark wrote: >>> On Tue, Dec 22, 2015 at 10:11 PM, Connor Abbott wrote: >>>> On Tue, Dec 22, 2015 at 9:55 PM, Rob C

Re: [Mesa-dev] [PATCH v2 11/12] nir: Add return lowering pass

2015-12-28 Thread Connor Abbott
t; + return false; > + > + if (last_instr->type != nir_instr_type_jump) > + return false; > + > + nir_jump_instr *jump = nir_instr_as_jump(last_instr); > + if (jump->type != nir_jump_return) > + return false; > + > + nir_builder *b = &state->bu

Re: [Mesa-dev] [RFC] i965: alternative to memctx for cleaning up nir variants

2015-12-28 Thread Connor Abbott
On Mon, Dec 28, 2015 at 3:31 PM, Rob Clark wrote: > On Mon, Dec 28, 2015 at 1:58 PM, Connor Abbott wrote: >> On Mon, Dec 28, 2015 at 1:35 PM, Rob Clark wrote: >>> On Mon, Dec 28, 2015 at 12:37 PM, Connor Abbott wrote: >>>> On Mon, Dec 28, 2015 at 10:13 AM, Rob C

Re: [Mesa-dev] [RFC] i965: alternative to memctx for cleaning up nir variants

2015-12-28 Thread Connor Abbott
gt; > >>> > >>> > On Mon, Dec 28, 2015 at 9:37 AM, Connor Abbott >>> > wrote: >>> >> >>> >> On Mon, Dec 28, 2015 at 10:13 AM, Rob Clark >>> >> wrote: >>> >> > On Tue, Dec 22, 2015 at 10:11 PM,

Re: [Mesa-dev] [PATCH v2 11/12] nir: Add return lowering pass

2015-12-28 Thread Connor Abbott
On Mon, Dec 28, 2015 at 4:21 PM, Jason Ekstrand wrote: >> >> >> but I hope you can get loops working soon so you can test this (and >> hey, loops are useful for other things too :P). > > > Yeah, I'm starting on adding a real CFG to spirv_to_nir today. It's the > task that I've had on my todo list

Re: [Mesa-dev] [PATCH v2 11/12] nir: Add return lowering pass

2015-12-28 Thread Connor Abbott
On Mon, Dec 28, 2015 at 5:02 PM, Jason Ekstrand wrote: > > > On Mon, Dec 28, 2015 at 1:28 PM, Connor Abbott wrote: >> >> On Mon, Dec 28, 2015 at 4:21 PM, Jason Ekstrand >> wrote: >> >> >> >> >> >> but I hope you can get loops wor

Re: [Mesa-dev] [PATCH] nir/builder: Add an init function that creates a simple shader for you

2015-12-29 Thread Connor Abbott
well > as tgsi_to_nir and prog_to_nir. Reviewed-by: Connor Abbott > --- > src/gallium/auxiliary/nir/tgsi_to_nir.c | 12 > src/glsl/nir/nir_builder.h| 11 +++ > src/glsl/nir/tests/control_flow_tests.cpp | 26 ++ > src

Re: [Mesa-dev] [RFC] i965: alternative to memctx for cleaning up nir variants

2015-12-31 Thread Connor Abbott
On Thu, Dec 31, 2015 at 10:16 AM, Rob Clark wrote: > On Tue, Dec 29, 2015 at 10:32 AM, Rob Clark wrote: > If you do this, you'll be back to always needing a mutable copy. Most > lowering and optimization passes die the moment they see a register. > You'll > either have to go fi

Re: [Mesa-dev] [PATCH] nv50/ir: replace the right def in global cse

2016-01-11 Thread Connor Abbott
On Mon, Jan 11, 2016 at 11:44 PM, Ilia Mirkin wrote: > Actually this is still a little bogus... We'd have to ensure that > *all* of the defs are used in this bb or later. I'll try to come up > with something that still maintains some of the potential benefit but > is correct. I don't know about t

Re: [Mesa-dev] NIR, SCons, and Gallium

2016-01-11 Thread Connor Abbott
On Mon, Jan 11, 2016 at 9:21 AM, Jose Fonseca wrote: > FWIW, I updated SCons to build NIR, both with GCC and MSVC: > > http://cgit.freedesktop.org/~jrfonseca/mesa/log/?h=scons-nir > > It was actually simpler than I anticipated. > > But I hit a wall -- there's actually no way to get NIR used with

Re: [Mesa-dev] [PATCH 8/9] nir: Add code to fixup bitfield_insert/extract.

2016-01-11 Thread Connor Abbott
On Tue, Jan 12, 2016 at 12:54 AM, Matt Turner wrote: > On Mon, Jan 11, 2016 at 6:58 PM, Jason Ekstrand wrote: >> >> On Jan 11, 2016 2:47 PM, "Matt Turner" wrote: >>> >>> The OpenGL specifications for bitfieldInsert() and bitfieldExtract() says: >>> >>>The result will be undefined if or is

Re: [Mesa-dev] [PATCHv3 3/9] glsl, nir: Make ir_quadop_bitfield_insert a vectorized operation.

2016-01-12 Thread Connor Abbott
On Mon, Jan 11, 2016 at 7:20 PM, Ilia Mirkin wrote: > On Mon, Jan 11, 2016 at 7:12 PM, Matt Turner wrote: >> From: Kenneth Graunke >> >> We would like to be able to combine >> >>result.x = bitfieldInsert(src0.x, src1.x, src2.x, src3.x); >>result.y = bitfieldInsert(src0.y, src1.y, src2.y,

Re: [Mesa-dev] [PATCH 1/9] nir: Fix constant evaluation of bfm.

2016-01-12 Thread Connor Abbott
On Mon, Jan 11, 2016 at 6:52 PM, Ian Romanick wrote: > On 01/11/2016 02:48 PM, Matt Turner wrote: >> NIR's bfm, like Intel/AMD's hardware instructions and GLSL IR's >> ir_binop_bfm takes as src0 and as src1. > > All the questions... > > Is the ordering of the operands documented anywhere? I was

Re: [Mesa-dev] [PATCH 1/2] nir: Handle =32 case in bitfield_insert lowering.

2016-01-13 Thread Connor Abbott
Both are Reviewed-by: Connor Abbott On Wed, Jan 13, 2016 at 2:25 PM, Matt Turner wrote: > The OpenGL specifications for bitfieldInsert() says: > >The result will be undefined if or is negative, or if >the sum of and is greater than the number of bits >used to st

Re: [Mesa-dev] [RFCv3 03/11] nir: add helper to calculate type size

2016-02-01 Thread Connor Abbott
A few things: - How much work would it take to actually deduplicate this with the other vec4 type_size implementations out there? I'm pretty sure no one would object to it, and if we just leave this as a TODO it probably won't actually get done. - Having to include nir_types.h in something that ha

Re: [Mesa-dev] [RFCv3 05/11] nir: add lowering pass for y-transform

2016-02-01 Thread Connor Abbott
On Sun, Jan 31, 2016 at 3:16 PM, Rob Clark wrote: > From: Rob Clark > > Signed-off-by: Rob Clark > --- > src/compiler/Makefile.sources| 1 + > src/compiler/nir/nir.h | 12 + > src/compiler/nir/nir_lower_wpos_ytransform.c | 317 >

Re: [Mesa-dev] [RFCv3 08/11] gallium/auxiliary: introduce nir_emulate

2016-02-01 Thread Connor Abbott
This doesn't really seem to be following NIR's convention/style of having separate passes/files for each thing that needs to be lowered. This might've made sense for TGSI, where there was a lot of boilerplate that each thing needed since TGSI isn't designed for doing transforms on it, but with NIR

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