Jason Ekstrand
366181d826
nir: Add a parallel copy instruction type
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
7de6b7fc3e
nir: Add a function for rewriting all the uses of a SSA def
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
946012f10f
nir: Automatically handle SSA uses when an instruction is inserted
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
fbc443ad56
nir: Add an initialization function for SSA definitions
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
f86902e75d
nir: Add an SSA-based liveness analysis pass.
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
c9a21c725d
nir: set reg_alloc and ssa_alloc when indexing registers and SSA values
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
d7e482d32c
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>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
dfdf0c4673
nir: Add a foreach_block_reverse function
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
07556442a7
nir/foreach_block: Return false if the callback on the last block fails
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
49911cf4db
nir: Add a basic metadata management system
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
ea1eefe13f
nir/lower_variables_scalar: Silence a compiler warning
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
63eb32950e
i965/fs_nir: Convert the shader to/from SSA
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
9d986d19d0
nir: Add a lower_vec_to_movs pass
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:19:00 -08:00
Jason Ekstrand
2943522d80
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.
2015-01-15 07:18:59 -08:00
Jason Ekstrand
ff0a9fcf33
i965/fs_nir: Don't duplicate emit_general_interpolation
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
b1fe8604c6
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>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
b600f1a381
nir: Add intrinsics to do alternate interpolation on inputs
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
4b4f90dbff
nir: Add NIR_TRUE and NIR_FALSE constants and use them for boolean immediates
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
744b4e9348
i965/fs_nir: Add atomic counters support
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
6e46c98ec1
nir/lower_atomics: Multiply array offsets by ATOMIC_COUNTER_SIZE
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
95fbd6e1ee
i965/fs_nir: Handle coarse/fine derivatives
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
d40b5ca5c5
nir/glsl: Add support for coarse and fine derivatives
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
8c75a7ce59
nir: Add fine and coarse derivative opcodes
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
458a6ce500
nir/glsl: Add support for saturate
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
4582341ea7
i965/fs_nir: Add support for sample_pos and sample_id
2015-01-15 07:18:59 -08:00
Jason Ekstrand
7cd1537aae
Fix up varying pull constants
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
4bb81f6d02
Fix what I think are a few NIR typos
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
b092bc9805
i965/fs_nir: Use the correct texture offset immediate
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
c181ff268e
i965/fs_nir: Use the correct types for texture inputs
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
c2ded36bb6
i965/fs_nir: Make the sampler register always unsigned
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Jason Ekstrand
ae2880d131
i965/fs: Only use nir for 8-wide non-fast-clear shaders.
...
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-01-15 07:18:59 -08:00
Connor Abbott
2faf7f87d6
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
2015-01-15 07:18:59 -08:00
Connor Abbott
9afc566e2d
i965/fs: Don't pass through the coordinate type
...
All we really need is the number of components.
2015-01-15 07:18:58 -08:00
Connor Abbott
616a48ebc6
i965/fs: make emit_fragcoord_interpolation() not take an ir_variable
2015-01-15 07:18:58 -08:00
Connor Abbott
7602385ac5
nir: add an SSA-based dead code elimination pass
...
v2: Jason Ekstrand <jason.ekstrand@intel.com>:
whitespace fixes
2015-01-15 07:18:58 -08:00
Connor Abbott
8b7cb7674c
nir: add an SSA-based copy propagation pass
2015-01-15 07:18:58 -08:00
Connor Abbott
4553887d4a
nir: add a pass to convert to SSA
...
v2: Jason Ekstrand <jason.ekstrand@intel.com>:
whitespace fixes
2015-01-15 07:18:58 -08:00
Connor Abbott
b559ee709b
nir: calculate dominance information
2015-01-15 07:18:58 -08:00
Connor Abbott
cff1deff72
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.
2015-01-15 07:18:58 -08:00
Connor Abbott
613bf6818a
nir: add a pass to lower atomics
...
v2: Jason Ekstrand <jason.ekstrand@intel.com>
whitespace fixes
2015-01-15 07:18:58 -08:00
Connor Abbott
8692c6a023
nir: add a pass to lower system value reads
...
v2: Jason Ekstrand <jason.ekstrand@intel.com>:
whitespace fixes
2015-01-15 07:18:58 -08:00
Connor Abbott
8cdcfce5ce
nir: add a pass to lower sampler instructions
2015-01-15 07:18:58 -08:00
Connor Abbott
370e875b32
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
2015-01-15 07:18:58 -08:00
Connor Abbott
494790b2a9
nir: keep track of the number of input, output, and uniform slots
2015-01-15 07:18:58 -08:00
Connor Abbott
c2f36cf125
nir: add a pass to lower variables for scalar backends
2015-01-15 07:18:58 -08:00
Connor Abbott
7f0daaa5e7
nir: add a glsl-to-nir pass
...
v2: Jason Ekstrand <jason.ekstrand@intel.com>:
Make glsl_to_nir build again
fix whitespace
2015-01-15 07:18:58 -08:00
Connor Abbott
dbb76421da
nir: add a validation pass
...
This is similar to ir_validate.cpp.
v2: Jason Ekstrand <jason.ekstrand@intel.com>:
whitespace fixes
2015-01-15 07:18:58 -08:00
Connor Abbott
98fa28bff7
nir: add a printer
...
This is similar to ir_print_visitor.cpp.
v2: Jason Ekstrand <jason.ekstrand@intel.com>:
whitespace fixes
2015-01-15 07:18:58 -08:00
Jason Ekstrand
9b1139649d
SQUASH: Fix comments from eric
...
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-01-15 07:18:58 -08:00
Jason Ekstrand
8b4c860580
SQUASH: Add an assert
2015-01-15 07:18:58 -08:00