mesa.git
9 years agonir: Add a helper for getting a constant value from an SSA source
Jason Ekstrand [Tue, 9 Dec 2014 01:34:23 +0000 (17:34 -0800)]
nir: Add a helper for getting a constant value from an SSA source

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/glsl: Add support for gpu_shader5 interpolation instrinsics
Jason Ekstrand [Thu, 4 Dec 2014 20:16:33 +0000 (12:16 -0800)]
nir/glsl: Add support for gpu_shader5 interpolation instrinsics

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add gpu_shader5 interpolation intrinsics
Jason Ekstrand [Thu, 4 Dec 2014 20:16:06 +0000 (12:16 -0800)]
nir: Add gpu_shader5 interpolation intrinsics

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/validate: Validate intrinsic source/destination sizes
Jason Ekstrand [Thu, 4 Dec 2014 18:41:17 +0000 (10:41 -0800)]
nir/validate: Validate intrinsic source/destination sizes

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Vectorize intrinsics
Jason Ekstrand [Thu, 4 Dec 2014 01:03:19 +0000 (17:03 -0800)]
nir: Vectorize intrinsics

We used to have the number of components built into the intrinsic.  This
meant that all of our load/store intrinsics had vec1, vec2, vec3, and vec4
variants.  This lead to piles of switch statements to generate the correct
intrinsic names, and introspection to figure out the number of components.
We can make things much nicer by allowing "vectorized" intrinsics.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Remove the old variable lowering code
Jason Ekstrand [Thu, 4 Dec 2014 00:25:35 +0000 (16:25 -0800)]
nir: Remove the old variable lowering code

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/validate: Ensure that outputs are write-only and inputs are read-only
Jason Ekstrand [Wed, 3 Dec 2014 22:47:17 +0000 (14:47 -0800)]
nir/validate: Ensure that outputs are write-only and inputs are read-only

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Use the new variable lowering code
Jason Ekstrand [Wed, 26 Nov 2014 23:07:27 +0000 (15:07 -0800)]
i965/fs_nir: Use the new variable lowering code

This commit switches us over to the new variable lowering code which is
capable of properly handling lowering indirects as we go.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/glsl: Generate SSA NIR
Jason Ekstrand [Mon, 1 Dec 2014 22:11:04 +0000 (14:11 -0800)]
nir/glsl: Generate SSA NIR

With this commit, the GLSL IR -> NIR pass generates NIR in more-or-less SSA
form.  It's SSA in the sense that it doesn't have any registers, but it
isn't really useful SSA because it still has a pile of load/store
intrinsics that we will need to get rid of.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a pass to lower global variables to local variables
Jason Ekstrand [Tue, 2 Dec 2014 20:48:38 +0000 (12:48 -0800)]
nir: Add a pass to lower global variables to local variables

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a pass for lowering input/output loads/stores
Jason Ekstrand [Tue, 2 Dec 2014 06:01:05 +0000 (22:01 -0800)]
nir: Add a pass for lowering input/output loads/stores

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a pass to lower local variables to registers
Jason Ekstrand [Tue, 2 Dec 2014 04:29:35 +0000 (20:29 -0800)]
nir: Add a pass to lower local variables to registers

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a pass to lower local variable accesses to SSA values
Jason Ekstrand [Fri, 14 Nov 2014 01:16:31 +0000 (17:16 -0800)]
nir: Add a pass to lower local variable accesses to SSA values

This pass analizes all of the load/store operations and, when a variable is
never aliased (potentially used by an indirect operation), it is lowered
directly to an SSA value.  This pass translates to SSA directly and does
not require any fixup by the original to-SSA pass.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a copy splitting pass
Jason Ekstrand [Wed, 19 Nov 2014 22:52:30 +0000 (14:52 -0800)]
nir: Add a copy splitting pass

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Automatically update SSA if uses
Jason Ekstrand [Mon, 1 Dec 2014 22:39:10 +0000 (14:39 -0800)]
nir: Automatically update SSA if uses

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Don't dump the shader.
Jason Ekstrand [Mon, 1 Dec 2014 23:09:17 +0000 (15:09 -0800)]
i965/fs_nir: Don't dump the shader.

This is killing piglit.  I'll leave the logging local

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/glsl: Don't allocate a state_slots array for 0 state slots
Jason Ekstrand [Wed, 3 Dec 2014 02:07:13 +0000 (18:07 -0800)]
nir/glsl: Don't allocate a state_slots array for 0 state slots

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Validate that the sources of a phi have the same size as the destination
Jason Ekstrand [Tue, 25 Nov 2014 05:26:41 +0000 (21:26 -0800)]
nir: Validate that the sources of a phi have the same size as the destination

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/copy_propagate: Don't cause size mismatches on phi node sources
Jason Ekstrand [Tue, 25 Nov 2014 06:42:16 +0000 (22:42 -0800)]
nir/copy_propagate: Don't cause size mismatches on phi node sources

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Don't require a function in ssa_def_init
Jason Ekstrand [Thu, 20 Nov 2014 00:06:32 +0000 (16:06 -0800)]
nir: Don't require a function in ssa_def_init

Instead, we give SSA definitions a temporary index of 0xFFFFFFFF if the
instruction does not have a block and a proper index when it actually gets
added to the list.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Use an integer index for specifying structure fields
Jason Ekstrand [Wed, 26 Nov 2014 05:36:25 +0000 (21:36 -0800)]
nir: Use an integer index for specifying structure fields

Previously, we used a string name.  It was nice for translating out of GLSL
IR (which also does that) but cumbersome the rest of the time.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a concept of a wildcard array dereference
Jason Ekstrand [Wed, 19 Nov 2014 20:59:57 +0000 (12:59 -0800)]
nir: Add a concept of a wildcard array dereference

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Make array deref direct vs. indirect an enum
Jason Ekstrand [Wed, 19 Nov 2014 20:53:08 +0000 (12:53 -0800)]
nir: Make array deref direct vs. indirect an enum

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Clean up nir_deref helper functions
Jason Ekstrand [Thu, 13 Nov 2014 22:53:01 +0000 (14:53 -0800)]
nir: Clean up nir_deref helper functions

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/lower_samplers: Use the nir_instr_rewrite_src function
Jason Ekstrand [Fri, 14 Nov 2014 17:46:48 +0000 (09:46 -0800)]
nir/lower_samplers: Use the nir_instr_rewrite_src function

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a helper for rewriting an instruction source
Jason Ekstrand [Fri, 14 Nov 2014 03:07:22 +0000 (19:07 -0800)]
nir: Add a helper for rewriting an instruction source

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Properly saturate multiplies
Jason Ekstrand [Fri, 14 Nov 2014 05:34:41 +0000 (21:34 -0800)]
i965/fs_nir: Properly saturate multiplies

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/from_ssa: Don't lower constant SSA values to registers
Jason Ekstrand [Wed, 14 Jan 2015 19:19:41 +0000 (11:19 -0800)]
nir/from_ssa: Don't lower constant SSA values to registers

Backends want to be able to do special things with constant values such as
put them into immediates or make decisions based on whether or not a value
is constant.  Before, constants always got lowered to a load_const into a
register and then a register use.  Now we leave constants as SSA values so
backends can special-case them if they want.  Since handling constant SSA
values is trivial, this shouldn't be a problem for backends.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Handle SSA constants
Jason Ekstrand [Thu, 13 Nov 2014 00:24:21 +0000 (16:24 -0800)]
i965/fs_nir: Handle SSA constants

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Use an array rather than a hash table for register lookup
Jason Ekstrand [Wed, 12 Nov 2014 19:05:51 +0000 (11:05 -0800)]
i965/fs_nir: Use an array rather than a hash table for register lookup

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Add the CSE pass and actually run in a loop
Jason Ekstrand [Wed, 12 Nov 2014 00:12:32 +0000 (16:12 -0800)]
i965/fs_nir: Add the CSE pass and actually run in a loop

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a basic CSE pass
Jason Ekstrand [Wed, 12 Nov 2014 00:11:34 +0000 (16:11 -0800)]
nir: Add a basic CSE pass

This pass is still fairly basic.  It only handles ALU operations, constant
loads, and phi nodes.  No texture ops or intrinsics yet.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a fused multiply-add peephole
Jason Ekstrand [Tue, 11 Nov 2014 20:16:55 +0000 (12:16 -0800)]
nir: Add a fused multiply-add peephole

9 years agonir: Validate that the SSA def and register indices are unique
Jason Ekstrand [Tue, 11 Nov 2014 00:00:03 +0000 (16:00 -0800)]
nir: Validate that the SSA def and register indices are unique

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Turn on the peephole select optimization
Jason Ekstrand [Sat, 8 Nov 2014 00:07:22 +0000 (16:07 -0800)]
i965/fs_nir: Turn on the peephole select optimization

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a peephole select optimization
Jason Ekstrand [Tue, 4 Nov 2014 18:12:14 +0000 (10:12 -0800)]
nir: Add a peephole select optimization

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/nir: Patch up phi predecessors in move_successors
Jason Ekstrand [Sat, 8 Nov 2014 03:35:23 +0000 (19:35 -0800)]
nir/nir: Patch up phi predecessors in move_successors

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/nir: Use safe iterators when iterating over the CFG
Jason Ekstrand [Sat, 8 Nov 2014 02:27:36 +0000 (18:27 -0800)]
nir/nir: Use safe iterators when iterating over the CFG

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoglsl/list: Add a foreach_list_typed_safe_reverse macro
Jason Ekstrand [Sat, 8 Nov 2014 02:26:50 +0000 (18:26 -0800)]
glsl/list: Add a foreach_list_typed_safe_reverse macro

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/nir: Fix a bug in move_successors
Jason Ekstrand [Sat, 8 Nov 2014 02:25:08 +0000 (18:25 -0800)]
nir/nir: Fix a bug in move_successors

The unlink_blocks function moves successors around to make sure that, if
there is a remaining successor, it is in the first successors slot and not
the second.  To fix this, we simply get both successors up front.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Validate optimization passes
Jason Ekstrand [Fri, 7 Nov 2014 19:03:12 +0000 (11:03 -0800)]
i965/fs_nir: Validate optimization passes

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Differentiate between signed and unsigned versions of find_msb
Jason Ekstrand [Fri, 7 Nov 2014 18:59:16 +0000 (10:59 -0800)]
nir: Differentiate between signed and unsigned versions of find_msb

We also make the return types match GLSL.  The GLSL spec specifies that
findMSB and findLSB return a signed integer.  Previously, nir had them
return unsigned.  This updates nir's behavior to match what GLSL expects.

We also update the nir-to-fs generator to take the new instructions.  While
we're at it, we fix the case where the input to findMSB is zero.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/print: Don't reindex things
Jason Ekstrand [Thu, 6 Nov 2014 19:18:42 +0000 (11:18 -0800)]
nir/print: Don't reindex things

These indices should now be reasonably stable/consistent.  Redoing the
indices in the print functions makes it harder to debug problems.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Validate all lists in the validator
Jason Ekstrand [Wed, 5 Nov 2014 21:58:42 +0000 (13:58 -0800)]
nir: Validate all lists in the validator

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoglsl/list: Fix the exec_list_validate function
Jason Ekstrand [Tue, 11 Nov 2014 18:12:24 +0000 (10:12 -0800)]
glsl/list: Fix the exec_list_validate function

Some time while refactoring things to make it look nicer before pushing to
master, I completely broke the function.  This fixes it to be correct.
Just goes to show you why you souldn't push code that has no users yet...

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs_nir: Do retyping for ALU srouces in get_nir_alu_src
Jason Ekstrand [Fri, 12 Dec 2014 21:05:25 +0000 (13:05 -0800)]
i965/fs_nir: Do retyping for ALU srouces in get_nir_alu_src

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a better out-of-SSA pass
Jason Ekstrand [Fri, 31 Oct 2014 18:17:09 +0000 (11:17 -0700)]
nir: Add a better out-of-SSA pass

This commit rewrites the out-of-SSA pass to not be nearly as naieve.  It's
based on "Revisiting Out-of-SSA Translation for Correctness, Code Quality,
and Efficiency" by Boissinot et. al.  It should be fairly close to
state-of-the art.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a function for comparing two sources
Jason Ekstrand [Fri, 12 Dec 2014 20:52:11 +0000 (12:52 -0800)]
nir: Add a function for comparing two sources

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a parallel copy instruction type
Jason Ekstrand [Fri, 31 Oct 2014 04:04:15 +0000 (21:04 -0700)]
nir: Add a parallel copy instruction type

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a function for rewriting all the uses of a SSA def
Jason Ekstrand [Wed, 5 Nov 2014 01:18:48 +0000 (17:18 -0800)]
nir: Add a function for rewriting all the uses of a SSA def

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Automatically handle SSA uses when an instruction is inserted
Jason Ekstrand [Tue, 4 Nov 2014 19:02:09 +0000 (11:02 -0800)]
nir: Automatically handle SSA uses when an instruction is inserted

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add an initialization function for SSA definitions
Jason Ekstrand [Tue, 4 Nov 2014 18:40:48 +0000 (10:40 -0800)]
nir: Add an initialization function for SSA definitions

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add an SSA-based liveness analysis pass.
Jason Ekstrand [Wed, 29 Oct 2014 21:17:17 +0000 (14:17 -0700)]
nir: Add an SSA-based liveness analysis pass.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: set reg_alloc and ssa_alloc when indexing registers and SSA values
Jason Ekstrand [Fri, 31 Oct 2014 04:18:22 +0000 (21:18 -0700)]
nir: set reg_alloc and ssa_alloc when indexing registers and SSA values

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a function to detect if a block is immediately followed by an if
Jason Ekstrand [Wed, 29 Oct 2014 23:25:51 +0000 (16:25 -0700)]
nir: Add a function to detect if a block is immediately followed by an if

Since we don't actually have an "if" instruction, this is a very common
pattern when iterating over instructions.  This adds a helper function for
it to make things a little less painful.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a foreach_block_reverse function
Jason Ekstrand [Wed, 29 Oct 2014 21:16:54 +0000 (14:16 -0700)]
nir: Add a foreach_block_reverse function

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/foreach_block: Return false if the callback on the last block fails
Jason Ekstrand [Wed, 29 Oct 2014 21:16:39 +0000 (14:16 -0700)]
nir/foreach_block: Return false if the callback on the last block fails

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a basic metadata management system
Jason Ekstrand [Wed, 29 Oct 2014 19:42:54 +0000 (12:42 -0700)]
nir: Add a basic metadata management system

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/lower_variables_scalar: Silence a compiler warning
Jason Ekstrand [Wed, 29 Oct 2014 19:42:33 +0000 (12:42 -0700)]
nir/lower_variables_scalar: Silence a compiler warning

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Convert the shader to/from SSA
Jason Ekstrand [Wed, 22 Oct 2014 18:24:33 +0000 (11:24 -0700)]
i965/fs_nir: Convert the shader to/from SSA

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a lower_vec_to_movs pass
Jason Ekstrand [Wed, 22 Oct 2014 19:57:28 +0000 (12:57 -0700)]
nir: Add a lower_vec_to_movs pass

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add a naieve from-SSA pass
Jason Ekstrand [Wed, 22 Oct 2014 18:22:53 +0000 (11:22 -0700)]
nir: Add a naieve from-SSA pass

This pass is kind of stupidly implemented but it should be enough to get us
up and going.  We probably want something better that doesn't generate all
of the redundant moves eventually.  However, the i965 backend should be
able to handle the movs, so I'm not too worried about it in the short term.

9 years agoi965/fs_nir: Don't duplicate emit_general_interpolation
Jason Ekstrand [Tue, 21 Oct 2014 01:07:28 +0000 (18:07 -0700)]
i965/fs_nir: Don't duplicate emit_general_interpolation

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs: Don't take an ir_variable for emit_general_interpolation
Jason Ekstrand [Tue, 21 Oct 2014 01:05:36 +0000 (18:05 -0700)]
i965/fs: Don't take an ir_variable for emit_general_interpolation

Previously, emit_general_interpolation took an ir_variable and pulled the
information it needed from that.  This meant that in fs_fp, we were
constructing a dummy ir_variable just to pass into it.  This commit makes
emit_general_interpolation take only the information it needs and gets rid
of the fs_fp cruft.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add intrinsics to do alternate interpolation on inputs
Jason Ekstrand [Sat, 18 Oct 2014 00:11:34 +0000 (17:11 -0700)]
nir: Add intrinsics to do alternate interpolation on inputs

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add NIR_TRUE and NIR_FALSE constants and use them for boolean immediates
Jason Ekstrand [Thu, 16 Oct 2014 23:53:03 +0000 (16:53 -0700)]
nir: Add NIR_TRUE and NIR_FALSE constants and use them for boolean immediates

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Add atomic counters support
Jason Ekstrand [Thu, 16 Oct 2014 04:52:58 +0000 (21:52 -0700)]
i965/fs_nir: Add atomic counters support

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/lower_atomics: Multiply array offsets by ATOMIC_COUNTER_SIZE
Jason Ekstrand [Thu, 16 Oct 2014 16:56:14 +0000 (09:56 -0700)]
nir/lower_atomics: Multiply array offsets by ATOMIC_COUNTER_SIZE

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Handle coarse/fine derivatives
Jason Ekstrand [Wed, 15 Oct 2014 21:44:00 +0000 (14:44 -0700)]
i965/fs_nir: Handle coarse/fine derivatives

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/glsl: Add support for coarse and fine derivatives
Jason Ekstrand [Wed, 15 Oct 2014 23:57:10 +0000 (16:57 -0700)]
nir/glsl: Add support for coarse and fine derivatives

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Add fine and coarse derivative opcodes
Jason Ekstrand [Wed, 15 Oct 2014 23:56:43 +0000 (16:56 -0700)]
nir: Add fine and coarse derivative opcodes

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir/glsl: Add support for saturate
Jason Ekstrand [Wed, 15 Oct 2014 23:19:26 +0000 (16:19 -0700)]
nir/glsl: Add support for saturate

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Add support for sample_pos and sample_id
Jason Ekstrand [Wed, 15 Oct 2014 23:01:04 +0000 (16:01 -0700)]
i965/fs_nir: Add support for sample_pos and sample_id

9 years agoFix up varying pull constants
Jason Ekstrand [Wed, 15 Oct 2014 22:36:43 +0000 (15:36 -0700)]
Fix up varying pull constants

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoFix what I think are a few NIR typos
Jason Ekstrand [Wed, 15 Oct 2014 20:56:48 +0000 (13:56 -0700)]
Fix what I think are a few NIR typos

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Use the correct texture offset immediate
Jason Ekstrand [Wed, 15 Oct 2014 22:25:10 +0000 (15:25 -0700)]
i965/fs_nir: Use the correct texture offset immediate

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Use the correct types for texture inputs
Jason Ekstrand [Wed, 15 Oct 2014 19:18:25 +0000 (12:18 -0700)]
i965/fs_nir: Use the correct types for texture inputs

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs_nir: Make the sampler register always unsigned
Jason Ekstrand [Wed, 15 Oct 2014 17:41:04 +0000 (10:41 -0700)]
i965/fs_nir: Make the sampler register always unsigned

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs: Only use nir for 8-wide non-fast-clear shaders.
Jason Ekstrand [Tue, 14 Oct 2014 23:40:04 +0000 (16:40 -0700)]
i965/fs: Only use nir for 8-wide non-fast-clear shaders.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965/fs: add a NIR frontend
Connor Abbott [Fri, 15 Aug 2014 17:32:07 +0000 (10:32 -0700)]
i965/fs: add a NIR frontend

This is similar to the GLSL IR frontend, except consuming NIR. This lets
us test NIR as part of an actual compiler.

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   Make brw_fs_nir build again
   Only use NIR of INTEL_USE_NIR is set
   whitespace fixes

9 years agoi965/fs: Don't pass through the coordinate type
Connor Abbott [Fri, 15 Aug 2014 17:17:26 +0000 (10:17 -0700)]
i965/fs: Don't pass through the coordinate type

All we really need is the number of components.

9 years agoi965/fs: make emit_fragcoord_interpolation() not take an ir_variable
Connor Abbott [Tue, 5 Aug 2014 18:02:02 +0000 (11:02 -0700)]
i965/fs: make emit_fragcoord_interpolation() not take an ir_variable

9 years agonir: add an SSA-based dead code elimination pass
Connor Abbott [Thu, 24 Jul 2014 22:51:58 +0000 (15:51 -0700)]
nir: add an SSA-based dead code elimination pass

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   whitespace fixes

9 years agonir: add an SSA-based copy propagation pass
Connor Abbott [Wed, 23 Jul 2014 18:19:50 +0000 (11:19 -0700)]
nir: add an SSA-based copy propagation pass

9 years agonir: add a pass to convert to SSA
Connor Abbott [Tue, 22 Jul 2014 21:05:06 +0000 (14:05 -0700)]
nir: add a pass to convert to SSA

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   whitespace fixes

9 years agonir: calculate dominance information
Connor Abbott [Fri, 18 Jul 2014 23:13:11 +0000 (16:13 -0700)]
nir: calculate dominance information

9 years agonir: add an optimization to turn global registers into local registers
Connor Abbott [Wed, 30 Jul 2014 19:08:13 +0000 (12:08 -0700)]
nir: add an optimization to turn global registers into local registers

After linking and inlining, this allows us to convert these registers
into SSA values and optimise more code.

9 years agonir: add a pass to lower atomics
Connor Abbott [Wed, 30 Jul 2014 21:43:26 +0000 (14:43 -0700)]
nir: add a pass to lower atomics

v2: Jason Ekstrand <jason.ekstrand@intel.com>
   whitespace fixes

9 years agonir: add a pass to lower system value reads
Connor Abbott [Wed, 30 Jul 2014 19:07:45 +0000 (12:07 -0700)]
nir: add a pass to lower system value reads

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   whitespace fixes

9 years agonir: add a pass to lower sampler instructions
Connor Abbott [Wed, 30 Jul 2014 19:04:49 +0000 (12:04 -0700)]
nir: add a pass to lower sampler instructions

9 years agonir: add a pass to remove unused variables
Connor Abbott [Wed, 30 Jul 2014 18:56:52 +0000 (11:56 -0700)]
nir: add a pass to remove unused variables

After we lower variables, we want to delete them in order to free up
some memory.

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
    whitespace fixes

9 years agonir: keep track of the number of input, output, and uniform slots
Connor Abbott [Tue, 5 Aug 2014 17:54:27 +0000 (10:54 -0700)]
nir: keep track of the number of input, output, and uniform slots

9 years agonir: add a pass to lower variables for scalar backends
Connor Abbott [Thu, 17 Jul 2014 16:12:52 +0000 (09:12 -0700)]
nir: add a pass to lower variables for scalar backends

9 years agonir: add a glsl-to-nir pass
Connor Abbott [Fri, 11 Jul 2014 01:18:17 +0000 (18:18 -0700)]
nir: add a glsl-to-nir pass

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   Make glsl_to_nir build again
   fix whitespace

9 years agonir: add a validation pass
Connor Abbott [Wed, 30 Jul 2014 22:20:53 +0000 (15:20 -0700)]
nir: add a validation pass

This is similar to ir_validate.cpp.

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   whitespace fixes

9 years agonir: add a printer
Connor Abbott [Wed, 30 Jul 2014 22:29:27 +0000 (15:29 -0700)]
nir: add a printer

This is similar to ir_print_visitor.cpp.

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   whitespace fixes

9 years agoSQUASH: Fix comments from eric
Jason Ekstrand [Thu, 18 Dec 2014 01:30:27 +0000 (17:30 -0800)]
SQUASH: Fix comments from eric

Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoSQUASH: Add an assert
Jason Ekstrand [Wed, 29 Oct 2014 21:15:13 +0000 (14:15 -0700)]
SQUASH: Add an assert

9 years agonir: add core helper functions
Connor Abbott [Thu, 31 Jul 2014 23:16:23 +0000 (16:16 -0700)]
nir: add core helper functions

These include functions for adding and removing various bits of IR and
helpers for iterating over all the sources and destinations of an
instruction. This is similar to ir.cpp.

v2: Jason Ekstrand <jason.ekstrand@intel.com>:
   whitespace and automake fixes

9 years agoSQUASH: Use the enum for the variable mode
Jason Ekstrand [Wed, 26 Nov 2014 23:08:19 +0000 (15:08 -0800)]
SQUASH: Use the enum for the variable mode