[llvm-dev] CloneFunction during LTO leads to seg fault?
Sergei Larin via llvm-dev
llvm-dev at lists.llvm.org
Fri Feb 12 08:28:55 PST 2016
In general I use DebugInfoFinder and clear out Metadata if GV in null or GV->isDeclaration().
If there is any interest, I can post that patch...
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
> -----Original Message-----
> From: Tobias Edler von Koch [mailto:tobias at codeaurora.org]
> Sent: Friday, February 12, 2016 9:51 AM
> To: Mehdi Amini; Scott A. Carr
> Cc: llvm-dev at lists.llvm.org; Sergei Larin
> Subject: Re: [llvm-dev] CloneFunction during LTO leads to seg fault?
> On 02/11/2016 10:05 AM, Mehdi Amini via llvm-dev wrote:
> >> Is this a bug? Is there an assumption that a function won't be cloned after
> inlining? Is there an assumption that the debug info metadata nodes are well
> formed when they get to DwarfDebug?
> > There shouldn't be such assumptions, and if there is such an assumption
> the compiler should assert instead of segfaulting (assuming you built with
> > My guess i that CloneFunction hasn't been tested with this case and it is a
> The problem is that the Clone* functions don't clean up debug info at all. This
> also affects split codegen in LTO (as is, it won't work if you have debug info).
> A work-around is to run something similar to StripDeadDebugInfo after
> cloning - Sergei (cc'ed) has seen some success using an approach based on
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
> Linux Foundation Collaborative Project.
More information about the llvm-dev