glsl: fix handling of quadop_vector constant expression

We forgot to handle the case where the base type was a boolean.
glsl: add as_loop_jump() method to ir_instruction

This will let us dynamically downcast to ir_loop_jump, which will be
needed later.
glsl: add a foreach_list_reverse macro
glsl: add dead branch analysis

Dead branch analysis determines when the then or else branches of an
if statement will always terminate in a loop jump or return statement,
and hence once we enter that branch we will never get to the statements
after the if. This is useful for determining the dominance tree, which
is needed for the conversion to SSA, as well as various other SSA-based
optimizations.
glsl: add loop jump visitor

This visitor will allow us to determine all the loop jumps that
correspond to each loop. In SSA form, each input to a phi node is
associated with a predecessor basic block. In the case of phi nodes
at the beginning and end of loops, these predecessor blocks will
include all blocks that end with a loop_jump (break or continue), and
so in order to insert phi nodes we must know all the loop_jump
instructions that correspond to each loop.
glsl: add swizzle_component() to ir_builder

Like swizzle_x(), swizzle_y(), etc., except the index is programmable.
glsl: add SSA infrastructure

This patch introduces all the changes to the IR that are necessary for
representing programs in the SSA form. This consists of a new variable
mode, the SSA temporary, which is guarenteed to be written to exactly
once, and classes to represent phi nodes in the IR.

In the current code, variables are first declared using an ir_variable
instruction inserted into the instruction stream, and then every
dereference will point to the ir_variable declared earlier. SSA
temporaries, however, do not work this way. Instead, the variable
is declared when it is assigned. That is, the variable is "owned" by
the one and only instruction where it is defined.

In SSA, phi nodes may exist at the beginning of any "join nodes," or
basic blocks with more than one predecessor. In our IR, this can happen
in one of three places:

- After an if statement, where the then branch and the else branch
converge.
- At the beginning of a loop, which can be reached from either before
the loop (on the first iteration), the end of the loop (when we get to
the end of the loop and jump back to the beginning), or any continue
statement.
- At the end of a loop, which can be reached from any break statement
within the loop.

Accordingly, there are three different types of phi nodes: if phi nodes,
phi nodes at the beginning of a loop, and phi nodes at the end of a
loop, all of which derive from the ir_phi base class.
glsl: add ssa_assign() to ir_builder

ssa_assign() creates an SSA variable and assignment at the same
time. With this, simple sequences of SSA statements can be easily
created.
glsl: add pass to convert GLSL IR to SSA form

opt_to_ssa will convert temporaries and local variables to SSA form,
although for now it can't handle array and record dereferences.
WIP: glsl: fixup ir_reader for SSA

TODO finishme
glsl: add a pass to convert out of SSA form

Right now we are being basically as naive as possible, and inserting
more copies than necessary. It is possible to implement a more
sophisticated algorithm later, although extending the current copy
propagation pass to support loops better and/or relying on backends to
do copy propagation may make this unecessary.
glsl: convert to and from SSA form in the compiler

This patch is mainly for allowing me to test these changes with piglit.
In the future, a do_ssa_optimizations() function will need to be
created and used by this code, as well as all other users of
do_common_optimizations().