Implement OriginVn loop prevention

Change-Id: I1a9b0e30072bbcc3b60c6da54c1d5e297c5b63f5