[Mesa-dev] [PATCH v2 05/14] nir: fix up phi nodes when removing cf nodes

2015-05-21 Thread Connor Abbott
updating phi sources. There's one somewhat unrelated fix to stitch_blocks() snuck in, where we weren't updating the successors correctly if the earlier block had a jump, but a lot of the logic for it overlaps with the phi node changes and it seemed hard to split it out so I've left it i

[Mesa-dev] [PATCH v2 02/14] nir: insert ssa_undef instructions when cleaning up defs/uses

2015-05-21 Thread Connor Abbott
e. In that case, the value that any uses get is undefined since the instruction never actually executes, so we can just replace the instruction with an ssa_undef_instr. v2: split out other fixes Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 38 -- 1

[Mesa-dev] [PATCH v2 08/14] nir: add an optimization for removing dead control flow

2015-05-21 Thread Connor Abbott
) that I'd rather not expose publically. v2: use nir_cf_node_remove_after() instead of our own broken thing. Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 26 src/glsl/nir/nir.h | 7 +++ src/glsl/nir/nir_opt_

[Mesa-dev] [PATCH v2 04/14] nir: properly clean up jumps when removing cf nodes

2015-05-21 Thread Connor Abbott
Before, we might have left dangling predecessors from jumps that were going to be removed. v2: split out from "nir: insert ssa_undef instructions when cleaning up defs/uses" Signed-off-by: Connor Abbott --- src/glsl/nir/nir.c | 10 -- 1 file changed, 8 insertions(+), 2

[Mesa-dev] [PATCH v2 10/14] nir: add nir_block_get_following_loop() helper

2015-05-21 Thread 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 79c4a4a..cbee507 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -2242,6 +2242,22

[Mesa-dev] [PATCH v2 12/14] nir/dead_cf: add support for removing useless loops

2015-05-21 Thread Connor Abbott
-by: Connor Abbott --- src/glsl/nir/nir_opt_dead_cf.c | 121 + 1 file changed, 109 insertions(+), 12 deletions(-) diff --git a/src/glsl/nir/nir_opt_dead_cf.c b/src/glsl/nir/nir_opt_dead_cf.c index d71538c..a8d438f 100644 --- a/src/glsl/nir/nir_opt_dead_cf.c

[Mesa-dev] [PATCH v2 14/14] XXX disable opt_if_simplification

2015-05-21 Thread 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 be6713c..42e9b49 100644 --- a/src/glsl

[Mesa-dev] [PATCH v2 09/14] nir/dead_cf: delete code that's unreachable due to jumps

2015-05-21 Thread Connor Abbott
v2: use nir_cf_node_remove_after(). v2: use foreach_list_typed() instead of hardcoding a list walk. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_dead_cf.c | 123 ++--- 1 file changed, 115 insertions(+), 8 deletions(-) diff --git a/src/glsl/nir

[Mesa-dev] [PATCH v2 11/14] nir: add a helper for iterating over blocks in a cf node

2015-05-21 Thread 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/src/glsl/nir/nir.c

[Mesa-dev] [PATCH v2 13/14] i965/fs/nir: enable the dead control flow optimization

2015-05-21 Thread Connor Abbott
Doesn't do anything on the public shader-db. Signed-off-by: Connor Abbott --- src/glsl/Makefile.sources | 1 + src/mesa/drivers/dri/i965/brw_nir.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index d784a81..7bdd895 1

Re: [Mesa-dev] [PATCH v2 03/14] nir: cleanup cf nodes earlier in nir_cf_node_remove()

2015-05-21 Thread Connor Abbott
On Thu, May 21, 2015 at 12:54 PM, Matt Turner wrote: > On Thu, May 21, 2015 at 9:40 AM, Connor Abbott wrote: >> Before, when we were deleting a cf node that was a block, we were first >> removing all the instructions and then calling cleanup_cf_node(), at >> which

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

2015-05-21 Thread Connor Abbott
dead, and this patch combined with my nir-dead-cf-v4 branch will cause the loop to be deleted entirely. No piglit regressions. Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_remove_phis.c | 20 1 file changed, 20 insertions(+) diff --git a/src/glsl/nir/nir_opt_remov

Re: [Mesa-dev] [v3 PATCH 01/10] mesa:Define extension ARB_framebuffer_no_attachments

2015-05-21 Thread Connor Abbott
On Thu, May 21, 2015 at 8:05 PM, Rogovin, Kevin wrote: > >> This line is too long. (It will not fit in 80 columns in git log since git >> log adds some spaces before each commit message line.) > > What is the accepted maximum length for a line in a commit message? > >>> - extension table >>> -

Re: [Mesa-dev] [v3 PATCH 01/10] mesa:Define extension ARB_framebuffer_no_attachments

2015-05-21 Thread Connor Abbott
On Thu, May 21, 2015 at 8:40 PM, Rogovin, Kevin wrote: > > >> I suppose it could be useful, but I think we've been mostly successful at >> just expecting people to recognize when what they're writing doesn't look >> like the code around it. > > This is my point. Older code had different style/ex

Re: [Mesa-dev] [v3 PATCH 01/10] mesa:Define extension ARB_framebuffer_no_attachments

2015-05-21 Thread Connor Abbott
On Thu, May 21, 2015 at 8:51 PM, Rogovin, Kevin wrote: > >> FWIW, the kernel standards for commit messages are at: >> https://www.kernel.org/doc/Documentation/SubmittingPatches >> Most of those rules apply to Mesa too. It says the body should be wrapped to >> 75 chars (although I've been using 72

[Mesa-dev] [PATCH 5/5] nir/cse: use the instr_hash helper

2015-05-22 Thread Connor Abbott
t, pooled s = 0.332763) Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_cse.c | 134 - 1 file changed, 24 insertions(+), 110 deletions(-) diff --git a/src/glsl/nir/nir_opt_cse.c b/src/glsl/nir/nir_opt_cse.c index a6a4a21..7894147 100644 --- a/sr

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

2015-05-22 Thread Connor Abbott
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 and move nir_srcs_equal() there too. Signed-off-by: Connor Abbott --- src/glsl/Makefile.sources| 1 + src/glsl/nir/nir.c | 27 --

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

2015-05-22 Thread Connor Abbott
This can be used for both CSE and value numbering. Signed-off-by: Connor Abbott --- src/glsl/Makefile.sources | 2 + src/glsl/nir/nir_instr_hash.c | 255 ++ src/glsl/nir/nir_instr_hash.h | 36 ++ 3 files changed, 293 insertions(+) create mode

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

2015-05-22 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 f04195f..e3b7b17 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 3/5] nir: constify instruction comparison functions

2015-05-22 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/glsl/nir/nir.h | 4 ++-- src/glsl/nir/nir_instr_compare.c | 8 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index e3b7b17..19b1e18 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl

[Mesa-dev] [PATCH 0/5] NIR CSE performance improvements

2015-05-22 Thread Connor Abbott
almost all the time spent in nir_optimize() to less than half (but still a significant amount). This series is also available at git://people.freedesktop.org/~cwabbott0/mesa nir-cse-hash Connor Abbott (5): nir: split out instruction comparison functions nir: constify nir_ssa_alu_instr_src_

Re: [Mesa-dev] Ideas on loop unrolling, loop examples, and my GSoC-blog

2015-05-29 Thread Connor Abbott
On Fri, May 29, 2015 at 6:23 AM, Eero Tamminen wrote: > Hi, > > On 05/28/2015 10:19 PM, Thomas Helland wrote: >> >> One more thing; >> Is there a limit where the loop body gets so large that we >> want to decide that "gah, this sucks, no point in unrolling this"? >> I imagine as the loops get larg

Re: [Mesa-dev] [PATCH 2/2] nir: use src for ssa helper

2015-06-02 Thread Connor Abbott
Both are Reviewed-by: Connor Abbott On Tue, Jun 2, 2015 at 5:37 AM, Timothy Arceri wrote: > --- > src/glsl/nir/glsl_to_nir.cpp | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp > inde

[Mesa-dev] NIR documentation

2015-06-04 Thread Connor Abbott
Hi, Over the past few weeks or so, I've been sitting down and writing some documentation on how NIR, and especially the core NIR datastructures, works. At this point I think it's reasonably complete, although I've probably forgotten something that I should mention, and one thing that's missing for

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

2015-06-05 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 --- I haven't tested this, although it shouldn't affect anything other than the c

Re: [Mesa-dev] [v4 PATCH 00/10] Implement extension ARB_framebuffer_no_attachments

2015-06-09 Thread Connor Abbott
On Tue, Jun 9, 2015 at 3:06 PM, Ian Romanick wrote: > I've sent out review for all of the patches that don't already have R-b > on them. Before pushing, you should double check the whitespace. In > particular, it's hard to notice tabs and trailing whitespace when > reviewing. If you do 'git sho

Re: [Mesa-dev] [PATCH 00/41] Welcome back Matt!

2014-09-23 Thread Connor Abbott
On Tue, Sep 23, 2014 at 2:43 PM, Matt Turner wrote: > On Sat, Sep 20, 2014 at 10:22 AM, Jason Ekstrand wrote: >> This series does a bunch of refactoring of the i965 fs backend IR to add >> concepts of register width and instruction execution size. There's more to >> be done yet, but this gets us

Re: [Mesa-dev] [PATCH 15/16] i965/skl: Use new MOCS for SKL

2014-09-24 Thread Connor Abbott
On Wed, Sep 24, 2014 at 7:13 PM, Kristian Høgsberg wrote: > On Wed, Sep 24, 2014 at 12:57 PM, Kenneth Graunke > wrote: >> On Wednesday, September 24, 2014 12:28:20 PM Kristian Høgsberg wrote: >> >>> On Skylake, the MOCS bits are an index into a table of 63 different, >> >>> configurable cache co

Re: [Mesa-dev] [PATCH v2] glsl: Optimize min/max expression trees

2014-09-26 Thread Connor Abbott
On Fri, Sep 26, 2014 at 9:02 AM, Iago Toral Quiroga wrote: > Original patch by Petri Latvala : > > Add an optimization pass that drops min/max expression operands that > can be proven to not contribute to the final result. The algorithm is > similar to alpha-beta pruning on a minmax search, from t

Re: [Mesa-dev] [PATCH v3] glsl: Optimize min/max expression trees

2014-09-29 Thread Connor Abbott
Eliminate minmax expressions operating on constant vectors with mixed values > by resolving them. > > No piglit regressions observed with Version 3. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76861 > --- > > Version 3 passes all minmax unit tests sent in the or

Re: [Mesa-dev] [PATCH 3/6] i965/fs: Allow SIMD16 borrow/carry/64-bit multiply on Gen > 7.

2014-09-29 Thread Connor Abbott
On Sun, Sep 28, 2014 at 4:26 PM, Matt Turner wrote: > These checks were intended for Gen 7 only. None of these restrictions > apply to Gen 8. > --- > src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/mesa/drivers/dri/i9

Re: [Mesa-dev] [PATCH 3/3] i965/fs: Compute q-values for register allocation manually

2014-10-03 Thread Connor Abbott
On Fri, Oct 3, 2014 at 10:03 PM, Jason Ekstrand wrote: > Previously, we were allowing the register allocation code to do the > computation for us in ra_set_finalize. However, the runtime for this > computation is O(c^4 * g) where c is the number of classes and g is the > number of GRF registers.

Re: [Mesa-dev] [PATCH 3/4] i965/fs: Don't interfere with too many base registers

2014-10-08 Thread Connor Abbott
On Tue, Oct 7, 2014 at 4:33 AM, Jason Ekstrand wrote: > On older GENs in SIMD16 mode, we were accidentally building too much > interference into our register classes. Since everything is divided by 2, > the reigster allocator thinks we have 64 base registers instead of 128. > The actual GRF mappi

Re: [Mesa-dev] [PATCH 17/17] i965/fs: don't make a fake ir_texture in the Mesa IR frontend

2014-10-14 Thread Connor Abbott
On Tue, Oct 14, 2014 at 12:54 AM, Kenneth Graunke wrote: > From: Connor Abbott > > Now that we've made all the texture emit code mostly independent of GLSL > IR, this isn't necessary any more. > > Signed-off-by: Connor Abbott > Reviewed-by: Kenneth Graunke >

Re: [Mesa-dev] [RFC 0/9] i965/fs: Combine constants and unconditionally emit MADs

2014-10-31 Thread Connor Abbott
On Fri, Oct 31, 2014 at 9:27 PM, Matt Turner wrote: > Three-source instructions on i965 have an annoying property that they > cannot use immediate operands. They've do have the alluring property > that they perform multiple operations in basically the same number of > cycles as any other instructi

Re: [Mesa-dev] [RFC 7/9] i965/fs: Add pass to combine immediates.

2014-10-31 Thread Connor Abbott
On Fri, Oct 31, 2014 at 9:27 PM, Matt Turner wrote: > --- > src/mesa/drivers/dri/i965/Makefile.sources | 1 + > src/mesa/drivers/dri/i965/brw_fs.cpp | 2 + > src/mesa/drivers/dri/i965/brw_fs.h | 1 + > .../drivers/dri/i965/brw_fs_combine_constants.cpp

Re: [Mesa-dev] [RFC 7/9] i965/fs: Add pass to combine immediates.

2014-11-01 Thread Connor Abbott
On Sat, Nov 1, 2014 at 5:36 PM, Matt Turner wrote: > On Fri, Oct 31, 2014 at 7:35 PM, Connor Abbott wrote: >> On Fri, Oct 31, 2014 at 9:27 PM, Matt Turner wrote: >>> --- >>> src/mesa/drivers/dri/i965/Makefile.sources | 1 + >>> src/mesa/drivers/dri

Re: [Mesa-dev] [PATCH] glsl/list: Add a foreach_list_typed_safe_reverse macro

2014-11-07 Thread Connor Abbott
FWIW, Ian commented on my patch to add foreach_list_typed_reverse that we shouldn't merge it until it had users so people wouldn't try to remove it -- it seems like this has the same issue. So either merge both of them at the same time, or neither until NIR gets merged... Connor On Fri, Nov 7, 2

Re: [Mesa-dev] [PATCH v2 13/16] i965: Move fs_visitor ra pass to new fs_visitor::allocate_registers()

2014-11-13 Thread Connor Abbott
On Thu, Nov 13, 2014 at 7:28 PM, Kristian Høgsberg wrote: > This will be reused for the scalar VS pass. > > Signed-off-by: Kristian Høgsberg > --- > src/mesa/drivers/dri/i965/brw_fs.cpp | 132 > +++ > src/mesa/drivers/dri/i965/brw_fs.h | 1 + > 2 files change

Re: [Mesa-dev] [PATCH] util/hash_table: Rework the API to know about hashing

2014-11-24 Thread Connor Abbott
On Tue, Nov 25, 2014 at 1:19 AM, Jason Ekstrand wrote: > Previously, the hash_table API required the user to do all of the hashing > of keys as it passed them in. Since the hashing function is intrinsicly > tied to the comparison function, it makes sense for the hash table to know > about it. Al

Re: [Mesa-dev] [PATCH v2 1/2] util: Fix foreach_list_typed_safe when exec_node is not at offset 0.

2015-03-11 Thread Connor Abbott
nt struct. > > v1 Reviewed-by: Kenneth Graunke > v1 Reviewed-by: Connor Abbott > > v2: Jason Ekstrand : >Use "(__node)->__field.next != NULL" to check for the end of the list >instead of the "&__next->__field != NULL". The former is far

Re: [Mesa-dev] [PATCH 7/9] i965/fs: Handle VS inputs in the NIR backend.

2015-03-11 Thread Connor Abbott
On Wed, Mar 11, 2015 at 6:28 PM, Jason Ekstrand wrote: > I think I mentioned this at least once before, but I don't think that this > is a good long-term solution. The nir_lower_io function does two things > primarily. 1) It assigns each variable a "device location" and 2) changes > the variable

Re: [Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2015-03-14 Thread Connor Abbott
On Fri, Mar 13, 2015 at 6:37 PM, Thomas Helland wrote: > This should give better cache locality, less memory consumption, > and should also be faster since we avoid a modulo operation. > Also change table size to be power of two. > This gives better performance as we can do bitmasking instead of >

Re: [Mesa-dev] [PATCH 3/4] util: Change util/set to use quadratic probing

2015-03-14 Thread Connor Abbott
On Fri, Mar 13, 2015 at 6:37 PM, Thomas Helland wrote: > The same rationale applies here as for the hash table. > Power of two size should give better performance, > and using the algorithm hash = sh + i/2 + i*i/2 > should result in only distinct hash values when hitting collisions. > Should give

Re: [Mesa-dev] [PATCH 2/4] util: Change hash_table to use quadratic probing

2015-03-14 Thread Connor Abbott
On Sun, Mar 15, 2015 at 1:25 AM, Connor Abbott wrote: > On Fri, Mar 13, 2015 at 6:37 PM, Thomas Helland > wrote: >> This should give better cache locality, less memory consumption, >> and should also be faster since we avoid a modulo operation. >> Also change table

Re: [Mesa-dev] [PATCH 0/4] Hash table and hash set speedup, second take

2015-03-15 Thread Connor Abbott
On Sun, Mar 15, 2015 at 1:50 PM, Thomas Helland wrote: > 2015-03-15 16:47 GMT+01:00 Thomas Helland : >> 2015-03-13 23:37 GMT+01:00 Thomas Helland : >>> So here comes the second version of this series. >>> I found a way to exercise the bug in the previous series. >>> This makes the test fail where

Re: [Mesa-dev] [PATCH 3/4] util: Change util/set to use quadratic probing

2015-03-15 Thread Connor Abbott
Ok, so I think I managed to find the source of the bug. When inserting elements into the set/hash table, we computed the initial probe address *before* doing the rehash. In the case where inserting an element led to a rehash, this meant that we'd use the wrong starting address when actually inserti

Re: [Mesa-dev] [PATCH 1/3] nir/peephole_select: Rename are_all_move_to_phi and use a switch

2015-03-16 Thread Connor Abbott
n false; >} > } > > @@ -120,7 +125,8 @@ nir_opt_peephole_select_block(nir_block *block, void > *void_state) > nir_block *else_block = nir_cf_node_as_block(else_node); > > /* ... and those blocks must only contain move-to-phi. */ You should ch

Re: [Mesa-dev] [PATCH 1/3] nir/peephole_select: Rename are_all_move_to_phi and use a switch

2015-03-16 Thread Connor Abbott
On Mon, Mar 16, 2015 at 10:08 PM, Jason Ekstrand wrote: > On Mon, Mar 16, 2015 at 6:52 PM, Connor Abbott wrote: >> On Mon, Mar 16, 2015 at 9:23 PM, Jason Ekstrand wrote: >>> --- >>> src/glsl/nir/nir_opt_peephole_select.c | 54 >>> +++---

Re: [Mesa-dev] [PATCH 5/9] i965/nir: Emit MUL + ADD for MAD on GEN <= 5

2015-03-17 Thread Connor Abbott
Instead of doing this, I think it would be better to add something to nir_shader_compiler_options and do it in nir_opt_algebraic, similar to what Eric has already done for other things. I've seen some shaders where we transform a mul + a series of adds into a series of mad's, which is good on gen6+

Re: [Mesa-dev] [PATCH 9/9] i965: Use NIR by default for Fragment shaders on SNB+

2015-03-18 Thread Connor Abbott
On Wed, Mar 18, 2015 at 1:56 AM, Matt Turner wrote: > Thanks. Looked through stats and at some of the regressions. > > Some of the areas I noticed we were doing worse: > > We generate two CMPs for discard_if; only one without NIR. I think you > had an idea about solving this. > > SEL peephole inte

Re: [Mesa-dev] [PATCH 9/9] i965: Use NIR by default for Fragment shaders on SNB+

2015-03-18 Thread Connor Abbott
On Wed, Mar 18, 2015 at 11:27 AM, Jason Ekstrand wrote: > On Wed, Mar 18, 2015 at 7:22 AM, Connor Abbott wrote: >> On Wed, Mar 18, 2015 at 1:56 AM, Matt Turner wrote: >>> Thanks. Looked through stats and at some of the regressions. >>> >>> Some of the

Re: [Mesa-dev] Summer of Code ideas (maybe just an idea wishlist?)

2015-03-18 Thread Connor Abbott
On Wed, Mar 18, 2015 at 2:58 PM, Matt Turner wrote: > On Thu, Mar 12, 2015 at 9:46 PM, Matt Turner wrote: >> Here are some ideas I think might be reasonable GSoC ideas. >> >> - GLSL linking in NIR >> - Would allow us to stop doing optimizations and other expensive >> things on GLSL IR > > I

Re: [Mesa-dev] [PATCH 1/4] nir: Use a list instead of a hash_table for inputs, outputs, and uniforms

2015-03-18 Thread Connor Abbott
Reviewed-by: Connor Abbott A case of premature optimization I guess... I think I did it for linking, but we'll cross that bridge when we come to it. On Wed, Mar 18, 2015 at 7:45 PM, Jason Ekstrand wrote: > We never did a single hash table lookup in the entire NIR code base that I &g

Re: [Mesa-dev] [PATCH 7/9] i965: Add a NIR analysis pass for determining when a boolean resolve is needed

2015-03-18 Thread Connor Abbott
Overall, I think it might be better to do this as a SSA pass right before lowering to source modifiers. I don't think we would be running any optimizations after it that depend on the output being all 0's or all 1's, but if you're concerned about that then we could add separate gen5-compare compare

Re: [Mesa-dev] [PATCH 1/5] glsl: Allow vector logic ops to be generated.

2015-03-18 Thread Connor Abbott
So in GLSL, add and mul can take a combination of a scalar and a vector, and it'll splat the scalar automatically, and with this this series that means that and/or can now take a combination of a scalar and a vector as well, and we'll have to splat them as well. Are you sure that the various backen

Re: [Mesa-dev] [PATCH 7/9] i965: Add a NIR analysis pass for determining when a boolean resolve is needed

2015-03-18 Thread Connor Abbott
On Wed, Mar 18, 2015 at 9:10 PM, Jason Ekstrand wrote: > On Wed, Mar 18, 2015 at 6:07 PM, Connor Abbott wrote: >> Overall, I think it might be better to do this as a SSA pass right >> before lowering to source modifiers. I don't think we would be running >> any optimiza

Re: [Mesa-dev] [PATCH 2/4] nir/lower_io: Make variable location assignment a manual operation

2015-03-18 Thread Connor Abbott
c4 "packed" means a different thing usually. Otherwise, the series is Reviewed-by: Connor Abbott On Wed, Mar 18, 2015 at 7:45 PM, Jason Ekstrand wrote: > Previously, we just assigned variable locations in nir_lower_io. Now, we > force the user to assign variable locations for u

Re: [Mesa-dev] [PATCH 5/9] i965/nir: Emit MUL + ADD for MAD on GEN <= 5

2015-03-18 Thread Connor Abbott
On Wed, Mar 18, 2015 at 11:24 PM, Kenneth Graunke wrote: > On Tuesday, March 17, 2015 07:17:19 PM Jason Ekstrand wrote: >> --- >> src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 8 +++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp >

Re: [Mesa-dev] [PATCH 4/5] nir: Recognize mul(b2f(a), b2f(b)) as a logical AND.

2015-03-18 Thread Connor Abbott
On Wed, Mar 18, 2015 at 11:35 PM, Jason Ekstrand wrote: > > On Mar 18, 2015 8:32 PM, "Matt Turner" wrote: >> >> On Wed, Mar 18, 2015 at 7:39 PM, Jason Ekstrand >> wrote: >> > On Wed, Mar 18, 2015 at 11:37 AM, Matt Turner >> > wrote: >> >> Transform this into b2f(and(a, b)). >> >> >> >> total in

Re: [Mesa-dev] [PATCH 4/5] nir: Recognize mul(b2f(a), b2f(b)) as a logical AND.

2015-03-18 Thread Connor Abbott
On Thu, Mar 19, 2015 at 12:35 AM, Jason Ekstrand wrote: > On Wed, Mar 18, 2015 at 9:31 PM, Matt Turner wrote: >> On Wed, Mar 18, 2015 at 9:27 PM, Jason Ekstrand wrote: >>> On Wed, Mar 18, 2015 at 8:59 PM, Connor Abbott wrote: >>>> On Wed, Mar 18, 2015 at 11:35 P

[Mesa-dev] [PATCH] i965/fs: bail on move-to-flag in sel peephole

2015-03-19 Thread Connor Abbott
Fixes a piglit regression (shaders/glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined) with my series for GVN. Signed-off-by: Connor Abbott --- I think this particular case might not trigger anymore after Matt's patch to improve cmod prop since we're better at getting rid of m

Re: [Mesa-dev] [PATCH 03/11] nir: Add barrier intrinsic function

2015-03-22 Thread Connor Abbott
Reviewed-by: Connor Abbott On Sun, Mar 22, 2015 at 9:49 PM, Jordan Justen wrote: > Signed-off-by: Jordan Justen > Reviewed-by: Chris Forbes > --- > src/glsl/nir/glsl_to_nir.cpp | 4 +++- > src/glsl/nir/nir_intrinsics.h | 1 + > 2 files changed, 4 insertions(+), 1 deletion

Re: [Mesa-dev] [PATCH v3 5/7] i965: Add a NIR analysis pass for determining when a boolean resolve is needed

2015-03-22 Thread Connor Abbott
; + > + case nir_op_imov: > + case nir_op_inot: > +if (alu->dest.write_mask == 1) { > + /* This is a single-source instruction. Just copy the > + * resolve status from the source. > +*/ > +

Re: [Mesa-dev] [PATCH] nir: Handle vector arguments to logical and/or/xor.

2015-03-24 Thread Connor Abbott
We could already handle vector arguments to these -- we just couldn't handle mixed scalar and vector arguments. So change the commit message to something like "nir: Handle mixed scalar/vector arguments to logical and/or/xor." and fix the typo and then this is Reviewed-by: Connor

Re: [Mesa-dev] [PATCH 2/6] nir: Implement a Mesa IR -> NIR translator.

2015-03-24 Thread Connor Abbott
On Mon, Mar 23, 2015 at 8:37 PM, Kenneth Graunke wrote: > Shamelessly ripped off from Eric Anholt's tgsi_to_nir pass. > > Not compiled on SCons, like the rest of NIR. > > Signed-off-by: Kenneth Graunke > --- > src/mesa/Makefile.am|2 + > src/mesa/Makefile.sources |

Re: [Mesa-dev] [PATCH 7/9] nir/peephole_ffma: Be less agressive about fusing multiply-adds

2015-03-24 Thread Connor Abbott
I think this is being both too aggressive and not aggressive enough. First, the too aggressive part. Imagine if we have something like: a = mul b, c; d = add a, 1.0; e = add a, 2.0; f = add a, 3.0; In this case, we don't want to turn this into a series of 3 mad's since the 3 load immediate instru

Re: [Mesa-dev] [PATCH 3/6] i965/fs: Implement nir_opcode_fsub/isub support.

2015-03-24 Thread Connor Abbott
We already have a lower_negate compiler option, so I think it would be better to add the 1 line of code to lower sub -> neg predicated on !lower_neg to nir_opt_algebraic. On Mon, Mar 23, 2015 at 8:37 PM, Kenneth Graunke wrote: > prog_to_nir uses this for OPCODE_SUB. > > Signed-off-by: Kenneth Gra

Re: [Mesa-dev] [PATCH] nir: Add optional lowering of flrp.

2015-03-25 Thread Connor Abbott
Reviewed-by: Connor Abbott We should probably use this for Gen4-5 too. On Wed, Mar 25, 2015 at 5:11 PM, Eric Anholt wrote: > --- > > I missed this one when I was doing my other lowering bits. I don't > have ffma, and I certainly don't have flrp. > > src/gallium/d

Re: [Mesa-dev] [PATCH v2 6/6] i965/nir: Use NIR for ARB_vertex_program support on Gen8+.

2015-03-25 Thread Connor Abbott
On Wed, Mar 25, 2015 at 7:21 PM, Kenneth Graunke wrote: > Everything is already in place; we simply have to take the scalar code > generation path. This gives us SIMD8 VS programs, instead of SIMD4x2. > > v2: Rebase on the patch that drops brw->gen >= 8. > > Signed-off-by: Kenneth Graunke > Revi

Re: [Mesa-dev] [PATCH v2 1/6] nir: Add nir_builder helpers for creating load_const intrinsics.

2015-03-25 Thread Connor Abbott
Except for one comment on patch 6, patches 1-2 and 4-6 are Reviewed-by: Connor Abbott I don't know enough about Mesa IR to fully review patch 3, although on a quick read-through I couldn't find anything to improve. On Wed, Mar 25, 2015 at 7:21 PM, Kenneth Graunke wrote: > Both

Re: [Mesa-dev] [PATCH 0/3] Hash-table improvements, V3

2015-03-29 Thread Connor Abbott
+), 153 deletions(-) > > -- > 2.3.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev I don't see any performance data on each commit, did

Re: [Mesa-dev] Good compiler literature?

2015-03-29 Thread Connor Abbott
On Sun, Mar 29, 2015 at 5:54 PM, Thomas Helland wrote: > Does anyone have suggestions for good literature on compilers? > Since GPU's and CPU's are a bit different there are probably > books that are better suited than others for GPUs? > I have what is probably Norway's biggest library on the subj

Re: [Mesa-dev] Good compiler literature?

2015-03-29 Thread Connor Abbott
On Sun, Mar 29, 2015 at 9:51 PM, Connor Abbott wrote: > On Sun, Mar 29, 2015 at 5:54 PM, Thomas Helland > wrote: >> Does anyone have suggestions for good literature on compilers? >> Since GPU's and CPU's are a bit different there are probably >> books that are

Re: [Mesa-dev] [PATCH 1/2] nir: Recognize a pattern for doing b2f without the opcode.

2015-03-30 Thread Connor Abbott
Series is Reviewed-by: Connor Abbott On Mon, Mar 30, 2015 at 1:12 PM, Eric Anholt wrote: > Since we have patterns based on b2f, generate them if we see the b2f > equivalent using an iand. This is common when generating NIR from TGSI. > --- > src/glsl/nir/nir_opt_algebraic.py | 1

Re: [Mesa-dev] [PATCH 4/4] RFC: nir: add lowering for idiv/udiv/umod

2015-03-31 Thread Connor Abbott
On Tue, Mar 31, 2015 at 6:57 PM, Rob Clark wrote: > From: Rob Clark > > Based on the algo from NV50LegalizeSSA::handleDIV() and handleMOD(). > See also trans_idiv() in freedreno/ir3/ir3_compiler.c (which was an > adaptation of the nv50 code from Ilia). > > Just sending as an rfc right now, since

[Mesa-dev] [PATCH] nir: add support for structured COME FROM

2015-04-01 Thread Connor Abbott
Unfortunately, we can't support unstructured COME FROM yet, since we can't structurize arbitrary control flow graphs. Also TODO is adding support for threading by having multiple come_from's point to the same unconditional branch, as well as various other INTERCAL features. Signed

[Mesa-dev] [PATCH] nir: add support for structured COME FROM

2015-04-01 Thread Connor Abbott
Unfortunately, we can't support unstructured COME FROM yet, since we can't structurize arbitrary control flow graphs. Also TODO is adding support for threading by having multiple come_from's point to the same unconditional branch, as well as various other INTERCAL features. Signed

Re: [Mesa-dev] Mesa (master): gallium: Add tgsi_to_nir to get a nir_shader for a TGSI shader.

2015-04-01 Thread Connor Abbott
On Wed, Apr 1, 2015 at 2:53 PM, Brian Paul wrote: > On 04/01/2015 12:49 PM, Brian Paul wrote: >> >> On 04/01/2015 12:02 PM, Eric Anholt wrote: >>> >>> Module: Mesa >>> Branch: master >>> Commit: 783ad697d25e754ab719ab6c715969c35dbe867b >>> URL: >>> >>> https://urldefense.proofpoint.com/v2/url?u=ht

Re: [Mesa-dev] Mesa (master): nir/print: Don't print extra swizzzle components

2015-04-01 Thread Connor Abbott
On Wed, Apr 1, 2015 at 4:44 PM, Eric Anholt wrote: > Jason Ekstrand writes: > >> Module: Mesa >> Branch: master >> Commit: 793a94d6b5fc589ca8d7475347def4e222cd3d7c >> URL: >> http://cgit.freedesktop.org/mesa/mesa/commit/?id=793a94d6b5fc589ca8d7475347def4e222cd3d7c >> >> Author: Jason Ekstrand

Re: [Mesa-dev] [PATCH 2/4] nir: fix typo for f2b description

2015-04-01 Thread Connor Abbott
On Wed, Apr 1, 2015 at 6:49 PM, Jason Ekstrand wrote: > On Tue, Mar 31, 2015 at 4:10 PM, Ilia Mirkin wrote: >> On Tue, Mar 31, 2015 at 6:57 PM, Rob Clark wrote: >>> From: Rob Clark >>> >>> Signed-off-by: Rob Clark >>> --- >>> src/glsl/nir/nir_opcodes.py | 4 ++-- >>> 1 file changed, 2 inserti

Re: [Mesa-dev] [PATCH 3/4] nir: support to flatten_all in peephole-select

2015-04-01 Thread Connor Abbott
I think it might be better here if we had a callback that backends can fill in that tells you when an instruction can be pulled out by the sel peephole. As Jason noted, you won't be able to do this for everything (notably, output writes and variable writes) and we'll probably need special handling

Re: [Mesa-dev] [PATCH] nir/print: Correctly print swizzles for explicitly sized alu sources

2015-04-01 Thread Connor Abbott
Reviewed-by: Connor Abbott On Wed, Apr 1, 2015 at 7:17 PM, Jason Ekstrand wrote: > --- > src/glsl/nir/nir_print.c | 24 > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c > inde

Re: [Mesa-dev] [PATCH] nir: add support for structured COME FROM

2015-04-01 Thread Connor Abbott
On Wed, Apr 1, 2015 at 8:34 PM, Jason Ekstrand wrote: > On Wed, Apr 1, 2015 at 9:59 AM, Francisco Jerez wrote: >> Connor Abbott writes: >> >>> Unfortunately, we can't support unstructured COME FROM yet, since we >>> can't structurize arbitra

Re: [Mesa-dev] [PATCH 3/4] nir: support to flatten_all in peephole-select

2015-04-02 Thread Connor Abbott
On Thu, Apr 2, 2015 at 1:32 PM, Rob Clark wrote: > On Thu, Apr 2, 2015 at 1:24 PM, Jason Ekstrand wrote: >> On Thu, Apr 2, 2015 at 1:20 AM, Kenneth Graunke >> wrote: >>> On Wednesday, April 01, 2015 07:22:40 PM Connor Abbott wrote: >>>> I think it might be b

Re: [Mesa-dev] [PATCH 2/2] nir: fix typo for f2b/i2b/b2i expressions (v2)

2015-04-02 Thread Connor Abbott
Wow, that's pretty embarrassing... it's tough to test this code, so I'm not too surprised it's this busted. Reviewed-by: Connor Abbott On Thu, Apr 2, 2015 at 2:35 PM, Rob Clark wrote: > From: Rob Clark > > v2: discovered that i2b/b2i are also confused

Re: [Mesa-dev] [PATCH 1/2] build: add libnir.la

2015-04-03 Thread Connor Abbott
On Fri, Apr 3, 2015 at 2:07 PM, Rob Clark wrote: > From: Rob Clark > > If we want to use NIR from state trackers that don't already pull in the > whole of glsl (ie. anything other than mesa state tracker), we need a > separate more minimal libnir. Possibly NIR should be better split out > from g

Re: [Mesa-dev] Value Range Propagation in NIR (GSoC)

2015-04-07 Thread Connor Abbott
Hi Thomas, Thanks for submitting a proposal! Some comments/answers below. On Tue, Apr 7, 2015 at 3:34 PM, Thomas Helland wrote: > Hi, > > For those that don't know I've submitted a proposal for this years GSoC. > I've proposed to implement value range propagation and loop unrolling in > NIR. > S

Re: [Mesa-dev] Value Range Propagation in NIR (GSoC)

2015-04-07 Thread Connor Abbott
> Yes, copy propagation probably won't be so useful once we have value > range propagation; the former is a special case of the latter. Err, I meant constant propagation... ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop

Re: [Mesa-dev] Value Range Propagation in NIR (GSoC)

2015-04-11 Thread Connor Abbott
On Sat, Apr 11, 2015 at 3:12 PM, Thomas Helland wrote: >> Yes, copy propagation probably won't be so useful once we have value >> range propagation; the former is a special case of the latter. Note >> that we have a nifty way of actually doing the constant folding >> (nir_constant_expressions.py a

Re: [Mesa-dev] [PATCH 0/3] Enable ARB_gpu_shader_fp64 for i965

2015-04-11 Thread Connor Abbott
On Sat, Apr 11, 2015 at 2:13 PM, Matt Turner wrote: > Readding mesa-dev@ to Cc. > > On Sat, Apr 11, 2015 at 11:06 AM, Darius Goad wrote: >> Well, I did make a v2, but all that did was fix a bug. How does this not >> come close? > > Well, for instance the i965 driver supports ~5 generations of > h

Re: [Mesa-dev] [PATCH 1/4] nir: Fix bug in handling non-SSA copy prop of indirect register access.

2015-04-13 Thread Connor Abbott
Patches 1 and 2 are Reviewed-by: Connor Abbott Adding stricter assertions for tex sources makes sense to me now after some thought/discussion, but if we're going to do it then we should go all the way and make intrinsic srcs and dests and if srcs more strict as well. Also, maybe you&#x

Re: [Mesa-dev] [PATCH 2/3] nir: Try commutative sources in CSE

2015-04-14 Thread Connor Abbott
On Tue, Apr 14, 2015 at 11:43 AM, Ian Romanick wrote: > From: Ian Romanick > > Shader-db results: > > GM45 NIR: > total instructions in shared programs: 4082044 -> 4081919 (-0.00%) > instructions in affected programs: 27609 -> 27484 (-0.45%) > helped:44 > > Iro

[Mesa-dev] [PATCH] nir/cse: fix bug with comparing non-per-component sources

2015-04-14 Thread Connor Abbott
We weren't comparing the right number of components when checking swizzles. Use nir_ssa_alu_instr_num_src_components() to do the right thing. I haven't piglited this yet, but it seems straightforward. Cc: Ian Romanick Signed-off-by: Connor Abbott --- src/glsl/nir/nir_opt_

Re: [Mesa-dev] [PATCH] nir/cse: fix bug with comparing non-per-component sources

2015-04-14 Thread Connor Abbott
On Tue, Apr 14, 2015 at 3:55 PM, Jason Ekstrand wrote: > On Tue, Apr 14, 2015 at 12:51 PM, Connor Abbott wrote: >> We weren't comparing the right number of components when checking >> swizzles. Use nir_ssa_alu_instr_num_src_components() to do the right > > I don't

Re: [Mesa-dev] [PATCH] nir/cse: fix bug with comparing non-per-component sources

2015-04-14 Thread Connor Abbott
On Tue, Apr 14, 2015 at 4:56 PM, Jason Ekstrand wrote: > On Tue, Apr 14, 2015 at 1:39 PM, Connor Abbott wrote: >> On Tue, Apr 14, 2015 at 3:55 PM, Jason Ekstrand wrote: >>> On Tue, Apr 14, 2015 at 12:51 PM, Connor Abbott wrote: >>>> We weren't comparing

Re: [Mesa-dev] [RFC] nir: compiler options for addressing modes

2015-04-14 Thread Connor Abbott
On Tue, Apr 14, 2015 at 5:16 PM, Rob Clark wrote: > On Tue, Apr 14, 2015 at 4:59 PM, Jason Ekstrand wrote: >>> + /** >>> +* Addressing mode for corresponding _indirect intrinsics: >>> +*/ >>> + nir_addressing_mode var_addressing_mode; >>> + nir_addressing_mode in

Re: [Mesa-dev] [RFC] nir: compiler options for addressing modes

2015-04-15 Thread Connor Abbott
On Tue, Apr 14, 2015 at 7:08 PM, Rob Clark wrote: > On Tue, Apr 14, 2015 at 6:24 PM, Connor Abbott wrote: >> On Tue, Apr 14, 2015 at 5:16 PM, Rob Clark wrote: >>> On Tue, Apr 14, 2015 at 4:59 PM, Jason Ekstrand >>> wrote: >>>>>>>>> +

Re: [Mesa-dev] [PATCH] nir: Convert the if-test for num_inputs == 2 to an assertion

2015-04-15 Thread Connor Abbott
Reviewed-by: Connor Abbott On Wed, Apr 15, 2015 at 9:18 PM, Ian Romanick wrote: > From: Ian Romanick > > Suggested by Jason on a different patch after some comments / > questions by Ilia. > > Signed-off-by: Ian Romanick > Cc: Jason Ekstrand > --- > src/glsl/nir

[Mesa-dev] [PATCH 1/2] mesa: add .mesa-install-links files to gitignore

2015-04-17 Thread Connor Abbott
Signed-off-by: Connor Abbott --- src/mesa/main/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/.gitignore b/src/mesa/main/.gitignore index 8256ad7..b5f786d 100644 --- a/src/mesa/main/.gitignore +++ b/src/mesa/main/.gitignore @@ -9,3 +9,4 @@ get_hash.h.tmp

<    3   4   5   6   7   8   9   10   11   12   >