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

    <tr>
        <th>Summary</th>
        <td>
            segfault in clang-17 pass 'AArch64 Instruction Selection' while building google/highway on Mac OS X 
        </td>
    </tr>

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

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

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

<pre>
    OS: Mac OS X 15.0 beta (24A5279h)
Clang version: 17.0.6
Target: arm64-apple-darwin24.0.0
Thread model: posix

Project: github.com/google/highway (commit: `457c891775a7397bdb0376bb1031e6e027af1c48`)

Backtrace:
```
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: /opt/port/libexec/llvm-17/bin/clang++ -DHWY_STATIC_DEFINE -DTOOLCHAIN_MISS_ASM_HWCAP_H -DTOOLCHAIN_MISS_SYS_AUXV_H -I/tmp/highway_macho/highway -O2 -g -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -fmerge-all-constants -Wall -Wextra -Wconversion -Wsign-conversion -Wvla -Wnon-virtual-dtor -Wcast-align -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wgnu-redeclared-enum -Winfinite-recursion -Wself-assign -Wstring-conversion -Wtautological-overlap-compare -Wthread-safety-analysis -Wundefined-func-template -fno-cxx-exceptions -fno-slp-vectorize -fno-vectorize -fdiagnostics-show-option -fcolor-diagnostics -Wc++2a-extensions -fmath-errno -fno-exceptions -Wno-psabi -MD -MT CMakeFiles/hwy_contrib.dir/hwy/contrib/sort/vqsort_128a.cc.o -MF CMakeFiles/hwy_contrib.dir/hwy/contrib/sort/vqsort_128a.cc.o.d -o CMakeFiles/hwy_contrib.dir/hwy/contrib/sort/vqsort_128a.cc.o -c /tmp/highway_macho/highway/hwy/contrib/sort/vqsort_128a.cc
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '/tmp/highway_macho/highway/hwy/contrib/sort/vqsort_128a.cc'.
4.      Running pass 'AArch64 Instruction Selection' on function '@_ZN3hwy5N_SVE6detail7RecurseILNS1_11RecurseModeE0ENS0_4SimdIyLm32ELi0EEENS1_12SharedTraitsINS1_9Traits128INS1_17OrderAscending128EEEEEyEEvT0_T1_PT2_mSE_Pymm'
 #0 0x000000010f8564dc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x1424dc)
 #1 0x000000010f854824 llvm::sys::RunSignalHandlers() (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x140824)
 #2 0x000000010f855b84 llvm::sys::CleanupOnSignal(unsigned long) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x141b84)
 #3 0x000000010f7a6954 CrashRecoverySignalHandler(int) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x92954)
 #4 0x0000000182882184 (/usr/lib/system/libsystem_platform.dylib+0x180482184)
 #5 0x000000010fc60060 llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x54c060)
 #6 0x000000010fad67b0 llvm::BuildMI(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::MIMetadata const&, llvm::MCInstrDesc const&, llvm::Register) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x3c27b0)
 #7 0x000000010ffb3570 llvm::InstrEmitter::EmitSpecialNode(llvm::SDNode*, bool, bool, llvm::DenseMap<llvm::SDValue, llvm::Register, llvm::DenseMapInfo<llvm::SDValue, void>, llvm::detail::DenseMapPair<llvm::SDValue, llvm::Register>>&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x89f570)
 #8 0x0000000110042854 llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&)::$_1::operator()(llvm::SDNode*, bool, bool, llvm::DenseMap<llvm::SDValue, llvm::Register, llvm::DenseMapInfo<llvm::SDValue, void>, llvm::detail::DenseMapPair<llvm::SDValue, llvm::Register>>&) const (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x92e854)
 #9 0x0000000110041e00 llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x92de00)
#10 0x00000001100d6a50 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x9c2a50)
#11 0x00000001100d5fb8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x9c1fb8)
#12 0x00000001100d4008 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x9c0008)
#13 0x000000010fc59d9c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x545d9c)
#14 0x000000010f9c20e4 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x2ae0e4)
#15 0x000000010f9c8d9c llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x2b4d9c)
#16 0x000000010f9c2ac0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x2aeac0)
#17 0x0000000105469394 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::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>) (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1145394)
#18 0x000000010577fa7c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x145ba7c)
#19 0x0000000104490dc0 clang::ParseAST(clang::Sema&, bool, bool) (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x16cdc0)
#20 0x000000010615be70 clang::FrontendAction::Execute() (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1e37e70)
#21 0x00000001060ea3f4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1dc63f4)
#22 0x00000001061d1fac clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1eadfac)
#23 0x00000001003f9e40 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/port/libexec/llvm-17/bin/clang+0x100009e40)
#24 0x00000001003f80f0 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) (/opt/port/libexec/llvm-17/bin/clang+0x1000080f0)
#25 0x0000000105dbbdc0 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_1>(long) (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1a97dc0)
#26 0x000000010f7a66b0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/port/libexec/llvm-17/lib/libLLVM.dylib+0x926b0)
#27 0x0000000105dbb63c clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1a9763c)
#28 0x0000000105d89928 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1a65928)
#29 0x0000000105d89c64 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1a65c64)
#30 0x0000000105da2058 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) (/opt/port/libexec/llvm-17/lib/libclang-cpp.dylib+0x1a7e058)
#31 0x00000001003f7310 clang_main(int, char**, llvm::ToolContext const&) (/opt/port/libexec/llvm-17/bin/clang+0x100007310)
#32 0x00000001004022d0 main (/opt/port/libexec/llvm-17/bin/clang+0x1000122d0)
#33 0x00000001824cb274
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 17.0.6
Target: arm64-apple-darwin24.0.0
Thread model: posix
InstalledDir: /opt/port/libexec/llvm-17/bin
```
[bugreport.tar.gz](https://github.com/user-attachments/files/16043838/bugreport.tar.gz)



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWk9z27iS_zT0BUUVCZIiefBB1p-J39qxK_IkeXtRgUBTwgYE-EDQtubTb4GkbEKWJ5NEs--wL5WSSaAJ_PoPuhsNkKbhWwlw6SVXXrK4IK3ZKX35TB45aMElfL0oFNtf3q29aIZuCUV3a_QVhckkQAUYgjyc4XiW4DTfeTj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