This is an archive of the discontinued LLVM Phabricator instance.

bugpoint: Prototype disabling symbolication of bugpoint-executed programs
ClosedPublic

Authored by dblaikie on Jun 1 2017, 3:01 PM.

Details

Summary

This shows the basic idea, using command line arguments. Further work
would be done to plumb through the argument to other tools (llc, lli).

This wouldn't handle things like external scripts (bugpoint's
-compile-command feature) which would need to explicitly opt-in by
passing the argument to any LLVM tools they invoke to avoid the
performance penalty of symbolication.

Alternatively (as suggested by chandlerc@) an environment variable would
be used. This would allow the option to pass transparently through user
scripts, pass to compilers if they happened to be LLVM-ish, etc.

I worry a bit about using cl::opt in the crash handling code - LLVM
might crash early, perhaps before the cl::opt is properly initialized?
Or at least before arguments have been parsed?

I shyed away from doing this with an environment variable when I
realized that would require copying the existing environment and
appending the env variable of interest. But it seems there's no existing
LLVM API for accessing the environment (even the Support tests for
process launching have their own ifdefs for getting the environment). It
could be added, but seemed like a higher bar/untested codepath to
actually add environment variables.

Anyway - so looking for folks thoughts/preferences/etc. This change as
is does fix the original issue I came across, with this change
test/BugPoint/metadata.ll goes from 1m34s to 6.5s (& I think it hits all
the other bugpoint tests too - so I guess they don't have loads of
coverage on the different programs that can be executed, etc)

Diff Detail

Repository
rL LLVM

Event Timeline

dblaikie created this revision.Jun 1 2017, 3:01 PM
dberlin accepted this revision.Jun 8 2017, 8:11 PM

I think this is the right thing to do given what we've seen. Nobody has come up with a use case where they current crawl backtraces in their scripts, etc.
If it becomes common, we can always revisit.

This revision is now accepted and ready to land.Jun 8 2017, 8:11 PM
chandlerc edited edge metadata.Jun 8 2017, 8:12 PM

I'm pretty happy to start simple with a flag and go from there.

lib/Support/Signals.cpp
39–42 ↗(On Diff #101121)

Especially because this is initialized to false initially, I think it'll be fine even if we crash in weird places.

tools/bugpoint/ToolRunner.cpp
66–67 ↗(On Diff #101121)

I assume this was just an experiment?

85–88 ↗(On Diff #101121)

same...

This revision was automatically updated to reflect the committed changes.