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

    <tr>
        <th>Summary</th>
        <td>
            [instcombine] Assertion `I->getParent() && "Instruction not inserted yet?"' failed.
        </td>
    </tr>

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

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

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

<pre>
    The bug was found by FuzzGen IR test generator

Run opt with Run opt with -passes='instcombine'

https://godbolt.org/z/GxWGWWs8n
```console
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=instcombine <source>
 #0 0x0000000003467e08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3467e08)
 #1 0x00000000034656fc SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fdfe4aa9420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #3 0x00007fdfe456c00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #4 0x00007fdfe454b859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x00007fdfe454b729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #6 0x00007fdfe455cfd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #7 0x0000000001e5d375 llvm::InstructionWorklist::push(llvm::Instruction*) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x1e5d375)
 #8 0x0000000002fcf716 llvm::InstCombinerImpl::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2fcf716)
 #9 0x0000000002fd199e combineInstructionsOverFunction(llvm::Function&, llvm::InstructionWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::OptimizationRemarkEmitter&, llvm::BlockFrequencyInfo*, llvm::ProfileSummaryInfo*, unsigned int, llvm::LoopInfo*) InstructionCombining.cpp:0:0
#10 0x0000000002fd28ce llvm::InstCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2fd28ce)
#11 0x000000000367cede llvm::detail::PassModel<llvm::Function, llvm::InstCombinePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x367cede)
#12 0x0000000000d3ad9d llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xd3ad9d)
#13 0x0000000002dde7be llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2dde7be)
#14 0x0000000000d1fa6e llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xd1fa6e)
#15 0x0000000002ddc7bc llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x2ddc7bc)
#16 0x0000000000885a6a llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x885a6a)
#17 0x000000000078d061 main (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x78d061)
#18 0x00007fdfe454d083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#19 0x000000000087acae _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x87acae)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWF1P47oW_TXui9XKdZqvhz50gHLRHTQI0PBYOfFO6kti5_pjoPz6IycBklLmwEwfRuegQqm9vbz22stubGaMKCXAEoVfUHg6Yc5ulV7eMrtjkp0ql1kzyRTfLW-3gDNX4gdmcKGc5Djb4bV7ejoHiS-usQVjcQkSNLNKI3KKyKr7e-0kVo3FD8Ju8ejDtGHGgEHBKaKxkMbmqs6EBETjIcDW2sagYIXoGtF1qXimKjtTukR0_YTo-vzx7vzuziSyHxSR7pUraVQFXeuNZfk95q5uPFLbRGaIpFdalZrVmOnS1SCtnwgjulaNRXSdq7oRFegpPDaV0qB9W8VkOfXMtRVKmqnVTt4jus6E7AbiqfIQrGn8Z2cbZ2cGT28GCQ-yxSg4McrpHFBw1jHDiAYEk0fy_BMsohhIgqvqR-35ByuzM90_V1pI22Z3q1kOiCavQZo9bJSxGliNaIToCRbSIppiRJPfzBHRL-Sxp4Vo-sp7vsc7jIoc34hSsuo_TPLK4yc9ja7ZzPLGV4W0vy9AtAeKC17AgrF0QQnebDQYqzRstO2zqESG6PoxiTbRYloJ6R6npXRdR2O3GhifGTUjLeP5YkHJiG8wmiaMckIyrJkw8AH83CNHLfIiICQbIS_GyIssCVPMMvUh5gNkSpMwHSGH-8jxS00_jBnTMWY0xgzzgkefwwyCgkcjzHjohTmEPIjDgY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