Implement OriginVn loop prevention

Change-Id: I48ef686d306edef13cf42b852f1f65ac27d7891c