Implement OriginVn loop prevention

Change-Id: I62bd35ea769296696a90e95466aaded19df2c13f