Implement OriginVn loop prevention

Change-Id: Iea1c48e9a75f3f35ec45de4b3886a035f4769122