[NVPTX] do not rely on cached subtarget info.
If a module has function references, but no functions
themselves, we may end up never calling runOnMachineFunction
and therefore would never initialize nvptxSubtarget field
which would eventually cause a crash.
Instead of relying on nvptxSubtarget being initialized by
one of the methods, retrieve subtarget info directly.
Differential Revision: https://reviews.llvm.org/D55580
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348952 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed