Implement OriginVn loop prevention

Change-Id: I3f0676205ebe1effc0bde8f46bb7eacfe1067fa0