[PATCH] D54889: Fiber support for thread sanitizer

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 5 07:20:36 PST 2019


dvyukov added a comment.

Also benchmarked function entry/exit using the following benchmark:

// foo1.c
void foo(bool x);
void bar() {}
int main() {

  volatile int kRepeat = 1 << 30;
  const int repeat = kRepeat;
  for (int i = 0; i < repeat; i++)
    foo(false);

}

// foo2.c
void bar();
void foo(bool x) {

  if (x)
    bar();

}

The program spends ~75% of time in __tsan_func_entry/exit. Rest of the conditions are the same as in the previous benchmark.

Current code runs in 7.16s
This change -- 6.23s
This change + cur_thread_fast returning cur_thread_placeholder -- 7.01s
I also tried this change + FuncEntry using cur_thread_fast -- 6.20s

Using the pointer indirection seems to positively affect func entry/exit codegen.


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54889/new/

https://reviews.llvm.org/D54889





More information about the llvm-commits mailing list