Stanislav Manilov via llvm-dev
2016-May-03 11:04 UTC
[llvm-dev] Is the CppBackend still supported?
Hello, I was trying to compile a simple program with the CppBackend like so: $ clang str_arg.c -emit-llvm -S $ llc -march=cpp str_arg.ll It produces a file `str_arg.cpp` as expected, however it doesn't seem that the resulting file is correct. For once, it includes `<llvm/Analysis/Verifier.h>` which seems to have been moved to `llvm/IR/Verifier.h` as far back as 2013. My question is this: is the CppBackend supposed to work? If so, what am I missing? Listing of str_arg.c: #include <stdio.h> void i(unsigned index, char *string) { printf("%d %s\n", index, string); } int main() { i(10, "foo"); return 0; } clang version: clang version 3.7.1 (http://llvm.org/git/clang.git 0dbefa1b83eb90f7a06b5df5df254ce32be3db4b) (http://llvm.org/git/llvm.git 33c352b3eda89abc24e7511d9045fa2e499a42e3) Target: x86_64-unknown-linux-gnu Thread model: posix llc version: LLVM (http://llvm.org/): LLVM version 3.7.1 Optimized build. Built Apr 4 2016 (15:04:44). Default target: x86_64-unknown-linux-gnu Host CPU: ivybridge Registered Targets: aarch64 - AArch64 (little endian) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) armeb - ARM (big endian) bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) cpp - C++ backend hexagon - Hexagon mips - Mips mips64 - Mips64 [experimental] mips64el - Mips64el [experimental] mipsel - Mipsel msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore Kind regards, - Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160503/ed886c3f/attachment.html>
Justin Bogner via llvm-dev
2016-May-03 19:13 UTC
[llvm-dev] Is the CppBackend still supported?
Stanislav Manilov via llvm-dev <llvm-dev at lists.llvm.org> writes:> Hello, > > I was trying to compile a simple program with the CppBackend like so: > > $ clang str_arg.c -emit-llvm -S > $ llc -march=cpp str_arg.ll > > It produces a file `str_arg.cpp` as expected, however it doesn't seem that > the resulting file is correct. For once, it includes > `<llvm/Analysis/Verifier.h>` which seems to have been moved to > `llvm/IR/Verifier.h` as far back as 2013. > > My question is this: is the CppBackend supposed to work? If so, what am I > missing?It is supposed to work, but it's definitely broken. I suppose nobody motivated to fix it has noticed :( Feel free to file a bug on llvm.org/bugs or to try to fix these issues and send patches. Sorry I don't have a better answer for you.> Listing of str_arg.c: > > #include <stdio.h> > > void i(unsigned index, char *string) { > printf("%d %s\n", index, string); > } > > int main() { > i(10, "foo"); > return 0; > } > > clang version: > > clang version 3.7.1 (http://llvm.org/git/clang.git > 0dbefa1b83eb90f7a06b5df5df254ce32be3db4b) (http://llvm.org/git/llvm.git > 33c352b3eda89abc24e7511d9045fa2e499a42e3) > Target: x86_64-unknown-linux-gnu > Thread model: posix > > llc version: > > LLVM (http://llvm.org/): > LLVM version 3.7.1 > Optimized build. > Built Apr 4 2016 (15:04:44). > Default target: x86_64-unknown-linux-gnu > Host CPU: ivybridge > > Registered Targets: > aarch64 - AArch64 (little endian) > aarch64_be - AArch64 (big endian) > amdgcn - AMD GCN GPUs > arm - ARM > arm64 - ARM64 (little endian) > armeb - ARM (big endian) > bpf - BPF (host endian) > bpfeb - BPF (big endian) > bpfel - BPF (little endian) > cpp - C++ backend > hexagon - Hexagon > mips - Mips > mips64 - Mips64 [experimental] > mips64el - Mips64el [experimental] > mipsel - Mipsel > msp430 - MSP430 [experimental] > nvptx - NVIDIA PTX 32-bit > nvptx64 - NVIDIA PTX 64-bit > ppc32 - PowerPC 32 > ppc64 - PowerPC 64 > ppc64le - PowerPC 64 LE > r600 - AMD GPUs HD2XXX-HD6XXX > sparc - Sparc > sparcel - Sparc LE > sparcv9 - Sparc V9 > systemz - SystemZ > thumb - Thumb > thumbeb - Thumb (big endian) > x86 - 32-bit X86: Pentium-Pro and above > x86-64 - 64-bit X86: EM64T and AMD64 > xcore - XCore > > Kind regards, > - Stan > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Jonathan Roelofs via llvm-dev
2016-May-03 19:30 UTC
[llvm-dev] Is the CppBackend still supported?
On 5/3/16 1:13 PM, Justin Bogner via llvm-dev wrote:> Stanislav Manilov via llvm-dev <llvm-dev at lists.llvm.org> writes: >> Hello, >> >> I was trying to compile a simple program with the CppBackend like so: >> >> $ clang str_arg.c -emit-llvm -S >> $ llc -march=cpp str_arg.ll >> >> It produces a file `str_arg.cpp` as expected, however it doesn't seem that >> the resulting file is correct. For once, it includes >> `<llvm/Analysis/Verifier.h>` which seems to have been moved to >> `llvm/IR/Verifier.h` as far back as 2013. >> >> My question is this: is the CppBackend supposed to work? If so, what am I >> missing? > > It is supposed to work, but it's definitely broken. I suppose nobody > motivated to fix it has noticed :( > > Feel free to file a bug on llvm.org/bugs or to try to fix these issues > and send patches. Sorry I don't have a better answer for you.I'm not motivated enough to fix it either, but maybe it would be a good idea to have a unit test for it that takes in the bitcode we use to check all of the backward compatibility guarantees, and makes sure that it is capable of round-tripping them. Jon> >> Listing of str_arg.c: >> >> #include <stdio.h> >> >> void i(unsigned index, char *string) { >> printf("%d %s\n", index, string); >> } >> >> int main() { >> i(10, "foo"); >> return 0; >> } >> >> clang version: >> >> clang version 3.7.1 (http://llvm.org/git/clang.git >> 0dbefa1b83eb90f7a06b5df5df254ce32be3db4b) (http://llvm.org/git/llvm.git >> 33c352b3eda89abc24e7511d9045fa2e499a42e3) >> Target: x86_64-unknown-linux-gnu >> Thread model: posix >> >> llc version: >> >> LLVM (http://llvm.org/): >> LLVM version 3.7.1 >> Optimized build. >> Built Apr 4 2016 (15:04:44). >> Default target: x86_64-unknown-linux-gnu >> Host CPU: ivybridge >> >> Registered Targets: >> aarch64 - AArch64 (little endian) >> aarch64_be - AArch64 (big endian) >> amdgcn - AMD GCN GPUs >> arm - ARM >> arm64 - ARM64 (little endian) >> armeb - ARM (big endian) >> bpf - BPF (host endian) >> bpfeb - BPF (big endian) >> bpfel - BPF (little endian) >> cpp - C++ backend >> hexagon - Hexagon >> mips - Mips >> mips64 - Mips64 [experimental] >> mips64el - Mips64el [experimental] >> mipsel - Mipsel >> msp430 - MSP430 [experimental] >> nvptx - NVIDIA PTX 32-bit >> nvptx64 - NVIDIA PTX 64-bit >> ppc32 - PowerPC 32 >> ppc64 - PowerPC 64 >> ppc64le - PowerPC 64 LE >> r600 - AMD GPUs HD2XXX-HD6XXX >> sparc - Sparc >> sparcel - Sparc LE >> sparcv9 - Sparc V9 >> systemz - SystemZ >> thumb - Thumb >> thumbeb - Thumb (big endian) >> x86 - 32-bit X86: Pentium-Pro and above >> x86-64 - 64-bit X86: EM64T and AMD64 >> xcore - XCore >> >> Kind regards, >> - Stan >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Jon Roelofs jonathan at codesourcery.com CodeSourcery / Mentor Embedded
Sean Silva via llvm-dev
2016-May-03 20:14 UTC
[llvm-dev] Is the CppBackend still supported?
AFAICT it is dead. On Tue, May 3, 2016 at 4:04 AM, Stanislav Manilov via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hello, > > I was trying to compile a simple program with the CppBackend like so: > > $ clang str_arg.c -emit-llvm -S > $ llc -march=cpp str_arg.ll > > It produces a file `str_arg.cpp` as expected, however it doesn't seem that > the resulting file is correct. For once, it includes > `<llvm/Analysis/Verifier.h>` which seems to have been moved to > `llvm/IR/Verifier.h` as far back as 2013. > > My question is this: is the CppBackend supposed to work? If so, what am I > missing? > > Listing of str_arg.c: > > #include <stdio.h> > > void i(unsigned index, char *string) { > printf("%d %s\n", index, string); > } > > int main() { > i(10, "foo"); > return 0; > } > > clang version: > > clang version 3.7.1 (http://llvm.org/git/clang.git > 0dbefa1b83eb90f7a06b5df5df254ce32be3db4b) (http://llvm.org/git/llvm.git > 33c352b3eda89abc24e7511d9045fa2e499a42e3) > Target: x86_64-unknown-linux-gnu > Thread model: posix > > llc version: > > LLVM (http://llvm.org/): > LLVM version 3.7.1 > Optimized build. > Built Apr 4 2016 (15:04:44). > Default target: x86_64-unknown-linux-gnu > Host CPU: ivybridge > > Registered Targets: > aarch64 - AArch64 (little endian) > aarch64_be - AArch64 (big endian) > amdgcn - AMD GCN GPUs > arm - ARM > arm64 - ARM64 (little endian) > armeb - ARM (big endian) > bpf - BPF (host endian) > bpfeb - BPF (big endian) > bpfel - BPF (little endian) > cpp - C++ backend > hexagon - Hexagon > mips - Mips > mips64 - Mips64 [experimental] > mips64el - Mips64el [experimental] > mipsel - Mipsel > msp430 - MSP430 [experimental] > nvptx - NVIDIA PTX 32-bit > nvptx64 - NVIDIA PTX 64-bit > ppc32 - PowerPC 32 > ppc64 - PowerPC 64 > ppc64le - PowerPC 64 LE > r600 - AMD GPUs HD2XXX-HD6XXX > sparc - Sparc > sparcel - Sparc LE > sparcv9 - Sparc V9 > systemz - SystemZ > thumb - Thumb > thumbeb - Thumb (big endian) > x86 - 32-bit X86: Pentium-Pro and above > x86-64 - 64-bit X86: EM64T and AMD64 > xcore - XCore > > Kind regards, > - Stan > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160503/68c20912/attachment.html>
James Y Knight via llvm-dev
2016-May-03 20:23 UTC
[llvm-dev] Is the CppBackend still supported?
Yes, it's quite obviously dead and should be deleted. When I brought this up last time -- after realizing that it wasn't actually a backend that targetted c++ (which might be useful), but rather just something that emitted IR by calling llvm C++ functions (which really isn't IMO) -- someone also pointed out that it also really ought to be using IRBuilder...if anyone cared about it. On Tue, May 3, 2016 at 4:14 PM, Sean Silva via llvm-dev < llvm-dev at lists.llvm.org> wrote:> AFAICT it is dead. > > On Tue, May 3, 2016 at 4:04 AM, Stanislav Manilov via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hello, >> >> I was trying to compile a simple program with the CppBackend like so: >> >> $ clang str_arg.c -emit-llvm -S >> $ llc -march=cpp str_arg.ll >> >> It produces a file `str_arg.cpp` as expected, however it doesn't seem >> that the resulting file is correct. For once, it includes >> `<llvm/Analysis/Verifier.h>` which seems to have been moved to >> `llvm/IR/Verifier.h` as far back as 2013. >> >> My question is this: is the CppBackend supposed to work? If so, what am I >> missing? >> >> Listing of str_arg.c: >> >> #include <stdio.h> >> >> void i(unsigned index, char *string) { >> printf("%d %s\n", index, string); >> } >> >> int main() { >> i(10, "foo"); >> return 0; >> } >> >> clang version: >> >> clang version 3.7.1 (http://llvm.org/git/clang.git >> 0dbefa1b83eb90f7a06b5df5df254ce32be3db4b) (http://llvm.org/git/llvm.git >> 33c352b3eda89abc24e7511d9045fa2e499a42e3) >> Target: x86_64-unknown-linux-gnu >> Thread model: posix >> >> llc version: >> >> LLVM (http://llvm.org/): >> LLVM version 3.7.1 >> Optimized build. >> Built Apr 4 2016 (15:04:44). >> Default target: x86_64-unknown-linux-gnu >> Host CPU: ivybridge >> >> Registered Targets: >> aarch64 - AArch64 (little endian) >> aarch64_be - AArch64 (big endian) >> amdgcn - AMD GCN GPUs >> arm - ARM >> arm64 - ARM64 (little endian) >> armeb - ARM (big endian) >> bpf - BPF (host endian) >> bpfeb - BPF (big endian) >> bpfel - BPF (little endian) >> cpp - C++ backend >> hexagon - Hexagon >> mips - Mips >> mips64 - Mips64 [experimental] >> mips64el - Mips64el [experimental] >> mipsel - Mipsel >> msp430 - MSP430 [experimental] >> nvptx - NVIDIA PTX 32-bit >> nvptx64 - NVIDIA PTX 64-bit >> ppc32 - PowerPC 32 >> ppc64 - PowerPC 64 >> ppc64le - PowerPC 64 LE >> r600 - AMD GPUs HD2XXX-HD6XXX >> sparc - Sparc >> sparcel - Sparc LE >> sparcv9 - Sparc V9 >> systemz - SystemZ >> thumb - Thumb >> thumbeb - Thumb (big endian) >> x86 - 32-bit X86: Pentium-Pro and above >> x86-64 - 64-bit X86: EM64T and AMD64 >> xcore - XCore >> >> Kind regards, >> - Stan >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160503/b9932770/attachment.html>