This is an archive of the discontinued LLVM Phabricator instance.

Require users to opt into DebugCounting
ClosedPublic

Authored by george.burgess.iv on Aug 1 2018, 10:57 AM.

Details

Summary

r337748 made it so that DebugCounters are always incremented in asserting builds, so that we can better track how many times certain passes are run. This change broke some multithreaded tsan builds (D50080), since we increment these global counters in an unsynchronized manner.

We only need these counter values if we're either using a DebugCounter to limit a pass, or if we plan to print them out (D50031). Having an enable bit to track that seems like the best way forward.

I don't have a test, since the global state at play here makes unittesting pretty awkward, and we have some existing test coverage here. Happy to try to make something if people want that, though.

Whatever the fix here ends up being, I intend to try to get it into the 7.0 branch.

Diff Detail

Event Timeline

davide accepted this revision.Aug 1 2018, 10:43 PM

LGTM, thanks George. I'm not particularly worried if it's too hard to write a test for this.

This revision is now accepted and ready to land.Aug 1 2018, 10:43 PM
This revision was automatically updated to reflect the committed changes.