Loop compiler