This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Die if we ask the NVPTX backend to emit a global ctor/dtor.
ClosedPublic

Authored by jlebar on Jan 29 2016, 3:30 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 46442.Jan 29 2016, 3:30 PM
jlebar retitled this revision from to [CUDA] Die if we ask the NVPTX backend to emit a global ctor/dtor..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added subscribers: echristo, jhen, llvm-commits.
tra edited edge metadata.Jan 29 2016, 3:50 PM

Looks OK to me, but I'd run it by someone familiar with back-end.

lib/Target/NVPTX/NVPTXAsmPrinter.cpp
808 ↗(On Diff #46442)

I'd make it an assert so we know if/when llvm.global_ctors mutates into something we can't deal with.

jholewinski accepted this revision.Jan 29 2016, 3:54 PM
jholewinski added a reviewer: jholewinski.

LGTM. Thanks!

This revision is now accepted and ready to land.Jan 29 2016, 3:54 PM
jlebar added inline comments.Jan 29 2016, 3:56 PM
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
808 ↗(On Diff #46442)

That was my inclination as well, but in AsmPrinter, this is not an error, so I'm not sure it should be one here.

https://github.com/llvm-project/llvm-project/blob/49e3b4837314fc2920616c36287aa23e4e4be6fc/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L1568

tra accepted this revision.Jan 29 2016, 4:32 PM
tra edited edge metadata.

LGTM.

lib/Target/NVPTX/NVPTXAsmPrinter.cpp
808 ↗(On Diff #46442)

OK. We'll probably catch it when we generate something ptxas can't handle.

This revision was automatically updated to reflect the committed changes.