[all-commits] [llvm/llvm-project] c971f9: tsan: de-hardcode number of unused bits in trace e...

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Tue Nov 16 07:00:29 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c971f989ee9e1356308933e809ecbbbc5976c581
      https://github.com/llvm/llvm-project/commit/c971f989ee9e1356308933e809ecbbbc5976c581
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2021-11-16 (Tue, 16 Nov 2021)

  Changed paths:
    M compiler-rt/lib/tsan/rtl/tsan_trace.h

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

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.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D113979




More information about the All-commits mailing list