This is an archive of the discontinued LLVM Phabricator instance.

tsan: de-hardcode number of unused bits in trace events
ClosedPublic

Authored by dvyukov on Nov 16 2021, 3:43 AM.

Details

Summary

Precisely specifying the unused parts of the bitfield is critical for
performance. If we don't specify them, compiler will generate code to load
the old value and shuffle it to extract the unused bits to apply to the new
value. If we specify the unused part and store 0 in there, all that
unnecessary code goes away (store of the 0 const is combined with other
constant parts).

I don't see a good way to ensure we cover all of u64 bits with fields.
So at least introduce named kUnusedBits consts and check that bits
sum up to 64.

Depends on D113978.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Nov 16 2021, 3:43 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2021, 3:43 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Nov 16 2021, 6:56 AM
This revision is now accepted and ready to land.Nov 16 2021, 6:56 AM
This revision was automatically updated to reflect the committed changes.