Implement OriginVn loop prevention

Change-Id: Ia7d1d1303b8fe1f4659ecdc531c03940a85ce642