[LLVMdev] [llvm-tblgen] Two issues: crash case and mysterious double-inclusion case

Dmitry Mikushin dmitry at kernelgen.org
Wed Feb 6 14:47:31 PST 2013


Dear all,

I need your help to understand weird llvm-tblgen behavior. Please take your
favourite version of llvm-tblgen and use it in the root directory of the
archive attached in both bug reports:

http://llvm.org/bugs/show_bug.cgi?id=15188
http://llvm.org/bugs/show_bug.cgi?id=15189

====
1) First test case: crashing
====

$ ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td

assert(iid <= Intrinsic::0  llvm-tblgen     0x00000000005c56b6
1  llvm-tblgen     0x00000000005c54b2
2  libpthread.so.0 0x00007fc734644a10
3  libstdc++.so.6  0x00007fc7345bba5e std::string::_M_data() const + 12
4  libstdc++.so.6  0x00007fc7345bba9c std::string::_M_rep() const + 24
5  libstdc++.so.6  0x00007fc7345bba4c std::string::length() const + 24
6  llvm-tblgen     0x000000000042507f
7  llvm-tblgen     0x000000000051efd9
8  llvm-tblgen     0x000000000051be22
9  llvm-tblgen     0x000000000054f4f9
10 llvm-tblgen     0x000000000055ce65
11 llvm-tblgen     0x000000000054fb50
12 libc.so.6       0x00007fc73426ca76 __libc_start_main + 370
13 llvm-tblgen     0x00000000004071f9
Stack dump:
0.    Program arguments: ./llvm-tblgen -gen-tgt-intrinsic NVPTX1.td
Segmentation fault (core dumped)

====
2) Second test case: double inclusion of file, that is definitely included
once:
====

$ ./llvm-tblgen -gen-tgt-intrinsic NVPTX2.td
Included from NVPTX2.td:20:
NVPTXIntrinsics.td:10:1: error: def 'immFloat0' already defined
def immFloat0 : PatLeaf<(fpimm), [{
^

NVPTX1.td differs from NVPTX2.td just in one line:

include "NVPTXIntrinsics.td"

====
Expected behavior
====

1) In first case, where .td file has empty list of intrinsics, the tool
should not crash
2) In second case there should not me an error message about already
defined symbol, because the definition comes from the file, which is
included only once.

Could you please confirm these issues or help catching my mistake?

Thanks,
- Dima.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130206/1a57ed42/attachment.html>


More information about the llvm-dev mailing list