[PATCH] D75815: [InstCombine] Simplify calls with "returned" attribute

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 08:34:44 PDT 2020


glider added a comment.

Hi Nikita,

Unfortunately this patch broke the behavior of `__attribute__((no_sanitize(...)))` wrt inlining.
Previously, a function having such attribute could not be inlined into a function without it.
For example, for the following code:

  __attribute__((no_sanitize("kernel-memory")))
  static inline int KMSAN_INIT_INT(int value) {
   return value;
  }
  
  int bar(int value) {
    value = KMSAN_INIT_INT(value);
    return value;
  }

Clang now inlines KMSAN_INIT_INT when compiling it with `-fsanitize=kernel-memory`.

Existing code annotations for sanitizers rely on this inlining to not happen.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75815/new/

https://reviews.llvm.org/D75815





More information about the llvm-commits mailing list