Implement OriginVn loop prevention

Change-Id: If4bb210be782c0d3dc02ac806451fe25d77e747c