[LLVMdev] How can I see what opt tries to delete at the end of a pass?

Eli Friedman eli.friedman at gmail.com
Fri Feb 3 13:44:10 PST 2012

On Fri, Feb 3, 2012 at 1:20 PM, Griffin Wright <grwright at umich.edu> wrote:
> Hello,
> I've been stuck with a problem for about a month, and it has stumped
> everyone in my lab.  I have a function pass that runs, and when it finishes
> and opt goes to return, I get:
> While deleting: void %
> An asserting value handle still pointed to this value!
> UNREACHABLE executed at /x/grwright/llvm/llvm-2.9/lib/VMCore/Value.cpp:569!
> On a simple test case, the error becomes 'i32 %' instead of 'void %'.  I
> cannot for the life of me figure out what is happening.  I'm not deleting
> anything extra internal to my pass that I can tell, and I'm not sure how to
> go about debugging it.  All I get from output/gdb is along the lines of
> what you see below.
> Is there a way to see a breakdown of what exactly opt is doing, value by
> value, after it hits return at the end of opt.cpp?

Given your stack trace, all that is happing is that opt is deleting
the module.  I'm not sure what you mean by a breakdown.

The assertion indicates either there's memory corruption or an
AssertingVH is somehow leaking.  If you haven't yet, I'd suggest
trying valgrind.


More information about the llvm-dev mailing list