[LLVMdev] [NVPTX] Backend failure in LegalizeDAG due to unimplemented expand in target lowering

Dmitry N. Mikushin maemarcus at gmail.com
Fri Jun 29 14:11:23 PDT 2012


Hi again,

Kind people on #llvm helped me to utilize bugpoint to reduce the
previously submitted test case. For record, it code be done with the
following command:

$ bugpoint -llc-safe test.ll

The resulting IR is attached, and it is crashing in the same way. Is
it a valid code?

dmikushin at hp2:~/forge/kernelgen/branches/tests_lnt/behavior/sincos>
llc test.ll.1
This action is not supported yet!
UNREACHABLE executed at
/tmp/rpmbuild_debug/BUILD/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1194!
0  libLLVM-3.2svn.so 0x00007f395f147077
1  libLLVM-3.2svn.so 0x00007f395f14763d
2  libpthread.so.0   0x00007f395dee05d0
3  libc.so.6         0x00007f395d74b945 gsignal + 53
4  libc.so.6         0x00007f395d74cf21 abort + 385
5  libLLVM-3.2svn.so 0x00007f395f1305d9
llvm::report_fatal_error(llvm::Twine const&) + 0
6  libLLVM-3.2svn.so 0x00007f395efdb4d2
7  libLLVM-3.2svn.so 0x00007f395efdfc3b
8  libLLVM-3.2svn.so 0x00007f395efdfd2d llvm::SelectionDAG::Legalize() + 49
9  libLLVM-3.2svn.so 0x00007f395f0d0d76
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 2532
10 libLLVM-3.2svn.so 0x00007f395f0d2ae6
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 228
11 libLLVM-3.2svn.so 0x00007f395f0d3524
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) +
2620
12 libLLVM-3.2svn.so 0x00007f395f0d3ade
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) +
896
13 libLLVM-3.2svn.so 0x00007f395ea033de
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 82
14 libLLVM-3.2svn.so 0x00007f395ec3a38d
llvm::FPPassManager::runOnFunction(llvm::Function&) + 331
15 libLLVM-3.2svn.so 0x00007f395ec3a568
llvm::FPPassManager::runOnModule(llvm::Module&) + 86
16 libLLVM-3.2svn.so 0x00007f395ec3a061
llvm::MPPassManager::runOnModule(llvm::Module&) + 381
17 libLLVM-3.2svn.so 0x00007f395ec3b7df
llvm::PassManagerImpl::run(llvm::Module&) + 111
18 libLLVM-3.2svn.so 0x00007f395ec3b841
llvm::PassManager::run(llvm::Module&) + 33
19 llc               0x000000000040e086 main + 2835
20 libc.so.6         0x00007f395d737bc6 __libc_start_main + 230
21 llc               0x000000000040bdb9
Stack dump:
0.	Program arguments: llc test.ll.1
1.	Running pass 'Function Pass Manager' on module 'test.ll.1'.
2.	Running pass 'NVPTX DAG->DAG Pattern Instruction Selection' on
function '@__kernelgen_main'
Aborted

2012/6/27 Dmitry N. Mikushin <maemarcus at gmail.com>:
> ---------- Forwarded message ----------
> From: Dmitry N. Mikushin <maemarcus at gmail.com>
> Date: 2012/6/27
> Subject: [NVPTX] Backend failure in LegalizeDAG due to unimplemented
> expand in target lowering
> To: LLVM-Dev <llvmdev at cs.uiuc.edu>
>
>
> Dear LLVM,
>
> I'm trying to understand why the attached IR code works for x86_64
> target and fails for nvptx64, because of unimplemented expand during
> the target lowering. Any ideas?
> Just change the target triple to x86_64-unknown-unknown, and the same
> IR code could we successfully codegen-ed for x86_64.
>
> Thanks,
> - Dima.
>
> dmikushin at dmikushin-desktop:~/Desktop$ gdb ~/sandbox/bin/llc
> GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> <http://bugs.launchpad.net/gdb-linaro/>...
> Reading symbols from /home/dmikushin/sandbox/bin/llc...done.
> (gdb) r -march=nvptx64 test.ll
> Starting program: /home/dmikushin/sandbox/bin/llc -march=nvptx64 test.ll
> [Thread debugging using libthread_db enabled]
> This action is not supported yet!
> UNREACHABLE executed at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1198!
>
> Program received signal SIGABRT, Aborted.
> 0x00007ffff55ed3a5 in __GI_raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> 64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
>        in ../nptl/sysdeps/unix/sysv/linux/raise.c
> (gdb) bt
> #0  0x00007ffff55ed3a5 in __GI_raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #1  0x00007ffff55f0b0b in __GI_abort () at abort.c:92
> #2  0x00007ffff70183b3 in llvm::llvm_unreachable_internal
> (msg=0x7ffff75b4570 "This action is not supported yet!",
>    file=0x7ffff75b4128
> "/home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp",
> line=1198) at /home/dmikushin/sandbox/src/llvm/lib/Support/ErrorHandling.cpp:98
> #3  0x00007ffff6e9a612 in (anonymous
> namespace)::SelectionDAGLegalize::LegalizeOp (this=0x7fffffffd300,
> Node=0x722820)
>    at /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1198
> #4  0x00007ffff6e911ca in (anonymous
> namespace)::SelectionDAGLegalize::LegalizeDAG (this=0x7fffffffd300) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:227
> #5  0x00007ffff6eb6092 in llvm::SelectionDAG::Legalize (this=0x697590)
> at /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3689
> #6  0x00007ffff6fb3862 in llvm::SelectionDAGISel::CodeGenAndEmitDAG
> (this=0x697230) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:632
> #7  0x00007ffff6fb2a84 in llvm::SelectionDAGISel::SelectBasicBlock
> (this=0x697230, Begin=..., End=..., HadTailCall=@0x7fffffffd880)
>    at /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:499
> #8  0x00007ffff6fb5792 in llvm::SelectionDAGISel::SelectAllBasicBlocks
> (this=0x697230, Fn=...) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1160
> #9  0x00007ffff6fb1ef5 in llvm::SelectionDAGISel::runOnMachineFunction
> (this=0x697230, mf=...) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:367
> #10 0x00007ffff68c91fd in llvm::MachineFunctionPass::runOnFunction
> (this=0x697230, F=...) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/MachineFunctionPass.cpp:33
> #11 0x00007ffff6acb524 in llvm::FPPassManager::runOnFunction
> (this=0x68ec40, F=...) at
> /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1478
> #12 0x00007ffff6acb73f in llvm::FPPassManager::runOnModule
> (this=0x68ec40, M=...) at
> /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1498
> #13 0x00007ffff6acba82 in llvm::MPPassManager::runOnModule
> (this=0x67e4c0, M=...) at
> /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1552
> #14 0x00007ffff6acbfa5 in llvm::PassManagerImpl::run (this=0x63f090,
> M=...) at /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1635
> #15 0x00007ffff6acc159 in llvm::PassManager::run (this=0x7fffffffdf00,
> M=...) at /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1664
> #16 0x000000000040ec9c in main (argc=3, argv=0x7fffffffe148) at
> /home/dmikushin/sandbox/src/llvm/tools/llc/llc.cpp:484
> (gdb) f 4
> #4  0x00007ffff6e911ca in (anonymous
> namespace)::SelectionDAGLegalize::LegalizeDAG (this=0x7fffffffd300) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:227
> 227             LegalizeOp(N);
> (gdb) p N->dump()
> 0x722820: ch = store 0x718f70, 0x722220, 0x714200,
> 0x717740<ST1[%483](align=8)> [ID=58]
> $1 = void

2012/6/27 Dmitry N. Mikushin <maemarcus at gmail.com>:
> Dear LLVM,
>
> I'm trying to understand why the attached IR code works for x86_64
> target and fails for nvptx64, because of unimplemented expand during
> the target lowering. Any ideas?
> Just change the target triple to x86_64-unknown-unknown, and the same
> IR code could we successfully codegen-ed for x86_64.
>
> Thanks,
> - Dima.
>
> dmikushin at dmikushin-desktop:~/Desktop$ gdb ~/sandbox/bin/llc
> GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> <http://bugs.launchpad.net/gdb-linaro/>...
> Reading symbols from /home/dmikushin/sandbox/bin/llc...done.
> (gdb) r -march=nvptx64 test.ll
> Starting program: /home/dmikushin/sandbox/bin/llc -march=nvptx64 test.ll
> [Thread debugging using libthread_db enabled]
> This action is not supported yet!
> UNREACHABLE executed at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1198!
>
> Program received signal SIGABRT, Aborted.
> 0x00007ffff55ed3a5 in __GI_raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> 64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
>        in ../nptl/sysdeps/unix/sysv/linux/raise.c
> (gdb) bt
> #0  0x00007ffff55ed3a5 in __GI_raise (sig=6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #1  0x00007ffff55f0b0b in __GI_abort () at abort.c:92
> #2  0x00007ffff70183b3 in llvm::llvm_unreachable_internal
> (msg=0x7ffff75b4570 "This action is not supported yet!",
>    file=0x7ffff75b4128
> "/home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp",
> line=1198) at /home/dmikushin/sandbox/src/llvm/lib/Support/ErrorHandling.cpp:98
> #3  0x00007ffff6e9a612 in (anonymous
> namespace)::SelectionDAGLegalize::LegalizeOp (this=0x7fffffffd300,
> Node=0x722820)
>    at /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1198
> #4  0x00007ffff6e911ca in (anonymous
> namespace)::SelectionDAGLegalize::LegalizeDAG (this=0x7fffffffd300) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:227
> #5  0x00007ffff6eb6092 in llvm::SelectionDAG::Legalize (this=0x697590)
> at /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3689
> #6  0x00007ffff6fb3862 in llvm::SelectionDAGISel::CodeGenAndEmitDAG
> (this=0x697230) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:632
> #7  0x00007ffff6fb2a84 in llvm::SelectionDAGISel::SelectBasicBlock
> (this=0x697230, Begin=..., End=..., HadTailCall=@0x7fffffffd880)
>    at /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:499
> #8  0x00007ffff6fb5792 in llvm::SelectionDAGISel::SelectAllBasicBlocks
> (this=0x697230, Fn=...) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1160
> #9  0x00007ffff6fb1ef5 in llvm::SelectionDAGISel::runOnMachineFunction
> (this=0x697230, mf=...) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:367
> #10 0x00007ffff68c91fd in llvm::MachineFunctionPass::runOnFunction
> (this=0x697230, F=...) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/MachineFunctionPass.cpp:33
> #11 0x00007ffff6acb524 in llvm::FPPassManager::runOnFunction
> (this=0x68ec40, F=...) at
> /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1478
> #12 0x00007ffff6acb73f in llvm::FPPassManager::runOnModule
> (this=0x68ec40, M=...) at
> /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1498
> #13 0x00007ffff6acba82 in llvm::MPPassManager::runOnModule
> (this=0x67e4c0, M=...) at
> /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1552
> #14 0x00007ffff6acbfa5 in llvm::PassManagerImpl::run (this=0x63f090,
> M=...) at /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1635
> #15 0x00007ffff6acc159 in llvm::PassManager::run (this=0x7fffffffdf00,
> M=...) at /home/dmikushin/sandbox/src/llvm/lib/VMCore/PassManager.cpp:1664
> #16 0x000000000040ec9c in main (argc=3, argv=0x7fffffffe148) at
> /home/dmikushin/sandbox/src/llvm/tools/llc/llc.cpp:484
> (gdb) f 4
> #4  0x00007ffff6e911ca in (anonymous
> namespace)::SelectionDAGLegalize::LegalizeDAG (this=0x7fffffffd300) at
> /home/dmikushin/sandbox/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:227
> 227             LegalizeOp(N);
> (gdb) p N->dump()
> 0x722820: ch = store 0x718f70, 0x722220, 0x714200,
> 0x717740<ST1[%483](align=8)> [ID=58]
> $1 = void
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.ll.1
Type: application/octet-stream
Size: 3297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120629/68009c4e/attachment.obj>


More information about the llvm-dev mailing list