<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87192>87192</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
"llc" crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cpython-java
</td>
</tr>
</table>
<pre>
# description
when i use 'llc' to translate an IR, crash happened. I don't know whether it's a bug of 'llc' and want to be sure about it.
thank you for your help!
# ir
```
; ModuleID = '1360'
source_filename = "M"
@my_format_str_int = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@my_format_str_float = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
define i32 @main() {
BB:
%A = alloca i16, align 8
store i64 1, ptr %A, align 4
%0 = call i16 @my_func_1(i16 -32768, i16 -32768)
%1 = zext i16 %0 to i32
%B = or i16 32767, %0
%2 = call i32 (ptr, ...) @printf(ptr @my_format_str_int, i32 %1)
store i16 %B, ptr %A, align 2
ret i32 0
}
declare i32 @printf(ptr, ...)
define internal i16 @my_func_1(i16 %0, i16 %1) {
my_block_1:
br label %BB1
BB1: ; preds = %my_block_1
%my_new_inst_2 = and i16 %0, %1
br label %BB
BB: ; preds = %BB1
%A = alloca i1, align 1
%G1 = getelementptr ptr, ptr %A, i8 -128
%G3 = getelementptr ptr, ptr %A, i8 0
%G = getelementptr ptr, ptr %G1, i8 -128
%C = icmp sle i1 false, true
store i1 %C, ptr %G, align 1
store ptr %G3, ptr %G, align 8
ret i16 %my_new_inst_2
}
```
# cmd
`./llc temp -mtriple=aarch64 -O=0 -mcpu=a64fx` (`llc` -> `17.0.4`)
# error info
```
llc: /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/build/lib/Target/AArch64/AArch64GenAsmWriter.inc:20896: static const char *llvm::AArch64InstPrinter::getRegisterName(llvm::MCRegister, unsigned int): Assertion `RegNo && RegNo < 716 && "Invalid register number!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./llc 1360.ll -mtriple=aarch64 -O=0 -mcpu=a64fx -mattr=+zcm
1. Running pass 'Function Pass Manager' on module '1360.ll'.
2. Running pass 'AArch64 Assembly Printer' on function '@main'
#0 0x0000000000e05eeb backtrace (./llc+0xe05eeb)
#1 0x000000000f79b765 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Support/Unix/Signals.inc:602:11
#2 0x000000000f79cffb PrintStackTraceSignalHandler(void*) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Support/Unix/Signals.inc:675:1
#3 0x000000000f793628 llvm::sys::RunSignalHandlers() /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Support/Signals.cpp:104:5
#4 0x000000000f7a17eb SignalHandler(int) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Support/Unix/Signals.inc:413:1
#5 0x00007f24c378b520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#6 0x00007f24c37dfa7c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x96a7c)
#7 0x00007f24c378b476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#8 0x00007f24c37717f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#9 0x00007f24c377171b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#10 0x00007f24c3782e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x0000000008b11d28 llvm::AArch64InstPrinter::getRegisterName(llvm::MCRegister, unsigned int) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/build/lib/Target/AArch64/AArch64GenAsmWriter.inc:21639:10
#12 0x0000000008b2caac llvm::AArch64InstPrinter::printRegName(llvm::raw_ostream&, llvm::MCRegister) const /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp:63:28
#13 0x0000000008b0aac0 llvm::AArch64InstPrinter::printShiftedRegister(llvm::MCInst const*, unsigned int, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp:1249:16
#14 0x0000000008ae91b9 llvm::AArch64InstPrinter::printInstruction(llvm::MCInst const*, unsigned long, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/build/lib/Target/AArch64/AArch64GenAsmWriter.inc:19358:5
#15 0x0000000008b35667 llvm::AArch64InstPrinter::printInst(llvm::MCInst const*, unsigned long, llvm::StringRef, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp:0:5
#16 0x000000000d7084ef llvm::MCTargetStreamer::prettyPrintAsm(llvm::MCInstPrinter&, unsigned long, llvm::MCInst const&, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/MC/MCStreamer.cpp:1072:15
#17 0x000000000d4b1662 (anonymous namespace)::MCAsmStreamer::emitInstruction(llvm::MCInst const&, llvm::MCSubtargetInfo const&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/MC/MCAsmStreamer.cpp:2401:5
#18 0x000000000a4d273a llvm::AsmPrinter::EmitToStreamer(llvm::MCStreamer&, llvm::MCInst const&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:402:1
#19 0x000000000197d1ee (anonymous namespace)::AArch64AsmPrinter::emitInstruction(llvm::MachineInstr const*) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp:1774:3
#20 0x000000000a4f21e9 llvm::AsmPrinter::emitFunctionBody() /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1729:13
#21 0x000000000197301a (anonymous namespace)::AArch64AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp:154:5
#22 0x000000000b3c32da llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:8
#23 0x000000000d03238b llvm::FPPassManager::runOnFunction(llvm::Function&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/IR/LegacyPassManager.cpp:1435:27
#24 0x000000000d04cf9b llvm::FPPassManager::runOnModule(llvm::Module&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/IR/LegacyPassManager.cpp:1481:16
#25 0x000000000d033b15 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/IR/LegacyPassManager.cpp:1550:27
#26 0x000000000d032d23 llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/IR/LegacyPassManager.cpp:535:44
#27 0x000000000d04dab4 llvm::legacy::PassManager::run(llvm::Module&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/lib/IR/LegacyPassManager.cpp:1677:3
#28 0x0000000000e85914 compileModule(char**, llvm::LLVMContext&) /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/tools/llc/llc.cpp:754:41
#29 0x0000000000e7df38 main /home/jiangbo/compiler_test/llvm/llvm-project-llvmorg-17.0.4/llvm/tools/llc/llc.cpp:416:22
#30 0x00007f24c3772d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#31 0x00007f24c3772e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#32 0x0000000000dceece _start (./llc+0xdceece)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUWltzozgW_jXKi8ouXQDBQx5sp92bqs5MVzK7--gSIGxNg6Ak0Ynn129JYHOJZ5LMTHqyqS4SpKOj833nogM0N0bulRDXIFyD8OaKt_ZQ6-usOdpDrRa_8u_8Kq3z4zUgFObCZFo2VtYKoBuAVo8HoaCErREQEFaWGSAM2hpazZUpuRWQK3h7D8gGZpqbAzzwphFK5Et4C_NaAcIs_KbqR_h4EPYgNJQWEGYgh2m7h3UxUstVDh-5sk5_KqBptYA8rVsLpV125nRXe-DqGzzWLSxq7X5reBBlAwjupQiFUvd_R6j_193SNbyr87YUtzcQ0Bu3PaYRAoR1AqZudSZ2hSyF4pXoZcgdIGRsAghQddwVta643Rmrd1JZL9to-d3R0iq3PN_xPNcwq5WxDhkI1wF8gjIG4Q3MnE4S5iDcoJW7ID-wgbyUewXx7-xUlDX_s3sVL-zlr7kopBJQUgLd5lwqQGJAEgjYupNYrwHthSEEJFx5c3hZ1hmHEkeD4vgkZWytBZRRALGbbaz2CwfJYKQPeX0ZL0unDfYUtCrbYUBiN7SghEWxWz2-S0Y6sNfxm3iynQ6n1dYO1Uho7YVq7UWcEuZUOtmREBlZ4zghcWO1k1sul56WADVaKlt0M_BSbHhL_eIQj-zsWensW18m5myvFtbrOIUyu5l6LSu5PrttbNFg6yU3Kyu04r_LtCej57m3fgiE6rhLyzr7tsOjgEg1LHkqSo9pPQktd0tX8E0_LmUbLXLT52I42nRwUnXcKfG4k8rYXecw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