Implement OriginVn loop prevention

Change-Id: Ieae026102fe8ac723f3699c0a375a13d9e3c48f1