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

    <tr>
        <th>Summary</th>
        <td>
            [aarch64] Unknown FP condition!
        </td>
    </tr>

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

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

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

<pre>
    # Description
The following code crashes aarch64 backend with "Unknown FP condition!" 

# Minimal Reproduction
https://godbolt.org/z/7EeccGP3r

## Code
```c++
; ModuleID = 'crash-4f3ab3a32f91d152361bae65ffeca42d2fa3e7b9'
source_filename = "M"

define float @f(i1 %0, i16 %1) {
BB:
  %RP = alloca float, align 4
  br label %BB2

BB2: ; preds = %BB2, %BB
  %C2 = fcmp true float 4.200000e+01, 4.200000e+01
  %B2 = and i1 %C2, %0
  %2 = load float, ptr %RP, align 4
  br i1 %B2, label %BB2, label %BB1
BB1: ; preds = %BB2
  ret float %2
}
```

## Stack Trace
```
Unknown FP condition!
UNREACHABLE executed at /root/llvm-project/llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp:105!
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 -mtriple=aarch64 -O=0 <source>
1.      Running pass 'Function Pass Manager' on module '<source>'.
2.      Running pass 'InstructionSelect' on function '@f'
 #0 0x0000000003928f08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3928f08)
 #1 0x000000000392665c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f2211a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f2211a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007f2211a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007f2211a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x000000000387521a (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387521a)
 #7 0x0000000000cc2500 llvm::AArch64GISelUtils::changeVectorFCMPPredToAArch64CC(llvm::CmpInst::Predicate, llvm::AArch64CC::CondCode&, llvm::AArch64CC::CondCode&, bool&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xcc2500)
 #8 0x0000000000a8af3c (anonymous namespace)::AArch64InstructionSelector::selectCompareBranch(llvm::MachineInstr&, llvm::MachineFunction&, llvm::MachineRegisterInfo&) (.isra.0) AArch64InstructionSelector.cpp:0:0
 #9 0x0000000000a9085d (anonymous namespace)::AArch64InstructionSelector::select(llvm::MachineInstr&) AArch64InstructionSelector.cpp:0:0
#10 0x00000000040d02a9 llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x40d02a9)
#11 0x0000000002942d31 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#12 0x0000000002f01813 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f01813)
#13 0x0000000002f01a51 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f01a51)
#14 0x0000000002f022b5 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f022b5)
#15 0x000000000082323c compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#16 0x00000000007223e6 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7223e6)
#17 0x00007f2211a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#18 0x00007f2211a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#19 0x0000000000819d5e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x819d5e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8WMtu4zoS_Rp6Q9iQSu-FF37EuQE6c42kb28DiqJkTShSIKmJM18_ICnHlpNcdGaCMdQdiY9Tp4rFI5aI1m0jGFuiZI2S7YwM5iDVcts2f6qtbGalrF6XCCK8ZZqqtjetFCjYomD188BwLTmXL61oMJUVw1QRfWAaE6LoIY1xSegzExV-ac0BI4C_xLOQLwLv9phKUbUODEIEgD3m-D9E-L4VbUc4fmC9ktVAz3YPxvQaRSsEOwS7Rlal5GYhVYNg928Eu-yGUXq7j9QVpEXdyIqNDWngL4pgbS_fGq3xvawGzu62GEVbjCBzTs3jOiJlRCKoi7AKE4jSsCQsTeqaURJDBTWJWFYWCDIPpeWgKHuqW84E6diIBvcI4JJYxepWMFxzSQxGcVAjyNsQI0gCBBvchqm9DxEUGGUjy_Xauu9use192Dt0wrmkxEPZuYS3jcDxaWCpMCcl43bGej0hYR-jFbbe94pVeiTrhsHG313Y24AbUNOux0YNJ_bxAgL7YwjWQWgnXrWcEdYegYgKe2c3J0PBxSg_iEtSnZ3qjfIuf-yhR_O0J95On8OT3-Gnfo-YipnT4kByClq2vUqiD1Lt0RD6jH8qQq8zzj9-thd85z8eblabP1brHzeYHRkdDKuw47BTUhoEO87_1c17Jf_J6OnR_mlLBLufRDXMtq5Wbh8i2N3ePTJ-brnlsiTctv1lWq4XtO9RtAqD5I3B_sfN6vEG66HsWoMJLocGK9ZLZbCR-GoPtuYwlAsquwsmU36t1gPTCHZ-zQXlQ8WwOYya4ZTC2FgtvHkfvWro-rdUDxYoKPZKNop0mKhm6Jgw2q0f7GRvrVDZ9S1nas6OPZeKKdvGiWjmRGumbIj13KhBPCPYla1wPCmeSwtB-t4CDaYfzELj-TFP50R3c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