[LLVMdev] A question about DBG_VALUE and Frame Index
Pranav Bhandarkar
pranavb at codeaurora.org
Wed Mar 7 17:19:16 PST 2012
Hi,
I have a case that is causing me grief in the form of an assert. The prolog
Epilog inserter tries to remove Frame Index references. I have a DBG_VALUE
instruction that looks like this (alongwith the Frame Index). This is for
the Hexagon backend.
**************************
fi#2: size=4, align=4, at location [SP-84]
DBG_VALUE <fi#2>, 0, !"fooBar"; line no:299
**************************
Clearly, the FI in question is at an offset of -84 from the SP at entry to
the function i.e. FP - 84. So I remove the FI by changing the instruction
to.
**************************
DBG_VALUE %R30, -84, !"fooBar"; line no:299
**************************
(R30 is the frame pointer register in Hexagon.)
So, logically we have moved from frame indices to actually base + offset
representation. However the assembly printer, while trying to emit debug
info, sticks to the frame index representation and looks for a base+offset
reference for -84 !!
This is at DwarfCompileUnit.cpp:1334
**************************
int Offset =
TFI->getFrameIndexReference(*Asm->MF,
DVInsn->getOperand(1).getImm(),
FrameReg);
**************************
In my view we have lost information that (R30-84) is <fi#2>. The above
statement is asking the Frame Lowering Information to give it a base+offset
pair for the frame index -84.
I do not think this is correct or am I missing something here ? For the sake
of completeness, I must mention that Hexagon uses the base class version of
getFrameIndexReference and does not provide its own.
Pranav
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
More information about the llvm-dev
mailing list