Closed matsc-at-sics-se closed 6 years ago
Assertion triggers in this code:
void MIPrinter::printStackObjectReference(int FrameIndex) {
auto ObjectInfo = StackObjectOperandMapping.find(FrameIndex);
assert(ObjectInfo != StackObjectOperandMapping.end() &&
"Invalid frame index");
const FrameIndexOperand &Operand = ObjectInfo->second;
if (Operand.IsFixed) {
OS << "%fixed-stack." << Operand.ID;
return;
}
OS << "%stack." << Operand.ID;
if (!Operand.Name.empty())
OS << '.' << Operand.Name;
}
So no ObjectInfo
is found for the given FrameIndex
.
Happens while printing a MOVAPSrm
instruction, which loads from some stack frame object.
Question: is it possible to invoke the MIR printing pass by some means other than the -unison
flag?
I don't know how to make progress. Roberto, please help.
Hi, you can try the option --print-machineinstrs
on llc
, it dumps the MIR after each pass (in a slightly different format).
Attached are two transcript: LOG1.txt LOG2.txt
One after llc fftbug.ll -O2 -print-machineinstrs
,
one after llc fftbug.ll -O2 -print-machineinstrs -unison
.
The second one shows the crash, whereas in the same place the first one successfully dumps the machine code after Live Variable Analysis. There are other interesting differences.
Where do we go from here?
The updated llc
from commit unison-code/llvm@7fd605e does not crash anymore.
fftbug.c.txt I tried to narrow it down as much as possible. Reproducer: