nir: keep track of the number of input, output, and uniform slots
nir: add a pass to remove unused variables

After we lower variables, we want to delete them in order to free up
some memory.
nir: add a pass to lower sampler instructions
nir: add a pass to lower system value reads
nir: add a pass to lower atomics
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.
nir: calculate dominance information
nir: add a pass to convert to SSA
nir: add an SSA-based copy propagation pass
nir: add an SSA-based dead code elimination pass
i965/fs: don't use ir->shadow_comparitor in emit_texture_*

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965: make brw_texture_offset() more generic

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: don't use ir->offset in emit_texture_*

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: make emit_mcs_fetch() more generic

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: make rescale_texcoord() more generic

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: don't use ir->coordinate in emit_texture_*

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: don't use ir->lod_info.grad.dPd<x,y> in emit_texture_*

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: don't use ir->type in emit_texture_gen4()

We already have the type from the original destination.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: don't pass in ir_texture to emit_texture_*

At this point, the only thing it's used for is the opcode.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
i965/fs: make swizzle_result() more generic

v2: fix build failure
Signed-off-by: Connor Abbott <connor.abbott@intel.com>