Implement OriginVn loop prevention

Change-Id: I944c88e29f841c778bfbdf31b2ed37761605579f