[Refactor] Have getNonLocalPointerDependency take the query instruction