enhance get loop cycles

Signed-off-by: xiehuc <xiehuc@gmail.com>