<div><font>Hi:</font></div><div><font>I have a IR file which has been reduced by bugpoint, the IR is originally compiled for X86_64 and has custom transforms applied.</font></div><div><font>It compiles fine if I set the triple to aarch64-arm-none-eabi, but crashes when using the X86 backend , results in the following stack trace:</font></div><div><font><br></font></div><div><font>```</font></div><div><font><div>Assertion failed: (itr != mi2iMap.end() && "Instruction not found in maps."), function getInstructionIndex, file LLVM/llvm/include/llvm/CodeGen/SlotIndexes.h, line 399.</div><div>PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.</div><div>Stack dump:</div><div>0.<span class="Apple-tab-span" style="white-space:pre"> </span>Program arguments: bin/llc LLCCrash.bc -debug </div><div>1.<span class="Apple-tab-span" style="white-space:pre">        </span>Running pass 'Function Pass Manager' on module 'LLCCrash.bc'.</div><div>2.<span class="Apple-tab-span" style="white-space:pre">      </span>Running pass 'Simple Register Coalescing' on function '@_ZNK8CryptoPP15DL_VerifierBaseINS_8ECPPointEE17RecoverAndRestartEPhRNS_21PK_MessageAccumulatorE'</div><div>0  llc                      0x0000000103289eca llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 58</div><div>1  llc                      0x000000010328a459 PrintStackTraceSignalHandler(void*) + 25</div><div>2  llc                      0x000000010328832b llvm::sys::RunSignalHandlers() + 123</div><div>3  llc                      0x000000010328c209 SignalHandler(int) + 249</div><div>4  libsystem_platform.dylib 0x00007fff2052bd7d _sigtramp + 29</div><div>5  libdyld.dylib            0x00007fff20501473 dyldGlobalLockRelease() + 0</div><div>6  libsystem_c.dylib        0x00007fff2043a720 abort + 120</div><div>7  libsystem_c.dylib        0x00007fff204399d6 err + 0</div><div>8  llc                      0x0000000101e67066 llvm::SlotIndexes::getInstructionIndex(llvm::MachineInstr const&, bool) const + 470</div><div>9  llc                      0x0000000101e66e06 llvm::LiveIntervals::getInstructionIndex(llvm::MachineInstr const&) const + 38</div><div>10 llc                      0x0000000101ec5da5 (anonymous namespace)::RegisterCoalescer::joinCopy(llvm::MachineInstr*, bool&) + 149</div><div>11 llc                      0x0000000101ec2e5c (anonymous namespace)::RegisterCoalescer::copyCoalesceWorkList(llvm::MutableArrayRef<llvm::MachineInstr*>) + 204</div><div>12 llc                      0x0000000101ebdc34 (anonymous namespace)::RegisterCoalescer::joinAllIntervals() + 740</div><div>13 llc                      0x0000000101ebad54 (anonymous namespace)::RegisterCoalescer::runOnMachineFunction(llvm::MachineFunction&) + 804</div></font></div><div><font>```</font></div><div><font><br></font></div><div><font>The IR passes``opt -verify``, and given AArch64 backend works fine, I assume it's a bug in the X86 backend, thus I modified </font>SlotIndexes::getInstructionIndex to print the MachineInstr:</div><div><br></div><div>```</div><div><div> errs()<<"SlotIndex:\n";</div><div> BundleNonDebug.dump();</div></div><div>```</div><div><br></div><div>which gives me:</div><div><br></div><div>```</div><div><p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures">SlotIndex:</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures">  UNKNOWN , %59</span></p></div><div>```</div><div><br></div><div><br></div><div>I'm now absolutely lost on where this "UNKNOWN" comes from.</div><div><br></div><div><br></div><div><br></div><div>Zhang</div><div><includetail><!--<![endif]--></includetail></div>