[LoopAccesses] Factor out RuntimePointerCheck::needsChecking