Finding what IR component llc assert-fails on

llc is giving me this assertion failure:

rodney@allegheny:~/proj/m3/git/cm3/m3-sys/m3tests/src/p0/p001/AMD64_LINUX$ llc -disable-fp-elim -filetype=asm -relocation-model=pic Main.mb.asm -o Main_m.s
llc: /home/rodney/proj/llvm/llvm-3.6.1/llvm-3.6.1.src/include/llvm/CodeGen/MachineInstr.h:252: llvm::DIVariable llvm::MachineInstr::getDebugVariable() const: Assertion `Var.Verify() && "not a DIVariable"' failed.

How can I find out the place in the input file Main.mb.asm that is provoking this?

I would imagine that the best way is using -debug. You’ll know what it was doing at the time and can make sense of what is happening. Of course, you could just dump the instruction that is causing the assertion (either in the debugger or directly in the code and rebuild).

But more than likely, I assume your code does something like MI.getDebugVariable() without checking isDebugValue() for the MachineInstr first (i.e. making an implicit assumption that what you’re looking at is a DebugValue).

Although you also seem to be on a very old version of LLVM, so I’m not sure if what I just said applies.