PATCH: Make sure NVPTX doesn't emit symbols that aren't valid for ptxas

Eli Bendersky eliben at
Mon Mar 10 11:52:20 PDT 2014

Hi Justin,

Please find attached an initial patch for what we've discussed earlier. It
currently simply replaces the invalid symbols (only '.' and '@' may come
from MCSymbol) with a different sequence. Potentially, this can create
collisions, but since ptxas doesn't have general quoting, this is hard to
work around. In any case, it's strictly better than the current situation
which creates invalid assembly.

A more thorough approach could be to keep a map remembering symbol names
and failing loudly in case of collisions. This has a memory usage cost.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nvptx-cleanup-symbols-output.patch
Type: text/x-patch
Size: 7255 bytes
Desc: not available
URL: <>

More information about the llvm-commits mailing list