Skip to content

[arm] Cannot select i32 = setcc 0x00000000, Constant:i64 #140445

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

Open
Urgau opened this issue May 18, 2025 · 1 comment
Open

[arm] Cannot select i32 = setcc 0x00000000, Constant:i64 #140445

Urgau opened this issue May 18, 2025 · 1 comment

Comments

@Urgau
Copy link

Urgau commented May 18, 2025

I'm seeing an error when trying to use llvm.minimum.f64 and llvm.maximum.f64 on arm (32bits).

define double @call_maximum_fp128(double %x, double %y) unnamed_addr #1 {
start:
  %0 = tail call double @llvm.maximum.f64(double %x, double %y)
  ret double %0
}

declare double @llvm.maximum.f64(double, double)

attributes #1 = { inlinehint uwtable "target-cpu"="generic" "target-features"="+strict-align,+v6,+vfp2,-d32" }
LLVM ERROR: Cannot select: 0xa8483e8: i32 = setcc 0xa8480a0, Constant:i64<-9223372036854775808>, seteq:ch
  0xa8480a0: i64 = build_pair 0xa845d50, 0xa845d50:1
    0xa845d50: i32,i32 = ARMISD::VMOVRRD 0xa844fb8
      0xa844fb8: f64,ch = CopyFromReg 0xa7be670, Register:f64 %1
        0xa844f40: f64 = Register %1
    0xa845d50: i32,i32 = ARMISD::VMOVRRD 0xa844fb8
      0xa844fb8: f64,ch = CopyFromReg 0xa7be670, Register:f64 %1
        0xa844f40: f64 = Register %1
  0xa845dc8: i64 = Constant<-9223372036854775808>
In function: _ZN4core3f6421_$LT$impl$u20$f64$GT$7minimum17h4fb5294b0f68c019E
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 -x86-asm-syntax=intel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'ARM Instruction Selection' on function '@"_ZN4core3f6421_$LT$impl$u20$f64$GT$7minimum17h4fb5294b0f68c019E"'
 #0 0x0000000003b5e828 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3b5e828)
 #1 0x0000000003b5c3e4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x00007dd7d7a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007dd7d7a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007dd7d7a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007dd7d7a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x0000000000786212 llvm::UniqueStringSaver::save(llvm::Twine const&) (.cold) StringSaver.cpp:0:0
 #7 0x0000000003904d28 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3904d28)
 #8 0x000000000390b099 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x390b099)
 #9 0x00000000013f7229 (anonymous namespace)::ARMDAGToDAGISel::Select(llvm::SDNode*) ARMISelDAGToDAG.cpp:0:0
#10 0x0000000003902214 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-trunk/bin/llc+0x3902214)
#11 0x0000000003910d22 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/llc+0x3910d22)
#12 0x000000000391369a llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x391369a)
#13 0x0000000003915576 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3915576)
#14 0x0000000001400574 (anonymous namespace)::ARMDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) ARMISelDAGToDAG.cpp:0:0
#15 0x0000000003901d91 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3901d91)
#16 0x0000000002bc6988 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x00000000031469e2 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x31469e2)
#18 0x0000000003146c71 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3146c71)
#19 0x00000000031485d9 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x31485d9)
#20 0x00000000008c0c2f compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#21 0x000000000079b3be main (/opt/compiler-explorer/clang-trunk/bin/llc+0x79b3be)
#22 0x00007dd7d7a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#23 0x00007dd7d7a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#24 0x00000000008b86f5 _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x8b86f5)
Program terminated with signal: SIGSEGV
Compiler returned: 139

https://llvm.godbolt.org/z/jjTh6nYd5

@llvmbot
Copy link
Member

llvmbot commented May 18, 2025

@llvm/issue-subscribers-backend-arm

Author: None (Urgau)

I'm seeing an error when trying to use `llvm.minimum.f64` and `llvm.maximum.f64` on arm (32bits).
define double @<!-- -->call_maximum_fp128(double %x, double %y) unnamed_addr #<!-- -->1 {
start:
  %0 = tail call double @<!-- -->llvm.maximum.f64(double %x, double %y)
  ret double %0
}

declare double @<!-- -->llvm.maximum.f64(double, double)

attributes #<!-- -->1 = { inlinehint uwtable "target-cpu"="generic" "target-features"="+strict-align,+v6,+vfp2,-d32" }
LLVM ERROR: Cannot select: 0xa8483e8: i32 = setcc 0xa8480a0, Constant:i64&lt;-9223372036854775808&gt;, seteq:ch
  0xa8480a0: i64 = build_pair 0xa845d50, 0xa845d50:1
    0xa845d50: i32,i32 = ARMISD::VMOVRRD 0xa844fb8
      0xa844fb8: f64,ch = CopyFromReg 0xa7be670, Register:f64 %1
        0xa844f40: f64 = Register %1
    0xa845d50: i32,i32 = ARMISD::VMOVRRD 0xa844fb8
      0xa844fb8: f64,ch = CopyFromReg 0xa7be670, Register:f64 %1
        0xa844f40: f64 = Register %1
  0xa845dc8: i64 = Constant&lt;-9223372036854775808&gt;
In function: _ZN4core3f6421_$LT$impl$u20$f64$GT$7minimum17h4fb5294b0f68c019E
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 -x86-asm-syntax=intel &lt;source&gt;
1.	Running pass 'Function Pass Manager' on module '&lt;source&gt;'.
2.	Running pass 'ARM Instruction Selection' on function '@"_ZN4core3f6421_$LT$impl$u20$f64$GT$7minimum17h4fb5294b0f68c019E"'
 #<!-- -->0 0x0000000003b5e828 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3b5e828)
 #<!-- -->1 0x0000000003b5c3e4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #<!-- -->2 0x00007dd7d7a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #<!-- -->3 0x00007dd7d7a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #<!-- -->4 0x00007dd7d7a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #<!-- -->5 0x00007dd7d7a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #<!-- -->6 0x0000000000786212 llvm::UniqueStringSaver::save(llvm::Twine const&amp;) (.cold) StringSaver.cpp:0:0
 #<!-- -->7 0x0000000003904d28 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3904d28)
 #<!-- -->8 0x000000000390b099 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x390b099)
 #<!-- -->9 0x00000000013f7229 (anonymous namespace)::ARMDAGToDAGISel::Select(llvm::SDNode*) ARMISelDAGToDAG.cpp:0:0
#<!-- -->10 0x0000000003902214 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-trunk/bin/llc+0x3902214)
#<!-- -->11 0x0000000003910d22 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/llc+0x3910d22)
#<!-- -->12 0x000000000391369a llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&amp;) (/opt/compiler-explorer/clang-trunk/bin/llc+0x391369a)
#<!-- -->13 0x0000000003915576 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&amp;) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3915576)
#<!-- -->14 0x0000000001400574 (anonymous namespace)::ARMDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&amp;) ARMISelDAGToDAG.cpp:0:0
#<!-- -->15 0x0000000003901d91 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&amp;) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3901d91)
#<!-- -->16 0x0000000002bc6988 llvm::MachineFunctionPass::runOnFunction(llvm::Function&amp;) (.part.0) MachineFunctionPass.cpp:0:0
#<!-- -->17 0x00000000031469e2 llvm::FPPassManager::runOnFunction(llvm::Function&amp;) (/opt/compiler-explorer/clang-trunk/bin/llc+0x31469e2)
#<!-- -->18 0x0000000003146c71 llvm::FPPassManager::runOnModule(llvm::Module&amp;) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3146c71)
#<!-- -->19 0x00000000031485d9 llvm::legacy::PassManagerImpl::run(llvm::Module&amp;) (/opt/compiler-explorer/clang-trunk/bin/llc+0x31485d9)
#<!-- -->20 0x00000000008c0c2f compileModule(char**, llvm::LLVMContext&amp;) llc.cpp:0:0
#<!-- -->21 0x000000000079b3be main (/opt/compiler-explorer/clang-trunk/bin/llc+0x79b3be)
#<!-- -->22 0x00007dd7d7a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#<!-- -->23 0x00007dd7d7a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#<!-- -->24 0x00000000008b86f5 _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x8b86f5)
Program terminated with signal: SIGSEGV
Compiler returned: 139

https://llvm.godbolt.org/z/jjTh6nYd5

@EugeneZelenko EugeneZelenko added the llvm:SelectionDAG SelectionDAGISel as well label May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants