[all-commits] [llvm/llvm-project] c81dff: [MemoryBuiltins] Add getFreedOperand() function (N...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Jul 21 03:39:51 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c81dff3c306dd1a26e5f6377a040f811c325ba76
      https://github.com/llvm/llvm-project/commit/c81dff3c306dd1a26e5f6377a040f811c325ba76
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-07-21 (Thu, 21 Jul 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/MemoryBuiltins.h
    M llvm/lib/Analysis/GlobalsModRef.cpp
    M llvm/lib/Analysis/MemoryBuiltins.cpp
    M llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/lib/Transforms/Utils/Local.cpp

  Log Message:
  -----------
  [MemoryBuiltins] Add getFreedOperand() function (NFCI)

We currently assume in a number of places that free-like functions
free their first argument. This is true for all hardcoded free-like
functions, but with the new attribute-based design, the freed
argument is supposed to be indicated by the allocptr attribute.

To make sure we handle this correctly once allockind(free) is
respected, add a getFreedOperand() helper which returns the freed
argument, rather than just indicating whether the call frees *some*
argument.

This migrates most but not all users of isFreeCall() to the new
API. The remaining users are a bit more tricky.




More information about the All-commits mailing list