[all-commits] [llvm/llvm-project] e90bce: CallBase: fix getFnAttr so it also checks the func...

Augie Fackler via All-commits all-commits at lists.llvm.org
Sun Apr 3 20:19:39 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e90bce8f9191ef1eb2a9b5ff6c90a094acb8de0a
      https://github.com/llvm/llvm-project/commit/e90bce8f9191ef1eb2a9b5ff6c90a094acb8de0a
  Author: Augie Fackler <augie at google.com>
  Date:   2022-04-03 (Sun, 03 Apr 2022)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/lib/Analysis/InlineCost.cpp
    M llvm/lib/IR/Instructions.cpp
    M llvm/test/Transforms/Attributor/assumes_info.ll
    M llvm/test/Transforms/OpenMP/remove_globalization.ll
    M llvm/test/Transforms/OpenMP/replace_globalization.ll

  Log Message:
  -----------
  CallBase: fix getFnAttr so it also checks the function

Prior to this change, CallBase::hasFnAttr checked the called function to
see if it had an attribute if it wasn't set on the CallBase, but
getFnAttr didn't do the same delegation, which led to very confusing
behavior. This patch fixes the issue by making CallBase::getFnAttr also
check the function under the same circumstances.

Test changes look (to me) like they're cleaning up redundant attributes
which no longer get specified both on the callee and call. We also clean
up the one ad-hoc implementation of this getter over in InlineCost.cpp.

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


  Commit: 603ae73146740f12986605b2a3e7b3817809bbb8
      https://github.com/llvm/llvm-project/commit/603ae73146740f12986605b2a3e7b3817809bbb8
  Author: Augie Fackler <augie at google.com>
  Date:   2022-04-03 (Sun, 03 Apr 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp

  Log Message:
  -----------
  AttributorAttributes: guard against TLI being nullptr

I didn't dig into this very much because it appears to be totally valid
(especially once these properties can come from attributes instead
of only from hard-coded library functions) for TLI to not be defined,
and nothing broke when I added this check, including with all my other
patches applied.

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


Compare: https://github.com/llvm/llvm-project/compare/88de27e3fd9f...603ae7314674


More information about the All-commits mailing list