[PATCH] D101701: [RFC][nofree] Refine concurrency requirements

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 6 16:35:08 PDT 2021


nhaehnle added inline comments.


================
Comment at: llvm/docs/LangRef.rst:1619
 
     A ``nofree`` function is explicitly allowed to free memory which it
+    allocated.  As a result, perhaps surprisingly, a ``nofree`` function can
----------------
sstefan1 wrote:
> If I'm not wrong, this part hasn't been implemented yet? We won't infer `nofree` for a function that frees memory it allocated.
Well, we do infer `nofree` for functions that contain `alloca`, which is implicitly freed at the end, though you're probably right about malloc and friends. In any case, that doesn't contradict what's written here.


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:1413
 
+  bool isReleaseAtomic(Instruction *I) {
+    if (!I->isAtomic())
----------------
sstefan1 wrote:
> Maybe make this static, like `AANoSyncImpl` does?
I'm moving this helper around in the second version, so the point hopefully becomes moot :)


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