[CodeGen] Fixup assert fails caused by incorrect LoopInfo update

Contributed-by: Star Tan <tanmx_star@yeah.net>