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

    <tr>
        <th>Summary</th>
        <td>
            Cannot select: 0x55848e4be0e0: v4f32 = fmaxnum 0x55848fa99830, 0x55848fc54190
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            backend:ARM,
            new issue
      </td>
    </tr>

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

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

<pre>
    Preprocessed file attached.

```
[ggml.i.txt](https://github.com/llvm/llvm-project/files/12564064/ggml.i.txt)

$ llvm-project/build/bin/clang --target=armv7-none-linux-androideabi24 -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=ar
mv7-a -mthumb  -O2 -g -fPIC  -mfpu=neon-fp-armv8 -mno-unaligned-access -funsafe-math-optimizations -pthread -std=gnu1
1  -o ggml.c.o -c ggml.i

fatal error: error in backend: Cannot select: 0x55848e4be0e0: v4f32 = fmaxnum 0x55848fa99830, 0x55848fc54190, ggml.c:3751:117 @[ ggml.c:10520:9 @[ ggml.c:10533:17 @[ ggml.c:15101:17 ] ] ]
  0x55848fa99830: v4f32,i32,ch = ARMISD::VLD1_UPD<(load (s128) from %ir.471, align 4, !tbaa !2217)> 0x55848cf24680, 0x55848c7af020, Constant:i32<16>, Constant:i32<1>, ggml.c:3751:118 @[ ggml.c:10520:9 @[ ggml.c:10533:17 @[ ggml.c:15101:17 ] ] ]
    0x55848c7af020: i32,ch = CopyFromReg 0x55848cf24680, Register:i32 %147, ggml.c:3751:118 @[ ggml.c:10520:9 @[ ggml.c:10533:17 @[ ggml.c:15101:17 ] ] ]
      0x55848e9bba00: i32 = Register %147
    0x55848e4be1c0: i32 = Constant<16>
    0x55848fa926f0: i32 = Constant<1>
  0x55848fc54190: v4f32 = bitcast 0x55848f35da80, ggml.c:3751:123 @[ ggml.c:10520:9 @[ ggml.c:10533:17 @[ ggml.c:15101:17 ] ] ]
    0x55848f35da80: v4i32 = ARMISD::VMOVIMM TargetConstant:i32<0>, ggml.c:3751:123 @[ ggml.c:10520:9 @[ ggml.c:10533:17 @[ ggml.c:15101:17 ] ] ]
      0x55848fc61f00: i32 = TargetConstant<0>
In function: ggml_compute_forward_unary
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: ../../llvm-project/build/bin/clang --target=armv7-none-linux-androideabi24 -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -O2 -g -fPIC -mfpu=neon-fp-armv8 -mno-unaligned-access -funsafe-math-optimizations -pthread -std=gnu11 -o ggml.c.o -c ggml.i
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'ggml.c'.
4.      Running pass 'ARM Instruction Selection' on function '@ggml_compute_forward_unary'
 #0 0x000055848639d037 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (../../llvm-project/build/bin/clang+0x1eec037)
 #1 0x000055848639adbe llvm::sys::RunSignalHandlers() (../../llvm-project/build/bin/clang+0x1ee9dbe)
 #2 0x000055848631c21f (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) CrashRecoveryContext.cpp:0:0
 #3 0x000055848631c1db (../../llvm-project/build/bin/clang+0x1e6b1db)
 #4 0x0000558486397977 llvm::sys::Process::Exit(int, bool) (../../llvm-project/build/bin/clang+0x1ee6977)
 #5 0x0000558485108312 (../../llvm-project/build/bin/clang+0xc57312)
 #6 0x000055848632092b llvm::report_fatal_error(llvm::Twine const&, bool) (../../llvm-project/build/bin/clang+0x1e6f92b)
 #7 0x00005584870cb050 llvm::SelectionDAGISel::isOrEquivalentToAdd(llvm::SDNode const*) const (../../llvm-project/build/bin/clang+0x2c1a050)
 #8 0x00005584870ca53d (../../llvm-project/build/bin/clang+0x2c1953d)
 #9 0x00005584854cb29e (anonymous namespace)::ARMDAGToDAGISel::Select(llvm::SDNode*) ARMISelDAGToDAG.cpp:0:0
#10 0x00005584870c1eef llvm::SelectionDAGISel::DoInstructionSelection() (../../llvm-project/build/bin/clang+0x2c10eef)
#11 0x00005584870c1590 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (../../llvm-project/build/bin/clang+0x2c10590)
#12 0x00005584870c0846 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (../../llvm-project/build/bin/clang+0x2c0f846)
#13 0x00005584870be632 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (../../llvm-project/build/bin/clang+0x2c0d632)
#14 0x00005584854c8721 (anonymous namespace)::ARMDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) ARMISelDAGToDAG.cpp:0:0
#15 0x0000558485b32369 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (../../llvm-project/build/bin/clang+0x1681369)
#16 0x0000558485f9be62 llvm::FPPassManager::runOnFunction(llvm::Function&) (../../llvm-project/build/bin/clang+0x1aeae62)
#17 0x0000558485fa30f3 llvm::FPPassManager::runOnModule(llvm::Module&) (../../llvm-project/build/bin/clang+0x1af20f3)
#18 0x0000558485f9ca00 llvm::legacy::PassManagerImpl::run(llvm::Module&) (../../llvm-project/build/bin/clang+0x1aeba00)
#19 0x0000558486539ed3 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (../../llvm-project/build/bin/clang+0x2088ed3)
#20 0x00005584871c6bae clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (../../llvm-project/build/bin/clang+0x2d15bae)
#21 0x00005584880bae54 clang::ParseAST(clang::Sema&, bool, bool) (../../llvm-project/build/bin/clang+0x3c09e54)
#22 0x0000558486c0c109 clang::FrontendAction::Execute() (../../llvm-project/build/bin/clang+0x275b109)
#23 0x0000558486b812d6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (../../llvm-project/build/bin/clang+0x26d02d6)
#24 0x0000558486cc906b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (../../llvm-project/build/bin/clang+0x281806b)
#25 0x0000558485108031 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (../../llvm-project/build/bin/clang+0xc57031)
#26 0x0000558485105b65 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#27 0x00005584869ef7d9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_1>(long) Job.cpp:0:0
#28 0x000055848631c1c5 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (../../llvm-project/build/bin/clang+0x1e6b1c5)
#29 0x00005584869ef265 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (../../llvm-project/build/bin/clang+0x253e265)
#30 0x00005584869b3cb3 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (../../llvm-project/build/bin/clang+0x2502cb3)
#31 0x00005584869b3eee clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (../../llvm-project/build/bin/clang+0x2502eee)
#32 0x00005584869d17e0 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (../../llvm-project/build/bin/clang+0x25207e0)
#33 0x0000558485105397 clang_main(int, char**, llvm::ToolContext const&) (../../llvm-project/build/bin/clang+0xc54397)
#34 0x0000558485112d21 main (../../llvm-project/build/bin/clang+0xc61d21)
#35 0x00007f4c2a4456ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#36 0x00007f4c2a445785 call_init ./csu/../csu/libc-start.c:128:20
#37 0x00007f4c2a445785 __libc_start_main ./csu/../csu/libc-start.c:347:5
#38 0x0000558485102111 _start (../../llvm-project/build/bin/clang+0xc51111)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 18.0.0 (https://github.com/llvm/llvm-project.git c7430a7c6401b86ec5aedb90b9387285dfa04049)
Target: armv7-none-linux-android24
Thread model: posix
InstalledDir: ../../llvm-project/build/bin
clang: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWltT47i2_jXmReWULr4-8OBOoIep5kABM1XnKSVLcqLTtpSRZRrOr98l2yGWCU13mOldtXcVJI6u31pad5m2rdwoIc6D-FMQr85oZ7fanG-loVzaZ3pWav58fmvEzmgm2lZwUMlaAGotZVvBFwFcBbAYPxM4_g0_40-bTVMv5MI-2SBeBTjbWrtrA1IE-DLAlxtpt125YLoJ8GVdP-6_wp3R_yeYDfCl26wN8CXCcRLBJHKzDmvi3NseR2A2vexkzd23VAG-ZDVVGxCGlpqNsAFZUdM8pqHSSoS1VN1TSBU3WnJBS4kjEFacWhq2glmpVQvCqupU_zxt69Q3qXhoaVkL97u1lH11GKxgVpuwtUa7bZUOGVVaSUbrcGdEJZ_c-NX68ubu4eryf9f3N3_cLS8CssIgbKhh2x7hQJvDSUHY2G3XlACENxiEGxBWt1dLAMKm2nUBWSmhVVjtQkdWBsJG6bBTtHYHzEPK3Pn1eFtaibChdhvqnZWN_H860rKzWyMoB2FreUBWG9WhYXsEQKhBz3m20CBkw7Ocsr-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