[llvm-dev] Optimization: Replace functions with thread unsafe variants + detection of multithreading

Dávid Bolvanský via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 23 08:07:38 PDT 2018


Hello,

My idea is to detect a multithreading and perform some transformations and
get new possibilities for optimizations:
1. Check pthread_create and follow CallInstr (goal: to know that we are in
new thread), identify functions where fork is used and check all other
CallIstr (we are in child) + check Windows variants of fork/ thread create..

2. Check functions if they do not contain any of thread unsafe functions -
if yes - mark such function as thread unsafe.

Then, we can replace some functions with thread unsafe variants in the
functions, where we are sure that they are run by fork / pthread_create or
already contain some thread unsafe functios.

Does anybody know if there is any such work in llvm?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180323/c893e9b8/attachment.html>


More information about the llvm-dev mailing list