Implement OriginVn loop prevention

Change-Id: Ifb4d22923b4b8b9e97d3e0685696c7f1c747c548