<div dir="ltr">Hello,<div><br></div><div>My idea is to detect a multithreading and perform some transformations and get new possibilities for optimizations:</div><div>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..</div><div><br></div><div>2. Check functions if they do not contain any of thread unsafe functions - if yes - mark such function as thread unsafe.</div><div><br></div><div>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.</div><div><br></div><div>Does anybody know if there is any such work in llvm?</div><div><br></div></div>