[PATCH] D16083: [bugpoint] Teach bugpoint to reduce MDNodes

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 14:42:21 PST 2016


> On 2016-Jan-11, at 13:55, Keno Fischer <kfischer at college.harvard.edu> wrote:
> 
> My intuition is that you're liable to change the crash (rather than
> reduce it) when touching arbitrary metadata like this.  Particularly
> with debug info, this stuff is fairly cross-referential, and a `null`
> reference can have some non-trivial meaning.
> 
> Well, the idea is that you run the verifier after doing the null replacement.
> As long as the Verifier understands the structure of debug info, the only cost
> you pay is a slightly longer reduction time.

This is kind of scary, but if we assume the verifier is strong,
maybe not so bad.

In some places, MDTuple is used like a set and nulls are
unexpected.  In other places, MDTuple is used like a fixed-size
array, so changing the size would be pretty unexpected (and
even here, adding nullptrs might be unexpected).  It's unlikely
we have proper coverage for this stuff... although making
bugpoint rely on the verifier might be good motivation to add
missing coverage.

BTW, I'd expect a list-reductions on the arrays in DICompileUnit
to be efficient and fairly easy to implement.  That's independent
of whether you have the last-resort pass you're suggesting though.

I'd also be interested in a pass that reduced the @llvm.dbg.*
intrinsics.


More information about the llvm-commits mailing list