[llvm] [GlobalISel] Make IRTranslator able to handle PHIs with empty types. (PR #73235)

Dávid Ferenc Szabó via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 09:17:53 PST 2023


================
@@ -1,4 +1,5 @@
 ; RUN: llc < %s
+; RUN: llc -O0 -mtriple=aarch64 -global-isel < %s
 ; PR9900
 
----------------
dfszabo wrote:

There is at line 50. My reason to put here is that this change is not target specific. On other hand the default target is x86 which crash with this, hence I changed it to aarch64 for this test for now, should be removed once x86 would not crash on this. Therefore I am not sure if we should move this to specific target test folder, but I understand this might interfere with the generic nature of these tests.

x86 will crash on this test even without the change with the same error message which is
```
RUN: at line 1: /home/david/work/llvm-community/build/bin/llc < /home/david/work/llvm-community/llvm-project/llvm/test/CodeGen/Generic/zero-sized-array.ll
+ /home/david/work/llvm-community/build/bin/llc
RUN: at line 2: /home/david/work/llvm-community/build/bin/llc -O0 -global-isel < /home/david/work/llvm-community/llvm-project/llvm/test/CodeGen/Generic/zero-sized-array.ll
+ /home/david/work/llvm-community/build/bin/llc -O0 -global-isel
llc: /home/david/work/llvm-community/llvm-project/llvm/include/llvm/CodeGen/MachineRegisterInfo.h:665: const llvm::TargetRegisterClass *llvm::MachineRegisterInfo::getRegClass(llvm::Register) const: Assertion `isa<const TargetRegisterClass *>(VRegInfo[Reg.id()].first) && "Register class not set, wrong accessor"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/david/work/llvm-community/build/bin/llc -O0 -global-isel
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Fast Tile Register Preconfigure' on function '@f'
 #0 0x00007f7ed261c1ad llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/david/work/llvm-community/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:11
 #1 0x00007f7ed261c6eb PrintStackTraceSignalHandler(void*) /home/david/work/llvm-community/llvm-project/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x00007f7ed261a60b llvm::sys::RunSignalHandlers() /home/david/work/llvm-community/llvm-project/llvm/lib/Support/Signals.cpp:104:5
 #3 0x00007f7ed261cf11 SignalHandler(int) /home/david/work/llvm-community/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007f7ed7d313c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
 #5 0x00007f7ed1cef03b raise /build/glibc-sMfBJT/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007f7ed1cce859 abort /build/glibc-sMfBJT/glibc-2.31/stdlib/abort.c:81:7
 #7 0x00007f7ed1cce729 get_sysdep_segment_value /build/glibc-sMfBJT/glibc-2.31/intl/loadmsgcat.c:509:8
 #8 0x00007f7ed1cce729 _nl_load_domain /build/glibc-sMfBJT/glibc-2.31/intl/loadmsgcat.c:970:34
 #9 0x00007f7ed1ce0006 (/lib/x86_64-linux-gnu/libc.so.6+0x34006)
#10 0x00007f7eda0f3c3d llvm::MachineRegisterInfo::getRegClass(llvm::Register) const /home/david/work/llvm-community/llvm-project/llvm/include/llvm/CodeGen/MachineRegisterInfo.h:0:5
#11 0x00007f7eda150dc6 (anonymous namespace)::X86FastPreTileConfig::runOnMachineFunction(llvm::MachineFunction&) /home/david/work/llvm-community/llvm-project/llvm/lib/Target/X86/X86FastPreTileConfig.cpp:670:36
#12 0x00007f7ed6621631 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/david/work/llvm-community/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:93:8
#13 0x00007f7ed310b2d4 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/david/work/llvm-community/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1443:23
#14 0x00007f7ed3110655 llvm::FPPassManager::runOnModule(llvm::Module&) /home/david/work/llvm-community/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1489:16
#15 0x00007f7ed310bca8 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/david/work/llvm-community/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1558:23
#16 0x00007f7ed310b7d3 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/david/work/llvm-community/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:541:16
#17 0x00007f7ed3110961 llvm::legacy::PassManager::run(llvm::Module&) /home/david/work/llvm-community/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1685:3
#18 0x0000000000230328 compileModule(char**, llvm::LLVMContext&) /home/david/work/llvm-community/llvm-project/llvm/tools/llc/llc.cpp:761:41
#19 0x000000000022e4fa main /home/david/work/llvm-community/llvm-project/llvm/tools/llc/llc.cpp:434:13
#20 0x00007f7ed1cd00b3 __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:342:3
#21 0x000000000022dc5e _start (/home/david/work/llvm-community/build/bin/llc+0x22dc5e)
/home/david/work/llvm-community/build/test/CodeGen/Generic/Output/zero-sized-array.ll.script: line 2: 307428 Aborted                 (core dumped) /home/david/work/llvm-community/build/bin/llc -O0 -global-isel < /home/david/work/llvm-community/llvm-project/llvm/test/CodeGen/Generic/zero-sized-array.ll

--

```
So this crash is independent of the code change.

https://github.com/llvm/llvm-project/pull/73235


More information about the llvm-commits mailing list