[all-commits] [llvm/llvm-project] ff55d0: [nofree] Restrict semantics to memory visible to c...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Apr 16 11:39:14 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff55d01a8e1b60c137cd8cab7d9eeef14284fd7a
      https://github.com/llvm/llvm-project/commit/ff55d01a8e1b60c137cd8cab7d9eeef14284fd7a
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-04-16 (Fri, 16 Apr 2021)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/lib/IR/Value.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/LICM/hoist-alloc.ll
    M llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll

  Log Message:
  -----------
  [nofree] Restrict semantics to memory visible to caller

This patch clarifies the semantics of the nofree function attribute to make clear that it provides an "as if" semantic. That is, a nofree function is guaranteed not to free memory which existed before the call, but might allocate and then deallocate that same memory within the lifetime of the callee.

This is the result of the discussion on llvm-dev under the thread "Ambiguity in the nofree function attribute".

The most important part of this change is the LangRef wording. The rest is minor comment changes to emphasize the new semantics where code was accidentally consistent, and fix one place which wasn't consistent. That one place is currently narrowly used as it is primarily part of the ongoing (and not yet enabled) deref-at-point semantics work.

Differential Revision: https://reviews.llvm.org/D100141




More information about the All-commits mailing list