Techniques for optimizing loop scheduling