tensorflow / mlir

"Multi-Level Intermediate Representation" Compiler Infrastructure
1.74k stars 258 forks source link

Build failure: TestPatterns.inc and EnumsGenTest.cpp.inc #39

Closed bondhugula closed 5 years ago

bondhugula commented 5 years ago

This is from a clean build (and the same cmake conf options as in README.md; gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)). mlir commit id (latest as of now): 8d4fbbfd969294f6db4b18c484e92250d5bd1d35

The log below is lengthy but here is the key diagnostic:

mlir::tblgen::EnumAttrCase::getValue() const: Assertion `isStrCase() && "cannot get value for EnumAttrCase"' failed.

$ cmake --build . --target check-mlir

[2/14] Building TestPatterns.inc... FAILED: projects/mlir/test/lib/TestDialect/TestPatterns.inc cd /home/uday/llvm-project/build && /home/uday/llvm-project/build/bin/mlir-tblgen -gen-rewriters -I/home/uday/llvm-project/llvm/projects/mlir/include -I/home/uday/llvm-project/build/projects/mlir/include -I /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect -I /home/uday/llvm-project/llvm/include /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect/TestOps.td -o projects/mlir/test/lib/TestDialect/TestPatterns.inc -d projects/mlir/test/lib/TestDialect/TestPatterns.inc.d mlir-tblgen: /home/uday/llvm-project/llvm/projects/mlir/lib/TableGen/Attribute.cpp:152: int64_t mlir::tblgen::EnumAttrCase::getValue() const: Assertion `isStrCase() && "cannot get value for EnumAttrCase"' failed.

0 0x00000000004cc29e llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:494:22

1 0x00000000004cc331 PrintStackTraceSignalHandler(void*) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:558:1

2 0x00000000004ca601 llvm::sys::RunSignalHandlers() /home/uday/llvm-project/llvm/lib/Support/Signals.cpp:68:20

3 0x00000000004cbd95 SignalHandler(int) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:357:1

4 0x00007f4e01be2e70 __restore_rt (/lib64/libpthread.so.0+0x12e70)

5 0x00007f4e0168deb5 __GI_raise (/lib64/libc.so.6+0x37eb5)

6 0x00007f4e01678895 __GI_abort (/lib64/libc.so.6+0x22895)

7 0x00007f4e01678769 _nl_load_domain.cold (/lib64/libc.so.6+0x22769)

8 0x00007f4e016865b6 (/lib64/libc.so.6+0x305b6)

9 0x0000000000445f18 mlir::tblgen::EnumAttrCase::getValue() const /home/uday/llvm-project/llvm/projects/mlir/lib/TableGen/Attribute.cpp:152:3

10 0x0000000000433704 (anonymous namespace)::PatternEmitter::handleOpArgument(mlir::tblgen::DagLeaf, llvm::StringRef) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:635:57

11 0x000000000043497c (anonymous namespace)::PatternEmitter::emitOpCreate(mlir::tblgen::DagNode, int, int) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:799:46

12 0x0000000000433393 (anonymous namespace)::PatternEmitter::handleRewritePattern(mlir::tblgen::DagNode, int, int) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:595:1

13 0x00000000004330a1 (anonymous namespace)::PatternEmitter::emitRewriteMethod() /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:549:27

14 0x0000000000432e28 (anonymous namespace)::PatternEmitter::emit(llvm::StringRef) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:522:3

15 0x0000000000434ab3 (anonymous namespace)::PatternEmitter::emit(llvm::StringRef, llvm::Record, llvm::DenseMap<llvm::Record const, std::unique_ptr<mlir::tblgen::Operator, std::default_delete >, llvm::DenseMapInfo<llvm::Record const>, llvm::detail::DenseMapPair<llvm::Record const, std::unique_ptr<mlir::tblgen::Operator, std::default_delete > > >*, llvm::raw_ostream&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:809:3

16 0x0000000000434d6e emitRewriters(llvm::RecordKeeper const&, llvm::raw_ostream&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:837:43

17 0x0000000000434eff 'lambda'(llvm::RecordKeeper const&, llvm::raw_ostream&)::operator()(llvm::RecordKeeper const&, llvm::raw_ostream&) const /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:854:27

18 0x00000000004351ea _ZNSt17_Function_handlerIFbRKN4llvm12RecordKeeperERNS0_11raw_ostreamEEUlS3_S5_E_E9_M_invokeERKSt9_Any_dataS3S5 /usr/include/c++/9/bits/std_function.h:287:7

19 0x0000000000413f6b std::function<bool (llvm::RecordKeeper const&, llvm::raw_ostream&)>::operator()(llvm::RecordKeeper const&, llvm::raw_ostream&) const /usr/include/c++/9/bits/std_function.h:691:5

20 0x000000000041371b mlir::GenInfo::invoke(llvm::RecordKeeper const&, llvm::raw_ostream&) const /home/uday/llvm-project/llvm/projects/mlir/include/mlir/TableGen/GenInfo.h:48:3

21 0x0000000000412fa3 MlirTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/mlir-tblgen.cpp:79:1

22 0x00000000004fa83f llvm::TableGenMain(char, bool ()(llvm::raw_ostream&, llvm::RecordKeeper&)) /home/uday/llvm-project/llvm/lib/TableGen/Main.cpp:105:3

23 0x00000000004130d2 main /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/mlir-tblgen.cpp:90:22

24 0x00007f4e01679f33 __libc_start_main (/lib64/libc.so.6+0x23f33)

25 0x0000000000406e3e _start (/home/uday/llvm-project/build/bin/mlir-tblgen+0x406e3e)

Stack dump:

  1. Program arguments: /home/uday/llvm-project/build/bin/mlir-tblgen -gen-rewriters -I/home/uday/llvm-project/llvm/projects/mlir/include -I/home/uday/llvm-project/build/projects/mlir/include -I /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect -I /home/uday/llvm-project/llvm/include /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect/TestOps.td -o projects/mlir/test/lib/TestDialect/TestPatterns.inc -d projects/mlir/test/lib/TestDialect/TestPatterns.inc.d [2/14] Building TestPatterns.inc... FAILED: projects/mlir/test/lib/TestDialect/TestPatterns.inc cd /home/uday/llvm-project/build && /home/uday/llvm-project/build/bin/mlir-tblgen -gen-rewriters -I/home/uday/llvm-project/llvm/projects/mlir/include -I/home/uday/llvm-project/build/projects/mlir/include -I /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect -I /home/uday/llvm-project/llvm/include /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect/TestOps.td -o projects/mlir/test/lib/TestDialect/TestPatterns.inc -d projects/mlir/test/lib/TestDialect/TestPatterns.inc.d mlir-tblgen: /home/uday/llvm-project/llvm/projects/mlir/lib/TableGen/Attribute.cpp:152: int64_t mlir::tblgen::EnumAttrCase::getValue() const: Assertion `isStrCase() && "cannot get value for EnumAttrCase"' failed.

    0 0x00000000004cc29e llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:494:22

    1 0x00000000004cc331 PrintStackTraceSignalHandler(void*) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:558:1

    2 0x00000000004ca601 llvm::sys::RunSignalHandlers() /home/uday/llvm-project/llvm/lib/Support/Signals.cpp:68:20

    3 0x00000000004cbd95 SignalHandler(int) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:357:1

    4 0x00007f4e01be2e70 __restore_rt (/lib64/libpthread.so.0+0x12e70)

    5 0x00007f4e0168deb5 __GI_raise (/lib64/libc.so.6+0x37eb5)

    6 0x00007f4e01678895 __GI_abort (/lib64/libc.so.6+0x22895)

    7 0x00007f4e01678769 _nl_load_domain.cold (/lib64/libc.so.6+0x22769)

    8 0x00007f4e016865b6 (/lib64/libc.so.6+0x305b6)

    9 0x0000000000445f18 mlir::tblgen::EnumAttrCase::getValue() const /home/uday/llvm-project/llvm/projects/mlir/lib/TableGen/Attribute.cpp:152:3

    10 0x0000000000433704 (anonymous namespace)::PatternEmitter::handleOpArgument(mlir::tblgen::DagLeaf, llvm::StringRef) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:635:57

    11 0x000000000043497c (anonymous namespace)::PatternEmitter::emitOpCreate(mlir::tblgen::DagNode, int, int) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:799:46

    12 0x0000000000433393 (anonymous namespace)::PatternEmitter::handleRewritePattern(mlir::tblgen::DagNode, int, int) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:595:1

    13 0x00000000004330a1 (anonymous namespace)::PatternEmitter::emitRewriteMethod() /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:549:27

    14 0x0000000000432e28 (anonymous namespace)::PatternEmitter::emit(llvm::StringRef) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:522:3

    15 0x0000000000434ab3 (anonymous namespace)::PatternEmitter::emit(llvm::StringRef, llvm::Record, llvm::DenseMap<llvm::Record const, std::unique_ptr<mlir::tblgen::Operator, std::default_delete >, llvm::DenseMapInfo<llvm::Record const>, llvm::detail::DenseMapPair<llvm::Record const, std::unique_ptr<mlir::tblgen::Operator, std::default_delete > > >*, llvm::raw_ostream&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:809:3

    16 0x0000000000434d6e emitRewriters(llvm::RecordKeeper const&, llvm::raw_ostream&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:837:43

    17 0x0000000000434eff 'lambda'(llvm::RecordKeeper const&, llvm::raw_ostream&)::operator()(llvm::RecordKeeper const&, llvm::raw_ostream&) const /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/RewriterGen.cpp:854:27

    18 0x00000000004351ea _ZNSt17_Function_handlerIFbRKN4llvm12RecordKeeperERNS0_11raw_ostreamEEUlS3_S5_E_E9_M_invokeERKSt9_Any_dataS3S5 /usr/include/c++/9/bits/std_function.h:287:7

    19 0x0000000000413f6b std::function<bool (llvm::RecordKeeper const&, llvm::raw_ostream&)>::operator()(llvm::RecordKeeper const&, llvm::raw_ostream&) const /usr/include/c++/9/bits/std_function.h:691:5

    20 0x000000000041371b mlir::GenInfo::invoke(llvm::RecordKeeper const&, llvm::raw_ostream&) const /home/uday/llvm-project/llvm/projects/mlir/include/mlir/TableGen/GenInfo.h:48:3

    21 0x0000000000412fa3 MlirTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/mlir-tblgen.cpp:79:1

    22 0x00000000004fa83f llvm::TableGenMain(char, bool ()(llvm::raw_ostream&, llvm::RecordKeeper&)) /home/uday/llvm-project/llvm/lib/TableGen/Main.cpp:105:3

    23 0x00000000004130d2 main /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/mlir-tblgen.cpp:90:22

    24 0x00007f4e01679f33 __libc_start_main (/lib64/libc.so.6+0x23f33)

    25 0x0000000000406e3e _start (/home/uday/llvm-project/build/bin/mlir-tblgen+0x406e3e)

    Stack dump:

  2. Program arguments: /home/uday/llvm-project/build/bin/mlir-tblgen -gen-rewriters -I/home/uday/llvm-project/llvm/projects/mlir/include -I/home/uday/llvm-project/build/projects/mlir/include -I /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect -I /home/uday/llvm-project/llvm/include /home/uday/llvm-project/llvm/projects/mlir/test/lib/TestDialect/TestOps.td -o projects/mlir/test/lib/TestDialect/TestPatterns.inc -d projects/mlir/test/lib/TestDialect/TestPatterns.inc.d [3/14] Building EnumsGenTest.h.inc... FAILED: projects/mlir/unittests/TableGen/EnumsGenTest.h.inc cd /home/uday/llvm-project/build && /home/uday/llvm-project/build/bin/mlir-tblgen -gen-enum-decls -I/home/uday/llvm-project/llvm/projects/mlir/include -I/home/uday/llvm-project/build/projects/mlir/include -I /home/uday/llvm-project/llvm/projects/mlir/unittests/TableGen -I /home/uday/llvm-project/llvm/include /home/uday/llvm-project/llvm/projects/mlir/unittests/TableGen/enums.td -o projects/mlir/unittests/TableGen/EnumsGenTest.h.inc -d projects/mlir/unittests/TableGen/EnumsGenTest.h.inc.d mlir-tblgen: /home/uday/llvm-project/llvm/projects/mlir/lib/TableGen/Attribute.cpp:152: int64_t mlir::tblgen::EnumAttrCase::getValue() const: Assertion `isStrCase() && "cannot get value for EnumAttrCase"' failed.

    0 0x00000000004cc29e llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:494:22

    1 0x00000000004cc331 PrintStackTraceSignalHandler(void*) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:558:1

    2 0x00000000004ca601 llvm::sys::RunSignalHandlers() /home/uday/llvm-project/llvm/lib/Support/Signals.cpp:68:20

    3 0x00000000004cbd95 SignalHandler(int) /home/uday/llvm-project/llvm/lib/Support/Unix/Signals.inc:357:1

    4 0x00007fc7c075ce70 __restore_rt (/lib64/libpthread.so.0+0x12e70)

    5 0x00007fc7c0207eb5 __GI_raise (/lib64/libc.so.6+0x37eb5)

    6 0x00007fc7c01f2895 __GI_abort (/lib64/libc.so.6+0x22895)

    7 0x00007fc7c01f2769 _nl_load_domain.cold (/lib64/libc.so.6+0x22769)

    8 0x00007fc7c02005b6 (/lib64/libc.so.6+0x305b6)

    9 0x0000000000445f18 mlir::tblgen::EnumAttrCase::getValue() const /home/uday/llvm-project/llvm/projects/mlir/lib/TableGen/Attribute.cpp:152:3

    10 0x00000000004071be emitEnumClass(llvm::Record const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, std::vector<mlir::tblgen::EnumAttrCase, std::allocator > const&, llvm::raw_ostream&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/EnumsGen.cpp:62:37

    11 0x00000000004080f3 emitEnumDecl(llvm::Record const&, llvm::raw_ostream&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/EnumsGen.cpp:211:16

    12 0x00000000004084e5 emitEnumDecls(llvm::RecordKeeper const&, llvm::raw_ostream&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/EnumsGen.cpp:238:26

    13 0x000000000040889f 'lambda'(llvm::RecordKeeper const&, llvm::raw_ostream&)::operator()(llvm::RecordKeeper const&, llvm::raw_ostream&) const /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/EnumsGen.cpp:278:18

    14 0x0000000000408b04 _ZNSt17_Function_handlerIFbRKN4llvm12RecordKeeperERNS0_11raw_ostreamEEUlS3_S5_E_E9_M_invokeERKSt9_Any_dataS3S5 /usr/include/c++/9/bits/std_function.h:287:7

    15 0x0000000000413f6b std::function<bool (llvm::RecordKeeper const&, llvm::raw_ostream&)>::operator()(llvm::RecordKeeper const&, llvm::raw_ostream&) const /usr/include/c++/9/bits/std_function.h:691:5

    16 0x000000000041371b mlir::GenInfo::invoke(llvm::RecordKeeper const&, llvm::raw_ostream&) const /home/uday/llvm-project/llvm/projects/mlir/include/mlir/TableGen/GenInfo.h:48:3

    17 0x0000000000412fa3 MlirTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&) /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/mlir-tblgen.cpp:79:1

    18 0x00000000004fa83f llvm::TableGenMain(char, bool ()(llvm::raw_ostream&, llvm::RecordKeeper&)) /home/uday/llvm-project/llvm/lib/TableGen/Main.cpp:105:3

    19 0x00000000004130d2 main /home/uday/llvm-project/llvm/projects/mlir/tools/mlir-tblgen/mlir-tblgen.cpp:90:22

    20 0x00007fc7c01f3f33 __libc_start_main (/lib64/libc.so.6+0x23f33)

    21 0x0000000000406e3e _start (/home/uday/llvm-project/build/bin/mlir-tblgen+0x406e3e)

    Stack dump:

  3. Program arguments: /home/uday/llvm-project/build/bin/mlir-tblgen -gen-enum-decls -I/home/uday/llvm-project/llvm/projects/mlir/include -I/home/uday/llvm-project/build/projects/mlir/include -I /home/uday/llvm-project/llvm/projects/mlir/unittests/TableGen -I /home/uday/llvm-project/llvm/include /home/uday/llvm-project/llvm/projects/mlir/unittests/TableGen/enums.td -o projects/mlir/unittests/TableGen/EnumsGenTest.h.inc -d projects/mlir/unittests/TableGen/EnumsGenTest.h.inc.d [5/14] Linking CXX executable bin/toyc-ch5 ninja: build stopped: subcommand failed.
ymd8bit commented 5 years ago

I found the same issue in my environment. os: ubuntu16 compiler: g++-8 llvm: commit id 180a937d9a66237e061190e9865383236db5d0c0 (latest at 2019/07/02) build command: cmake --build . --target check-mlir

antiagainst commented 5 years ago

Sorry, my bad. Fix coming up.