[PATCH] D101701: [nofree] Refine concurrency requirements

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 7 08:27:33 PDT 2021


reames requested changes to this revision.
reames added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:1282
+
+  if (I.hasReleaseOrdering()) {
+    if (auto *FI = dyn_cast<FenceInst>(&I))
----------------
This is wrong.  A thread can coordinate using only acquire ordering within 'f'.

Example:
g = o; // the object being potentially freed
if (g_acquire)
  return; // then *caller* does release store
use o;

The other thread does:
while (!g) {
  g_acquire = true;
  while (!g_release) {}
  free(g);
}

Please exactly match the existing nosync logic in this file by using isOrderedAtomic helper in this file.  We can be more aggressive later if desired.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101701



More information about the llvm-commits mailing list