Implement OriginVn loop prevention

Change-Id: If142a297133077371b052bac5a796306c4d82084