i965/fs: Make count_to_loop_end() use basic blocks.
i965/fs: Make count_to_loop_end() use basic blocks.

When the instructions aren't in a flat list, this wouldn't have worked.
Also, this should be faster.

Reviewed-by: Topi Pohjolainen <749697f19798b7f640b17221fd283b903825f071@intel.com>

dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,metora/MesaGLSLCompiler,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,metora/MesaGLSLCompiler,mcanthony/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,dellis1972/glsl-optimizer