glsl: move loop analysis helpers to loop_analysis.cpp