!UPSTREAM: WIP: consolidate bounded loop handling into a lowering pass.

TODO:
- See if this produces slightly worse code in i965 (I suspect it does,
  due to no longer using a predicated break).  If so, document that
  this is the case, and verify that it is fixed in later passes.
WIP: replace loop controls with a bound type and max_iterations count.