[NVPTX] Fix for NVPTX module asm regression
authortatz.j@northeastern.edu <tatz.j@husky.neu.edu>
Wed, 24 Jun 2020 16:55:09 +0000 (09:55 -0700)
committerArtem Belevich <tra@google.com>
Wed, 24 Jun 2020 18:17:09 +0000 (11:17 -0700)
commitaf5e61bf4fd1bf865f90beab0227ff4901246eeb
tree2020f267b1c0f1b0a9c51b7074d24741393a4457
parent1a4f8889800a8c80819602725c5ce509ded2d451
[NVPTX] Fix for NVPTX module asm regression

Currently module asm ends up emitted twice and at the wrong place in the PTX.
This patch moves module asm generation into emitStartOfAsmFile() which puts at
the correct location in the generated PTX.

Differential Revision: https://reviews.llvm.org/D82280
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
llvm/test/CodeGen/NVPTX/module-inline-asm.ll