This is an archive of the discontinued LLVM Phabricator instance.

tsan: avoid extra call indirection in unaligned access functions
ClosedPublic

Authored by dvyukov on Aug 2 2021, 7:59 AM.

Details

Summary

Currently unaligned access functions are defined in tsan_interface.cpp
and do a real call to MemoryAccess. This means we have a real call
and no read/write constant propagation.

Unaligned memory access can be quite hot for some programs
(observed on some compression algorithms with ~90% of unaligned accesses).

Move them to tsan_interface_inl.h to avoid the additional call
and enable constant propagation.
Also reorder the actual store and memory access handling for
__sanitizer_unaligned_store callbacks to enable tail calling
in MemoryAccess.

Depends on D107282.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Aug 2 2021, 7:59 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2021, 7:59 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Aug 2 2021, 4:29 PM
vitalybuka added inline comments.
compiler-rt/lib/tsan/rtl/tsan_interface_inl.h
112

D107319 should help with warnings

This revision is now accepted and ready to land.Aug 2 2021, 4:29 PM
melver accepted this revision.Aug 3 2021, 1:16 AM
This revision was landed with ongoing or failed builds.Aug 3 2021, 2:12 AM
This revision was automatically updated to reflect the committed changes.