Implement OriginVn loop prevention

Change-Id: I25ae90091c5d2ad1316ae55b4ade3dafa95a1a1f