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

    <tr>
        <th>Summary</th>
        <td>
            Backend code generator crash while running pass "X86 DAG->DAG Instruction Selection". Maybe related to coroutines.
        </td>
    </tr>

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

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

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

<pre>
    We are seeing this crash in official builds of Edge. This repro has been provided using internal LLVM build that should be compatible with the following Chromium upstream LLVM build:
CLANG_REVISION = 'llvmorg-20-init-1009-g7088a5ed'
CLANG_SUB_REVISION = 9

This actively blocks our consumption of the latest LLVM bits, so it will help if this gets looked at soon. We had the break during Chromium clang roll in May-2024 and it got fixed with the next Clang roll in June-2024. It is broken again with the latest August-2024 Clang roll referenced above. We are wondering if this is related to churn in the coroutines codebase. Attaching the reduced repro source file if this can be included in your test suite so it can prevent future breaks in this area. 

The crash reproduces with the LLC command line. Bugpoint crashed during reduction.
**llc.exe coroutines_main.bc**

Please find both the reduced repro source file and the .bc file (attached as .bc.txt).
[coroutines_main.bc.txt](https://github.com/user-attachments/files/16631162/coroutines_main.bc.txt)
[Reduce repro source file main.cc.txt](https://github.com/user-attachments/files/16631233/main.cc.txt)

$src\out\official_x64>$src\third_party\llvm-build\Release+Asserts\bin\llc.exe coroutines_main.bc
LLVM ERROR: Do not know how to promote this operator!
PLEASE submit a bug report to https://crbug.com in the Tools>LLVM component, run tools/clang/scripts/process_crashreports.py (only if inside Google) to upload crash related files, and include the crash backtrace.
Stack dump:
0.      Program arguments: third_party\\llvm-build\\Release+Asserts\\bin\\llc.exe coroutines_main.bc
1.      Running pass 'Function Pass Manager' on module 'coroutines_main.bc'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@"?Deploy@@YA?AUTacticalNuke@@XZ"'
Exception Code: 0xC000001D
 #0 0x00007ff77d2e95e6 HandleAbort $src\third_party\llvm\llvm\lib\Support\Windows\Signals.inc:429:0
 #1 0x00007ff77e082ad2 raise $src\third_party\llvm-build\Release+Asserts\minkernel\crts\ucrt\src\appcrt\misc\signal.cpp:547:0
 #2 0x00007ff77e07a8e8 abort $src\third_party\llvm-build\Release+Asserts\minkernel\crts\ucrt\src\appcrt\startup\abort.cpp:71:0
 #3 0x00007ff77c17537d llvm::report_fatal_error(class llvm::Twine const &, bool) $src\third_party\llvm\llvm\lib\Support\ErrorHandling.cpp:125:0
 #4 0x00007ff77c175165 llvm::report_fatal_error(char const *, bool) $src\third_party\llvm\llvm\lib\Support\ErrorHandling.cpp:83:0
 #5 0x00007ff77de1d173 llvm::DAGTypeLegalizer::PromoteIntegerResult(class llvm::SDNode *, unsigned int) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\LegalizeIntegerTypes.cpp:57:0
 #6 0x00007ff77d408e5e llvm::DAGTypeLegalizer::run(void) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\LegalizeTypes.cpp:261:0
 #7 0x00007ff77d40c54e llvm::SelectionDAG::LegalizeTypes(void) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\LegalizeTypes.cpp:1057:0
 #8 0x00007ff77c0f7cc7 llvm::SelectionDAGISel::CodeGenAndEmitDAG(void) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:933:0
 #9 0x00007ff77c0f7b22 llvm::SelectionDAGISel::SelectBasicBlock(class llvm::ilist_iterator_w_bits<struct llvm::ilist_detail::node_options<class llvm::Instruction, 0, 0, void, 1, class llvm::BasicBlock>, 0, 1>, class llvm::ilist_iterator_w_bits<struct llvm::ilist_detail::node_options<class llvm::Instruction, 0, 0, void, 1, class llvm::BasicBlock>, 0, 1>, bool &) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:831:0
#10 0x00007ff77c0f748d llvm::SelectionDAGISel::SelectAllBasicBlocks(class llvm::Function const &) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:1599:0
#11 0x00007ff77c0f54da llvm::SelectionDAGISel::runOnMachineFunction(class llvm::MachineFunction &) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:615:0
#12 0x00007ff77c96ed6d `anonymous namespace'::X86DAGToDAGISel::runOnMachineFunction $src\third_party\llvm\llvm\lib\Target\X86\X86ISelDAGToDAG.cpp:190:0
#13 0x00007ff77c0f434b llvm::SelectionDAGISelLegacy::runOnMachineFunction(class llvm::MachineFunction &) $src\third_party\llvm\llvm\lib\CodeGen\SelectionDAG\SelectionDAGISel.cpp:374:0
#14 0x00007ff77c280d84 llvm::MachineFunctionPass::runOnFunction(class llvm::Function &) $src\third_party\llvm\llvm\lib\CodeGen\MachineFunctionPass.cpp:94:0
#15 0x00007ff77bf61ca9 llvm::FPPassManager::runOnFunction(class llvm::Function &) $src\third_party\llvm\llvm\lib\IR\LegacyPassManager.cpp:1442:0
#16 0x00007ff77bf67df3 llvm::FPPassManager::runOnModule(class llvm::Module &) $src\third_party\llvm\llvm\lib\IR\LegacyPassManager.cpp:1488:0
#17 0x00007ff77bf62450 `anonymous namespace'::MPPassManager::runOnModule $src\third_party\llvm\llvm\lib\IR\LegacyPassManager.cpp:1557:0
#18 0x00007ff77bf620ae llvm::legacy::PassManagerImpl::run(class llvm::Module &) $src\third_party\llvm\llvm\lib\IR\LegacyPassManager.cpp:542:0
#19 0x00007ff77bd659a6 compileModule $src\third_party\llvm\llvm\tools\llc\llc.cpp:742:0
#20 0x00007ff77bd63c1d main $src\third_party\llvm\llvm\tools\llc\llc.cpp:409:0
#21 0x00007ff77e06b910 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0
#22 0x00007ff77e06b910 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#23 0x00007fff69c17374 (C:\WINDOWS\System32\KERNEL32.DLL+0x17374)
#24 0x00007fff69d5cc91 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x4cc91)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUWdFS4zrSfhpxoyJly3bsXHARksDPvzAzBZwzc_YmJUsdR4ssuSQZyD79lmQn2DnAzNllpnapqWQsS91fd3_dLSnUWlEpgDOUnaNseUJbt9XmjLpWPlDnxEmp-e7sK2BqAFsAoSrstsJiZqjdYqGw3mwEE1TishWSW6w3eMUrmOB7P81AYzTeUotLAIUbox8FB45b6yUJ5cAoKvH19e83nQDsttRhu9Wt5LgEzHTdUCdKCfhJuC12W8AbLaV-8gIWW6Nr0da4bawzQOuBJJTMUbRE0XxxPf90ub5d_X51d_X5E0bJEiOSS_lYa1OdkuhUKOFO4yianVZ5VBQ0A45IPlx899v5WMCse9t9Bkspc-IR5A6XUrMHi3VrMNPKtnXjhPZ-CtgldWBdD1M4i8gCW42Fw09CSrwF2WCx6XxcgbNYav0AHHunaK0m-CvgLeVBVmmAPmDempErmKSqwkZL6cNzQ3enJCIppop7LZV2eCOegb-4U8Gzw4vRqv9vFYRlE3zlsLC4NPoBFKYVFeplZW_MvK1a6zo1AzkGNmBAMY--1I8QsHsePWnFIYDeWxqY4qVx7DRm29YoD8PrYNro1gkFFjPNoaQWJnjuHGXbjoyADfDWa-nIZnVrGOCNkHCQz6jyZBKKydbTTyi88wEK8G0rHPRB8BMbA4-gHN60rjW9l20Hx8fZAJ3gcfihT4cAwGOxLz66vl54Etfe_1IomODztmq0UK5bBHwfwWCG58qkl078PynZBJ6HfljXVKhJybr3QyRfJFDrTVccl7oH8LZ3PCQ_Y1KybgCRggbP-pBZPz5xzw6R2R5Rdv5nGGFKtkSk2DrXWJ925AKRi0q4bVtOmK4RuWgtmNNOdg3K0_7Ca_Tf8XSaxPGUIHLxhnAyO6i_Dca8YkuYzz4GDEkSRC6GEsko3xFJrWEoW-jW-c--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