[all-commits] [llvm/llvm-project] 1484ad: Revert "[BuildLibcalls, Attrs] Support more varian...

Richard Smith via All-commits all-commits at lists.llvm.org
Thu Feb 4 14:00:18 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1484ad4137b5d627573672bad48b03785f8fdefd
      https://github.com/llvm/llvm-project/commit/1484ad4137b5d627573672bad48b03785f8fdefd
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2021-02-04 (Thu, 04 Feb 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/BuildLibCalls.cpp
    M llvm/test/Transforms/InferFunctionAttrs/annotate.ll

  Log Message:
  -----------
  Revert "[BuildLibcalls, Attrs] Support more variants of C++'s new, add attributes for C++'s delete"

Several of the new attributes here were incorrect, and even the ones
that are generally correct were being added even to nobuiltin calls.

This reverts commit bb3f169b59e1c8bd7fd70097532220bbd11e9967.


  Commit: ab243efb261ba7e27f4b14e1a6fbbff15a79c0bf
      https://github.com/llvm/llvm-project/commit/ab243efb261ba7e27f4b14e1a6fbbff15a79c0bf
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2021-02-04 (Thu, 04 Feb 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/BuildLibCalls.cpp
    M llvm/test/Transforms/InferFunctionAttrs/annotate.ll

  Log Message:
  -----------
  Don't infer attributes on '::operator new'.

These attributes were all incorrect or inappropriate for LLVM to infer:
- inaccessiblememonly is generally wrong; user replacement operator new
  can access memory that's visible to the caller, as can a new_handler
  function.
- willreturn is generally wrong; a custom new_handler is not guaranteed
  to terminate.
- noalias is inappropriate: Clang has a flag to determine whether this
  attribute should be present and adds it itself when appropriate.
- noundef and nonnull on the return value should be specified by the
  frontend on all 'operator new' functions if we want them, not here.

In any case, inferring attributes on functions declared 'nobuiltin' (as
these are when Clang emits them) seems questionable.


Compare: https://github.com/llvm/llvm-project/compare/dd5c2b8de92d...ab243efb261b


More information about the All-commits mailing list