[PATCH] [mips] Fix the position of the .loc prologue_end directive in cases when the generated code contains DBG_VALUE instruction.

Daniel Sanders daniel.sanders at imgtec.com
Tue Sep 23 03:59:08 PDT 2014


According to findPrologueEndLoc(), the source location from the first non-DBG_VALUE instruction without the FrameSetup flag and with a known source location gets the prologue_end marker. I've had a quick look through the other targets and there seems to be two ways that targets influence this. PowerPC and NVPTX simply uses an unknown location in their prologue (via DebugLoc()), while ARM and AArch64 annotate some (but not all) instructions with the MachineInstr::FrameSetup flag. X86 seems to do both. Other targets didn't seem to do anything about it.

I think we could safely use an unknown DebugLoc() in all cases since the line number shouldn't change until the end of the prologue. Does anyone know of any benefits to using the FrameSetup flag? It seems preferable to use it so that prologue instructions have the location of the start of the function but I doubt that it has a real effect on the output.

http://reviews.llvm.org/D5209






More information about the llvm-commits mailing list