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

    <tr>
        <th>Summary</th>
        <td>
            Assertion in TwoAddressInstructionPass
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    @stoklund

cc @dbd64

```
ld.lld: /data/scratch/danielbd/llvm-project/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1493: void {anonymous}::TwoAddressInstructionPass::processTiedPairs(llvm::MachineInstr*, {anonymous}::TwoAddressInstructionPass::TiedPairList&, unsigned int&): Assertion `i == DstIdx || !MI->getOperand(i).isReg() || MI->getOperand(i).getReg() != RegA’ failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld -nostdlib -export-dynamic -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64 -static -o /data/scratch/danielbd/cloudcc/cymbl-proj/cloudclang/dependencies/build/aws/aws-sdk-cpp/bin/aws-checksums-tests /data/scratch/danielbd/cloudcc/cymbl-proj/cloudclang/dependencies/build/aws/install/lib/crt1.o /data/scratch/danielbd/cloudcc/cymbl-proj/cloudclang/dependencies/build/aws/install/lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginT.o -L/data/scratch/danielbd/cloudcc/cymbl-proj/cloudclang/dependencies/build/aws/install/lib -L/data/scratch/danielbd/cloudcc/cymbl-proj/cloudclang/dependencies/build/aws/install/lib -L/data/scratch/danielbd/cloudcc/cymbl-proj/cloudclang/dependencies/build/aws/install/lib -plugin /data/scratch/danielbd/llvm-project/install-16.0.2/bin/../lib/LLVMgold.so -plugin-opt=mcpu=x86-64 -plugin-opt=O3 -lrt CMakeFiles/aws-checksums-tests.dir/tests/crc_test.c.o CMakeFiles/aws-checksums-tests.dir/tests/run_tests.c.o libaws-checksums.a --start-group /usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a /usr/lib/gcc/x86_64-linux-gnu/7/libgcc_eh.a --end-group /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /data/scratch/danielbd/cloudcc/cymbl-proj/cloudclang/dependencies/build/aws/install/lib/crtn.o -lc
1.      Running pass ‘Function Pass Manager’ on module ‘ld-temp.o’.
2.      Running pass ‘Two-Address instruction pass’ on function ‘@aws_checksums_crc32c_hw’
 #0 0x000055a07a42fd4a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xe24d4a)
 #1 0x000055a07a42d73c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007ff550c34980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #3 0x00007ff54f74ee87 raise /build/glibc-uZu3wS/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #4 0x00007ff54f7507f1 abort /build/glibc-uZu3wS/glibc-2.27/stdlib/abort.c:81:0
 #5 0x00007ff54f7403fa __assert_fail_base /build/glibc-uZu3wS/glibc-2.27/assert/assert.c:89:0
 #6 0x00007ff54f740472 (/lib/x86_64-linux-gnu/libc.so.6+0x30472)
 #7 0x000055a07c949763 (anonymous namespace)::TwoAddressInstructionPass::processTiedPairs(llvm::MachineInstr*, llvm::SmallVector<std::pair<unsigned int, unsigned int>, 4u>&, unsigned int&) TwoAddressInstructionPass.cpp:0:0
 #8 0x000055a07c94ae9a (anonymous namespace)::TwoAddressInstructionPass::runOnMachineFunction(llvm::MachineFunction&) TwoAddressInstructionPass.cpp:0:0
 #9 0x000055a07c6d2792 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.71) MachineFunctionPass.cpp:0:0
#10 0x000055a07df0da26 llvm::FPPassManager::runOnFunction(llvm::Function&) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0x4902a26)
#11 0x000055a07df0dd79 llvm::FPPassManager::runOnModule(llvm::Module&) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0x4902d79)
#12 0x000055a07df0ebf0 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0x4903bf0)
#13 0x000055a07c47761d codegen(llvm::lto::Config const&, llvm::TargetMachine*, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex const&) (.part.614) LTOBackend.cpp:0:0
#14 0x000055a07c4778be codegen(llvm::lto::Config const&, llvm::TargetMachine*, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex const&) LTOBackend.cpp:0:0
#15 0x000055a07c477bac llvm::lto::backend(llvm::lto::Config const&, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0x2e6cbac)
#16 0x000055a07c46d613 llvm::lto::LTO::runRegularLTO(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0x2e62613)
#17 0x000055a07c46dd27 llvm::lto::LTO::run(std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, std::function<llvm::Expected<std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>> (unsigned int, llvm::StringRef, llvm::Twine const&)>) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0x2e62d27)
#18 0x000055a07a5dbaa1 lld::elf::BitcodeCompiler::compile() (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xfd0aa1)
#19 0x000055a07a55511f void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::support::endianness)1, true>>(bool) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xf4a11f)
#20 0x000055a07a5693db lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xf5e3db)
#21 0x000055a07a56c171 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xf61171)
#22 0x000055a07a56dbe9 lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xf62be9)
#23 0x000055a07a3a7b59 lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) lld.cpp:0:0
#24 0x000055a07a3a7edd lld_main(int, char**) (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xd9cedd)
#25 0x00007ff54f731c87 __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:344:0
#26 0x000055a07a3a4b6a _start (/data/scratch/danielbd/llvm-project/install-16.0.2/bin/ld.lld+0xd99b6a)
Aborted
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWltvpDoS_jXOiwUCQ3N5yENPkt4dKdFEk-g87EvL2AXtjbFZ20yS_fUrA32h0zmTyU7mSKMj5QLG5fq-qnK5bKDWikYBnKPFJ7S4PKO922h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