[all-commits] [llvm/llvm-project] 10264a: Introduce noundef attribute at call sites for stri...

Gui Andrade via All-commits all-commits at lists.llvm.org
Thu Mar 4 12:17:51 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10264a1b21aebf75a8102116c9648c3386e8021e
      https://github.com/llvm/llvm-project/commit/10264a1b21aebf75a8102116c9648c3386e8021e
  Author: Gui Andrade <gh at archshift.com>
  Date:   2021-03-04 (Thu, 04 Mar 2021)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    A clang/test/CodeGen/attr-noundef.cpp
    A clang/test/CodeGen/indirect-noundef.cpp

  Log Message:
  -----------
  Introduce noundef attribute at call sites for stricter poison analysis

This change adds a new IR noundef attribute, which denotes when a function call argument or return val may never contain uninitialized bits.

In MemorySanitizer, this attribute enables optimizations which decrease instrumented code size by up to 17% (measured with an instrumented build of clang) . I'll introduce the change allowing msan to take advantage of this information in a separate patch.

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




More information about the All-commits mailing list