[NVPTX] Use LDG for pointer induction variables.
More specifically, make NVPTXISelDAGToDAG able to emit cached loads (LDG) for pointer induction variables.
Also fix latent bug where LDG was not restricted to kernel functions. I believe that this could not be triggered so far since we do not currently infer that a pointer is global outside a kernel function, and only loads of global pointers are considered for cached loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244166
91177308-0d34-0410-b5e6-
96231b3b80d8