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

Can't pass or return half or fp128 on arm64ec #94434

Open
beetrees opened this issue Jun 5, 2024 · 1 comment
Open

Can't pass or return half or fp128 on arm64ec #94434

beetrees opened this issue Jun 5, 2024 · 1 comment
Labels
backend:AArch64 crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@beetrees
Copy link
Contributor

beetrees commented Jun 5, 2024

Trying to compile the following IR for arm64ec-pc-windows-msvc (compiler explorer)

define half @half(half) {
    ret half %0
}

define fp128 @fp128(fp128) {
    ret fp128 %0
}

will fail with the following error:

LLVM ERROR: Only 32 and 64 bit floating points are supported for ARM64EC thunks
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o /app/output.s -mtriple=arm64ec-pc-windows-msvc <source>
1.	Running pass 'AArch64Arm64ECCallLowering' on module '<source>'.
 #0 0x00000000036ffd18 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x36ffd18)
 #1 0x00000000036fd68c SignalHandler(int) Signals.cpp:0:0
 #2 0x0000760bd1842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x0000760bd18969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x0000760bd1842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x0000760bd18287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000000000072f886 llvm::UniqueStringSaver::save(llvm::StringRef) (.cold) StringSaver.cpp:0:0
 #7 0x000000000364f7d8 (/opt/compiler-explorer/clang-trunk/bin/llc+0x364f7d8)
 #8 0x0000000000a7732c (anonymous namespace)::AArch64Arm64ECCallLowering::canonicalizeThunkType(llvm::Type*, llvm::Align, bool, unsigned long, llvm::raw_ostream&, llvm::Type*&, llvm::Type*&) (.constprop.0) AArch64Arm64ECCallLowering.cpp:0:0
 #9 0x0000000000a7887f (anonymous namespace)::AArch64Arm64ECCallLowering::getThunkType(llvm::FunctionType*, llvm::AttributeList, llvm::COFF::Arm64ECThunkType, llvm::raw_ostream&, llvm::FunctionType*&, llvm::FunctionType*&) AArch64Arm64ECCallLowering.cpp:0:0
#10 0x0000000000a7fd73 (anonymous namespace)::AArch64Arm64ECCallLowering::buildEntryThunk(llvm::Function*) AArch64Arm64ECCallLowering.cpp:0:0
#11 0x0000000000a83dea (anonymous namespace)::AArch64Arm64ECCallLowering::runOnModule(llvm::Module&) (.part.0) AArch64Arm64ECCallLowering.cpp:0:0
#12 0x0000000002d44ac0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2d44ac0)
#13 0x00000000008483f4 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#14 0x0000000000741b86 main (/opt/compiler-explorer/clang-trunk/bin/llc+0x741b86)
#15 0x0000760bd1829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#16 0x0000760bd1829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#17 0x000000000084002e _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x84002e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
@EugeneZelenko EugeneZelenko added backend:AArch64 crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Jun 5, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 5, 2024

@llvm/issue-subscribers-backend-aarch64

Author: None (beetrees)

Trying to compile the following IR for `arm64ec-pc-windows-msvc` ([compiler explorer](https://godbolt.org/z/sqrn8Mnxo))
define half @<!-- -->half(half) {
    ret half %0
}

define fp128 @<!-- -->fp128(fp128) {
    ret fp128 %0
}

will fail with the following error:

LLVM ERROR: Only 32 and 64 bit floating points are supported for ARM64EC thunks
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o /app/output.s -mtriple=arm64ec-pc-windows-msvc &lt;source&gt;
1.	Running pass 'AArch64Arm64ECCallLowering' on module '&lt;source&gt;'.
 #<!-- -->0 0x00000000036ffd18 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x36ffd18)
 #<!-- -->1 0x00000000036fd68c SignalHandler(int) Signals.cpp:0:0
 #<!-- -->2 0x0000760bd1842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #<!-- -->3 0x0000760bd18969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #<!-- -->4 0x0000760bd1842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #<!-- -->5 0x0000760bd18287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #<!-- -->6 0x000000000072f886 llvm::UniqueStringSaver::save(llvm::StringRef) (.cold) StringSaver.cpp:0:0
 #<!-- -->7 0x000000000364f7d8 (/opt/compiler-explorer/clang-trunk/bin/llc+0x364f7d8)
 #<!-- -->8 0x0000000000a7732c (anonymous namespace)::AArch64Arm64ECCallLowering::canonicalizeThunkType(llvm::Type*, llvm::Align, bool, unsigned long, llvm::raw_ostream&amp;, llvm::Type*&amp;, llvm::Type*&amp;) (.constprop.0) AArch64Arm64ECCallLowering.cpp:0:0
 #<!-- -->9 0x0000000000a7887f (anonymous namespace)::AArch64Arm64ECCallLowering::getThunkType(llvm::FunctionType*, llvm::AttributeList, llvm::COFF::Arm64ECThunkType, llvm::raw_ostream&amp;, llvm::FunctionType*&amp;, llvm::FunctionType*&amp;) AArch64Arm64ECCallLowering.cpp:0:0
#<!-- -->10 0x0000000000a7fd73 (anonymous namespace)::AArch64Arm64ECCallLowering::buildEntryThunk(llvm::Function*) AArch64Arm64ECCallLowering.cpp:0:0
#<!-- -->11 0x0000000000a83dea (anonymous namespace)::AArch64Arm64ECCallLowering::runOnModule(llvm::Module&amp;) (.part.0) AArch64Arm64ECCallLowering.cpp:0:0
#<!-- -->12 0x0000000002d44ac0 llvm::legacy::PassManagerImpl::run(llvm::Module&amp;) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2d44ac0)
#<!-- -->13 0x00000000008483f4 compileModule(char**, llvm::LLVMContext&amp;) llc.cpp:0:0
#<!-- -->14 0x0000000000741b86 main (/opt/compiler-explorer/clang-trunk/bin/llc+0x741b86)
#<!-- -->15 0x0000760bd1829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#<!-- -->16 0x0000760bd1829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#<!-- -->17 0x000000000084002e _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x84002e)
Program terminated with signal: SIGSEGV
Compiler returned: 139

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

3 participants