[PATCH] D130466: [LICM] - Add option to allow data races

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 10 08:52:12 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2150
     Value *Object = getUnderlyingObject(SomePtr);
-    if (isWritableObject(Object) && isThreadLocalObject(Object, CurLoop, DT))
+    bool SafeToInsertStore = TTI->isSingleThreaded() || SingleThread;
+    if ((isWritableObject(Object) &&
----------------
These checks should be in isThreadLocalObject(). If there is only a single thread, then the object is always thread-local. Your current code incorrectly skips the writability check.


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

https://reviews.llvm.org/D130466



More information about the llvm-commits mailing list