Changes in LLVM 3.4 llc name mangling?

Hi,

I've recently ported Pure (http://purelang.bitbucket.org/) to LLVM
3.4, and I've run into a problem. I'm using LLVM on a Linux x86_64
system (Arch). In previous releases llc would automatically mangle
identifiers in LLVM assembler source code so that the result could be
assembled with the system assembler of the target platform. E.g., if I
have LLVM assembler (.ll) code like:

define void @"$(foo)"() {
  ret void
}

Then the llc from LLVM 3.3 turns the identifier "$(foo)" into
$_28_foo_29_ in the assembler output code (.s), which is fine.

But in LLVM 3.4 this isn't the case any more, instead the "$(foo)"
identifier goes through unchanged. It goes without saying that the
system assembler chokes on this, so I get a bunch of error messages
when trying to assemble the resulting file.

This breaks Pure's batch compiler which assumes that llc does all the
necessary name mangling.

Was this change intentional? Is it a bug? Is there a way I can get the
name mangling back in LLVM 3.4? Any help appreciated.

Thanks,
Albert

Hi,

I've recently ported Pure (http://purelang.bitbucket.org/) to LLVM
3.4, and I've run into a problem. I'm using LLVM on a Linux x86_64
system (Arch). In previous releases llc would automatically mangle
identifiers in LLVM assembler source code so that the result could be
assembled with the system assembler of the target platform. E.g., if I
have LLVM assembler (.ll) code like:

define void @"$(foo)"() {
  ret void
}

Then the llc from LLVM 3.3 turns the identifier "$(foo)" into
$_28_foo_29_ in the assembler output code (.s), which is fine.

This change was intentional. The rationale being that there is nothing
in the object format that prevents a symbol name of "$(foo)".

But in LLVM 3.4 this isn't the case any more, instead the "$(foo)"
identifier goes through unchanged. It goes without saying that the
system assembler chokes on this, so I get a bunch of error messages
when trying to assemble the resulting file.

This is a bug. The asm printer should be adding escapes so that you
would get a symbol named "$(foo)". What is the target triple?

This breaks Pure's batch compiler which assumes that llc does all the
necessary name mangling.

Was this change intentional? Is it a bug? Is there a way I can get the
name mangling back in LLVM 3.4? Any help appreciated.

Thanks,
Albert

Cheers,
Rafael

x86_64-unknown-linux-gnu

I've attached a simple test case: source test.ll file and the .s
output files produced with llc from LLVM 3.3 and 3.4, respectively
(running llc test.ll).

Albert

test.ll (39 Bytes)

test-3.3.s (283 Bytes)

test-3.4.s (267 Bytes)

Any news on this? Should I file a bug report?

Yes please. Assign it to me.

Cheers,
Rafael