<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64179>64179</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] Cannot select: i32 = setcc [...], ConstantFP:bf16<APFloat(0)>, setune:ch
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          oakrc
      </td>
    </tr>
</table>

<pre>
    [Demo on Compiler Explorer](https://godbolt.org/z/Krhcscs1j)

Minimal reproduction:
```
@G1 = global <8 x bfloat> zeroinitializer
@G2 = global <8 x i1> zeroinitializer

define void @test() {
  %A = load <8 x bfloat>, ptr @G1, align 16
  %B = fcmp une <8 x bfloat> zeroinitializer, %A
  store <8 x i1> %B, ptr @G2, align 1
  ret void
}
```

Crash backtrace:
```
LLVM ERROR: Cannot select: 0x8a49940: i32 = setcc 0x8a49320, ConstantFP:bf16<APFloat(0)>, setune:ch
 0x8a49320: bf16,ch = load<(dereferenceable load (s16) from @G1 + 12, align 4, basealign 16)> 0x89af640, 0x8a48f30, undef:i64
    0x8a48f30: i64 = add 0x8a46020, Constant:i64<12>
      0x8a46020: i64 = AArch64ISD::LOADgot TargetGlobalAddress:i64<ptr @G1> 0 [TF=16]
        0x8a45680: i64 = TargetGlobalAddress<ptr @G1> 0 [TF=16]
      0x8a49b00: i64 = Constant<12>
    0x8a453e0: i64 = undef
  0x8a454c0: bf16 = ConstantFP<APFloat(0)>
In function: test
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 -march=aarch64 <source>
1.      Running pass 'Function Pass Manager' on module '<source>'.
2.      Running pass 'AArch64 Instruction Selection' on function '@test'
 #0 0x0000000003069058 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x3069058)
 #1 0x0000000003066c1c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f9a64206420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #3 0x00007f9a63cc900b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #4 0x00007f9a63ca8859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x000000000069dd50 llvm::RISCVISAInfo::updateImplication() (.cold) RISCVISAInfo.cpp:0:0
 #6 0x0000000002e51f14 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e51f14)
 #7 0x0000000002e575a5 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e575a5)
 #8 0x0000000000a094dd (anonymous namespace)::AArch64DAGToDAGISel::Select(llvm::SDNode*) AArch64ISelDAGToDAG.cpp:0:0
 #9 0x0000000002e4f577 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e4f577)
#10 0x0000000002e5be35 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e5be35)
#11 0x0000000002e5e889 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2e5e889)
#12 0x0000000002e60f56 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#13 0x0000000002446f70 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x0000000002929352 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x2929352)
#15 0x00000000029294d1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x29294d1)
#16 0x000000000292b040 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-trunk/bin/llc+0x292b040)
#17 0x0000000000767810 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#18 0x00000000006a8a32 main (/opt/compiler-explorer/clang-trunk/bin/llc+0x6a8a32)
#19 0x00007f9a63caa083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#20 0x000000000075f75e _start (/opt/compiler-explorer/clang-trunk/bin/llc+0x75f75e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0WF1z26rW_jX4hrEHgT4vcqHYcd7M255m6k5nzlUGIWSzg0ADaNfprz8Dkh3JdU-y255O7VjAetazPlgLQa0Ve8X5DUhuQbJZ0N4dtLnR9NmwRaXrFz-x4a2GWsG1bjshuYF3x05qww1INgDnB-c6C0gJ8Bbg7V7XlZZupc0e4O13gLf_bw7MMhv9BXAB0Aagcvj-KJRoqYSGd0bXPXNCKw8zLEnR-H94jNF9BAHZwL3UFZUQkHUOj7BqpKYOkDv4nRstlHCCSvGdm1cxfEVMRD8XCd81b4Ti8G8taghi5Lh1AOcAFxBkt8MSCAFOygAuNa1_YATwGnbOwEDdP1Ap9gpG6UT8Nog3rO1gr_jbRuF1UHpCsE4bPrfJg04144nmk5jhLlg2Gpxtrrs8fK8NtQdYUfbsDGX8Z_H58OHrR3j3-fOnz4CUcE2V0g5aLjlzfgAdcxoXRYz8gyBDSCx3jI1TBCNPdK2VdVS57SMgZdVEKSDr8nEb3IFz5BNocKzlrleeDTuMVr3ikBIGUbxmh3N4AFkDnNfc8IYbrhinleRj4HBu_fICNka3cEw1fAujifNi_7Oilp-jGLh4tQVt0jjQDxzyhoSHXtW8AaQUaXxyPJys8I5I48CP1vUwkaK5G0Zpso6wt_uMAifLJzhladghjR92Gx8mUn74VG722s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