[all-commits] [llvm/llvm-project] 1cea5c: [SCCP] Propagate non-null pointers (#106090)

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Aug 27 00:14:02 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1cea5c2138bef3d8fec75508df6dbb858e6e3560
      https://github.com/llvm/llvm-project/commit/1cea5c2138bef3d8fec75508df6dbb858e6e3560
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-08-27 (Tue, 27 Aug 2024)

  Changed paths:
    M llvm/lib/Transforms/Utils/SCCPSolver.cpp
    M llvm/test/Transforms/SCCP/pointer-nonnull.ll

  Log Message:
  -----------
  [SCCP] Propagate non-null pointers (#106090)

Add NotConstant(Null) roots for nonnull arguments and then propagate
them through nuw/inbounds GEPs.

Having this functionality in SCCP is useful because it allows reliably
eliminating null comparisons, independently of how deeply nested they
are in selects/phis. This handles cases that would hit a cutoff in
ValueTracking otherwise.

The implementation is something of a MVP, there are a number of obvious
extensions (e.g. allocas are also non-null).



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