Implement OriginVn loop prevention

Change-Id: I05e697b0ebcf99b9b175b4e876eb8060fa80dc63