Implement OriginVn loop prevention

Change-Id: I741ab42ea5997efef3a62ceb2a788bca9c31fb2d