<div dir="ltr">Hello,<div><br></div><div>As discussed in PR19099, the solution in r203483 was imperfect. While we could fix global names when they are emitted in directives, this does not work for their usage within instructions. Instruction emission is hard-coded through MI and NVPTX does not control this.</div>

<div><br></div><div>A more thorough solution is a target-specific IR pass that replaces all invalid characters in symbol names before they go into codegen. This makes sure that invalid characters will never appear in symbols in PTX.</div>

<div><br></div><div>An added benefit is that this avoids collisions because Value->setName does automatic collision resolution.</div><div><br></div><div>Once this goes in, most of r203483 can be reverted (I'll take care of that).</div>

<div><br></div><div>PTAL,</div><div>Eli</div><div><br></div></div>