Implement OriginVn loop prevention

Change-Id: I303ca69d9473f4b78ecd3f405eef5bdbfc1d29ce