[all-commits] [llvm/llvm-project] dcd58a: [Inline] Allow inlining with null_pointer_is_valid...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Apr 7 00:23:59 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dcd58a8fedc8127479e8553dbeed1f172caae34f
      https://github.com/llvm/llvm-project/commit/dcd58a8fedc8127479e8553dbeed1f172caae34f
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

  Changed paths:
    M llvm/lib/Analysis/InlineCost.cpp
    M llvm/test/Transforms/Inline/attributes.ll

  Log Message:
  -----------
  [Inline] Allow inlining with null_pointer_is_valid mismatch (#190510)

If the callee has null_pointer_is_valid but the caller does not, we
should still inline and add null_pointer_is_valid to the caller (which
is handled by an already existing inline adjustment rule).

This does mean that optimizations in the caller may be reduced by
unnecessarily preserving null checks, but that's still better than not
inlining at all. In particular, this check causes issues with LTO in the
Linux kernel, as the C portions are compiled with null_pointer_is_valid,
but the Rust portions are not.

The test is modified to show that the previous alwaysinline behavior now
always holds.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list