[PATCH] D55580: [NVPTX] do not rely on cached subtarget info.

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 11 14:19:54 PST 2018


tra created this revision.
tra added reviewers: echristo, jlebar.
Herald added subscribers: bixia, hiraditya, sanjoy, jholewinski.

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.

@echristo : Added you as a reviewer as you were refactoring this code some time back (rL229785 <https://reviews.llvm.org/rL229785>)


https://reviews.llvm.org/D55580

Files:
  llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
  llvm/test/CodeGen/NVPTX/nofunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55580.177782.patch
Type: text/x-patch
Size: 4928 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181211/578caecb/attachment.bin>


More information about the llvm-commits mailing list