Open ThePuzzlemaker opened 7 months ago
Tested with master branch as of f035c018a6a581c38680651d4856631d9c6ccb0a, it fails with the following assertion:
llc: /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp:352: std::pair<llvm::SDValue, llvm::SDNode*> lowerCallFromStatepointLoweringInfo(llvm::SelectionDAGBuilder::StatepointLoweringInfo&, llvm::SelectionDAGBuilder&): Assertion `CallEnd->getOpcode() == ISD::CALLSEQ_END && "expected!"' failed.
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=0x6, no_tid=no_tid@entry=0x0) at pthread_kill.c:44
#1 0x00007ffff78ab393 in __pthread_kill_internal (signo=0x6, threadid=<optimized out>) at pthread_kill.c:78
#2 0x00007ffff785a6c8 in __GI_raise (sig=sig@entry=0x6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff78424b8 in __GI_abort () at abort.c:79
#4 0x00007ffff78423dc in __assert_fail_base (fmt=0x7ffff79bcb68 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x555559d07988 "CallEnd->getOpcode() == ISD::CALLSEQ_END && \"expected!\"",
file=file@entry=0x555559d07260 "/home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp", line=line@entry=0x160,
function=function@entry=0x555559d078e8 "std::pair<llvm::SDValue, llvm::SDNode*> lowerCallFromStatepointLoweringInfo(llvm::SelectionDAGBuilder::StatepointLoweringInfo&, llvm::SelectionDAGBuilder&)") at assert.c:94
#5 0x00007ffff7852d46 in __assert_fail (assertion=0x555559d07988 "CallEnd->getOpcode() == ISD::CALLSEQ_END && \"expected!\"",
file=0x555559d07260 "/home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp", line=0x160,
function=0x555559d078e8 "std::pair<llvm::SDValue, llvm::SDNode*> lowerCallFromStatepointLoweringInfo(llvm::SelectionDAGBuilder::StatepointLoweringInfo&, llvm::SelectionDAGBuilder&)")
at assert.c:103
#6 0x000055555ff94047 in lowerCallFromStatepointLoweringInfo (SI=..., Builder=...) at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp:352
#7 0x000055555ff96446 in llvm::SelectionDAGBuilder::LowerAsSTATEPOINT (this=0x555561d676c0, SI=...) at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp:745
#8 0x000055555ff9826e in llvm::SelectionDAGBuilder::LowerStatepoint (this=0x555561d676c0, I=..., EHPadBB=0x0) at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp:1098
#9 0x000055555fdf0800 in llvm::SelectionDAGBuilder::visitIntrinsicCall (this=0x555561d676c0, I=..., Intrinsic=0x88)
at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:7246
#10 0x000055555fdfbe0d in llvm::SelectionDAGBuilder::visitCall (this=0x555561d676c0, I=...) at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8779
#11 0x000055555fdc64dd in llvm::SelectionDAGBuilder::visit (this=0x555561d676c0, Opcode=0x38, I=...) at /home/wren/llvm-project/llvm/include/llvm/IR/Instruction.def:209
#12 0x000055555fdc5d02 in llvm::SelectionDAGBuilder::visit (this=0x555561d676c0, I=...) at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1316
#13 0x000055555fec179e in llvm::SelectionDAGISel::SelectBasicBlock (this=0x555561d756b0, Begin=..., End=..., HadTailCall=@0x7fffffffd170: 0x0)
at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:726
#14 0x000055555fec795b in llvm::SelectionDAGISel::SelectAllBasicBlocks (this=0x555561d756b0, Fn=...) at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1751
#15 0x000055555fec0246 in llvm::SelectionDAGISel::runOnMachineFunction (this=0x555561d756b0, mf=...) at /home/wren/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:516
#16 0x000055555d8d1406 in (anonymous namespace)::WebAssemblyDAGToDAGISel::runOnMachineFunction (this=0x555561d756b0, MF=...)
at /home/wren/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp:60
#17 0x000055555ebd1495 in llvm::MachineFunctionPass::runOnFunction (this=0x555561d756b0, F=...) at /home/wren/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:93
#18 0x000055555f32a78c in llvm::FPPassManager::runOnFunction (this=0x555561d750b0, F=...) at /home/wren/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1445
#19 0x000055555f32aa5e in llvm::FPPassManager::runOnModule (this=0x555561d750b0, M=...) at /home/wren/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1491
#20 0x000055555f32aeb3 in (anonymous namespace)::MPPassManager::runOnModule (this=0x555561d5f920, M=...) at /home/wren/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1560
#21 0x000055555f325aa9 in llvm::legacy::PassManagerImpl::run (this=0x555561d64e00, M=...) at /home/wren/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:542
#22 0x000055555f32b785 in llvm::legacy::PassManager::run (this=0x7fffffffde20, M=...) at /home/wren/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1687
#23 0x000055555be17b5b in compileModule (argv=0x7fffffffe5f8, Context=...) at /home/wren/llvm-project/llvm/tools/llc/llc.cpp:743
#24 0x000055555be152c9 in main (argc=0x4, argv=0x7fffffffe5f8) at /home/wren/llvm-project/llvm/tools/llc/llc.cpp:412
The SelectionDAG opcode here appears to be WebAssemblyISD::CALL
, instead of the expected ISD::CALLSEQ_END
. I don't know enough about SelectionDAG to fix this issue, but this may help others debug so I thought I'd mention it.
@llvm/issue-subscribers-backend-webassembly
Author: James [Undefined] (ThePuzzlemaker)
I tried this code:
I ran
llc tmp-opt.ll --march wasm32
.What I expected to happen:
llc
compiles, generates a.s
fileWhat happened:
llc
crashes and hangs, with stacktrace:After investigation in GDB (blasphemy, I know :P):
Version
``` $ llc --version --verbose LLVM (http://llvm.org/): LLVM version 17.0.6 Optimized build. Default target: x86_64-pc-linux-gnu Host CPU: znver4 Registered Targets: aarch64 - AArch64 (little endian) aarch64_32 - AArch64 (little endian ILP32) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) arm64_32 - ARM64 (little endian ILP32) armeb - ARM (big endian) avr - Atmel AVR Microcontroller bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai loongarch32 - 32-bit LoongArch loongarch64 - 64-bit LoongArch mips - MIPS (32-bit big endian) mips64 - MIPS (64-bit big endian) mips64el - MIPS (64-bit little endian) mipsel - MIPS (32-bit little endian) msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc32le - PowerPC 32 LE ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) ve - VE wasm32 - WebAssembly 32-bit wasm64 - WebAssembly 64-bit x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore ```
I can provide any more information if needed.