Optimize branch prediction for ifs inside loops.