Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AArch64/GlobalISel] Unable to Translate ret with v1i8 / v1i16 #58211

Closed
HazyFish opened this issue Oct 6, 2022 · 2 comments
Closed

[AArch64/GlobalISel] Unable to Translate ret with v1i8 / v1i16 #58211

HazyFish opened this issue Oct 6, 2022 · 2 comments
Labels
backend:AArch64 crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@HazyFish
Copy link
Contributor

HazyFish commented Oct 6, 2022

Description

For AArch64, a return instruction of type <1 x i8> or <1 x i16> cannot be translated when using GlobalISel.
<1 x i1>, <1 x i32>, <1 x i64> do not have the problem.

Cause

The crash is caused here:

LLVM_DEBUG(dbgs() << "Could not handle ret ty\n");

Minimal Reproduction

https://godbolt.org/z/6eGesshj5

Code

define <1 x i16> @f() {
BB:
  ret <1 x i16> <i16 0>
}

Stack Trace

LLVM ERROR: unable to translate instruction: ret (in function: f)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: ./llvm-project/build-debug/bin/llc ./crash-reports/gisel-aarch64/4.ll -mtriple=aarch64 -global-isel
1.	Running pass 'Function Pass Manager' on module './crash-reports/gisel-aarch64/4.ll'.
2.	Running pass 'IRTranslator' on function '@f'
 #0 0x0000000003adad2a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/Support/Unix/Signals.inc:569:11
 #1 0x0000000003adaedb PrintStackTraceSignalHandler(void*) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/Support/Unix/Signals.inc:636:1
 #2 0x0000000003ad9526 llvm::sys::RunSignalHandlers() /home/henry/aflplusplus-isel/llvm-project/llvm/lib/Support/Signals.cpp:103:5
 #3 0x0000000003adb605 SignalHandler(int) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
 #4 0x00007fc761f8d980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #5 0x00007fc760e7de87 raise /build/glibc-uZu3wS/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007fc760e7f7f1 abort /build/glibc-uZu3wS/glibc-2.27/stdlib/abort.c:81:0
 #7 0x0000000003a014b4 llvm::report_fatal_error(llvm::Twine const&, bool) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/Support/ErrorHandling.cpp:125:5
 #8 0x0000000003f7ca82 reportTranslationError(llvm::MachineFunction&, llvm::TargetPassConfig const&, llvm::OptimizationRemarkEmitter&, llvm::OptimizationRemarkMissed&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:125:5
 #9 0x0000000003f90bc8 llvm::IRTranslator::runOnMachineFunction(llvm::MachineFunction&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:3535:9
#10 0x0000000002894c85 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:8
#11 0x0000000002f797d6 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:23
#12 0x0000000002f7e602 llvm::FPPassManager::runOnModule(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
#13 0x0000000002f7a0a9 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:23
#14 0x0000000002f79c1d llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:16
#15 0x0000000002f7e8e1 llvm::legacy::PassManager::run(llvm::Module&) /home/henry/aflplusplus-isel/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1672:3
#16 0x0000000000d2cdbc compileModule(char**, llvm::LLVMContext&) /home/henry/aflplusplus-isel/llvm-project/llvm/tools/llc/llc.cpp:737:41
#17 0x0000000000d2b162 main /home/henry/aflplusplus-isel/llvm-project/llvm/tools/llc/llc.cpp:418:13
#18 0x00007fc760e60c87 __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:344:0
#19 0x0000000000d2a96a _start (./llvm-project/build-debug/bin/llc+0xd2a96a)
@EugeneZelenko EugeneZelenko added backend:AArch64 crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Oct 7, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 7, 2022

@llvm/issue-subscribers-backend-aarch64

@niwinanto
Copy link
Contributor

Submitted the patch to fix this issue.
https://reviews.llvm.org/D153300

Chenyang-L pushed a commit to intel/llvm that referenced this issue Jul 11, 2023
…f type <1 x i8> or <1 x i16> when using GlobalISel.

Code generation for return instruction of type <1 x i8> or <1 x i16> when using GlobalISel causes internal compiler crash Could not handle ret ty.

Fixes: llvm/llvm-project#58211

Differential Revision: https://reviews.llvm.org/D153300
veselypeta pushed a commit to veselypeta/cherillvm that referenced this issue Sep 2, 2024
…f type <1 x i8> or <1 x i16> when using GlobalISel.

Code generation for return instruction of type <1 x i8> or <1 x i16> when using GlobalISel causes internal compiler crash Could not handle ret ty.

Fixes: llvm/llvm-project#58211

Differential Revision: https://reviews.llvm.org/D153300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

4 participants