!UPSTREAM: i965/gs: If a DUAL_OBJECT gs would spill, fall back to DUAL_INSTANCED.

This is similar to what we do for 16-wide vs 8-wide fragment shaders.
First we try compiling the geometry shader in DUAL_OBJECT mode.  If we
can't do that without spilling, we fall back on DUAL_INSTANCED mode,
which should require less spilling (since it uses an interleaved
layout of payload registers).

In an ideal world we'd fall back to SINGLE mode, which would allow us
to interleave general-purpose registers too (resulting in even less
likelihood of spilling).  But at the moment, the vec4 generator and
visitor classes don't have the infrastructure to interleave general
purpose registers, so DUAL_INSTANCED is the best we can do.

As a side benefit this paves the way for implementing instanced
geometry shaders (which are incompatible with DUAL_OBJECT mode).

Since most geometry shaders used in piglit testing are small,
DUAL_INSTANCED mode won't get exercised very much in a normal piglit
run.  To force DUAL_INSTANCED mode to be used for all geometry
shaders, set INTEL_DEBUG=nogualobj.
!UPSTREAM: i965/vec4: if register allocation fails, don't try to schedule.

Otherwise the scheduler would be invoked with prog_data->total_grf ==
0, causing havoc.

In a future patch, this will allow us to try compiling a geometry
shader in DUAL_OBJECT mode with spilling disabled, and then fall back
to DUAL_INSTANCED mode if that failed.

TODO:
- Move earlier.
!UPSTREAM: i965/vec4: Allow MOV from vec4 or vec8 into vec4.

This can only happen when doing the vertex reordering workaround on
DUAL_INSTANCED geometry shaders.  For vec8 to vec4 moves, we
arbitrarily move the first half of the vec8 into the vec4.  The vertex
reordering workaround takes care to ensure that this doesn't cause a
problem.

TODO:
- Fold into vertex reordering code.
!UPSTREAM: i965/vec4: fix up primitive ID workaround for DUAL_INSTANCE dispatch.

TODO:

- Add better explanatory comments in generate_vec4_instruction.

- Modify the patch that does similar things to
  generate_vec4_instruction's MOV case and add better explanatory
  comments to it too.