Implement OriginVn loop prevention

Change-Id: Ie909933031ae3bbea0db4d40789508040564766c