function loop fusion