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

fp128 arguments cause a compiler error on powerpc64-ibm-aix #101545

Open
beetrees opened this issue Aug 1, 2024 · 4 comments
Open

fp128 arguments cause a compiler error on powerpc64-ibm-aix #101545

beetrees opened this issue Aug 1, 2024 · 4 comments
Labels
backend:PowerPC crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@beetrees
Copy link
Contributor

beetrees commented Aug 1, 2024

For instance, compiling the following IR with llc -mcpu=pwr7 -mtriple=powerpc64-ibm-aix (compiler explorer):

define void @f(fp128) {
    ret void
}

results in the following error message:

LLVM ERROR: f128 is unimplemented on AIX.
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-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mcpu=pwr7 -mtriple=powerpc64-ibm-aix <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@f'
 #0 0x0000000003a91e78 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a91e78)
 #1 0x0000000003a8f5ec SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f5cd5642520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f5cd56969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007f5cd5642476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007f5cd56287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000000000072c143 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x72c143)
 #7 0x00000000039e1298 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39e1298)
 #8 0x00000000019d7726 CC_AIX(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&) PPCISelLowering.cpp:0:0
 #9 0x000000000284cc2f llvm::CCState::AnalyzeFormalArguments(llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, bool (*)(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x284cc2f)
#10 0x00000000019d7c1e llvm::PPCTargetLowering::LowerFormalArguments_AIX(llvm::SDValue, unsigned int, bool, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::SDLoc const&, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x19d7c1e)
#11 0x00000000037823a4 llvm::SelectionDAGISel::LowerArguments(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37823a4)
#12 0x000000000384b11d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x384b11d)
#13 0x000000000384bd91 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x384bd91)
#14 0x0000000001997587 (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) PPCISelDAGToDAG.cpp:0:0
#15 0x000000000383caaf llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x383caaf)
#16 0x0000000002a40509 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x00000000030281d3 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30281d3)
#18 0x0000000003028411 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3028411)
#19 0x0000000003028c55 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3028c55)
#20 0x00000000008431cc compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#21 0x0000000000733a5e main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x733a5e)
#22 0x00007f5cd5629d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#23 0x00007f5cd5629e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#24 0x0000000000839d0e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x839d0e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
@EugeneZelenko EugeneZelenko added backend:PowerPC crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Aug 1, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 1, 2024

@llvm/issue-subscribers-backend-powerpc

Author: None (beetrees)

For instance, compiling the following IR with `llc -mcpu=pwr7 -mtriple=powerpc64-ibm-aix` ([compiler explorer](https://godbolt.org/z/ndqPc48Pz)): ```llvm define void @f(fp128) { ret void } ``` results in the following error message: ``` LLVM ERROR: f128 is unimplemented on AIX. 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-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mcpu=pwr7 -mtriple=powerpc64-ibm-aix <source> 1. Running pass 'Function Pass Manager' on module '<source>'. 2. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@f' #0 0x0000000003a91e78 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a91e78) #1 0x0000000003a8f5ec SignalHandler(int) Signals.cpp:0:0 #2 0x00007f5cd5642520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #3 0x00007f5cd56969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc) #4 0x00007f5cd5642476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476) #5 0x00007f5cd56287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3) #6 0x000000000072c143 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x72c143) #7 0x00000000039e1298 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39e1298) #8 0x00000000019d7726 CC_AIX(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&) PPCISelLowering.cpp:0:0 #9 0x000000000284cc2f llvm::CCState::AnalyzeFormalArguments(llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, bool (*)(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x284cc2f) #10 0x00000000019d7c1e llvm::PPCTargetLowering::LowerFormalArguments_AIX(llvm::SDValue, unsigned int, bool, llvm::SmallVectorImpl<llvm::ISD::InputArg> const&, llvm::SDLoc const&, llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x19d7c1e) #11 0x00000000037823a4 llvm::SelectionDAGISel::LowerArguments(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x37823a4) #12 0x000000000384b11d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x384b11d) #13 0x000000000384bd91 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x384bd91) #14 0x0000000001997587 (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) PPCISelDAGToDAG.cpp:0:0 #15 0x000000000383caaf llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x383caaf) #16 0x0000000002a40509 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0 #17 0x00000000030281d3 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30281d3) #18 0x0000000003028411 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3028411) #19 0x0000000003028c55 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3028c55) #20 0x00000000008431cc compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0 #21 0x0000000000733a5e main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x733a5e) #22 0x00007f5cd5629d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90) #23 0x00007f5cd5629e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40) #24 0x0000000000839d0e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x839d0e) Program terminated with signal: SIGSEGV Compiler returned: 139 ```

@chenzheng1030
Copy link
Collaborator

yep, this is a known issue. fp128 or ppc_fp128 is not supported on AIX. And compiler already shows the correct message:

LLVM ERROR: f128 is unimplemented on AIX.

@beetrees Could you please tell more info about why are you trying fp128 on AIX? Thanks.

@beetrees
Copy link
Contributor Author

beetrees commented Aug 2, 2024

Rust is in the process of adding support for f128 (see rust-lang/rust#116909). Being able to have f128 arguments is needed to compile rust-lang/compiler-builtins now that f128 builtins have been added, and will eventually be needed to compile the standard library (as well as any code that uses f128 operations or arguments). Rust has a target for powerpc64-ibm-aix.

@chenzheng1030
Copy link
Collaborator

OK. Thanks for sharing the info. Let's leave this issue open for future f128 support in LLVM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:PowerPC crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

4 participants