[all-commits] [llvm/llvm-project] fb632e: [GVN] Handle provenance when propagating assume eq...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Aug 5 00:19:06 PDT 2025


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

  Changed paths:
    M llvm/lib/Transforms/Scalar/GVN.cpp
    M llvm/test/Transforms/GVN/assume-equal.ll
    M llvm/test/Transforms/GVN/lifetime-simple.ll

  Log Message:
  -----------
  [GVN] Handle provenance when propagating assume equality (#151953)

If we have a known `p == p2` equality, we cannot replace `p2` with `p`
unless they are known to have the same provenance. GVN handles this when
propagating equalities from conditions, but not for assumes, as these go
through a different code path for uses in the same block.

Call canReplacePointersInUseIfEqual() before performing the replacement.
This is subject to the usual approximations (e.g. that we always allow
replacement with a dereferenceable constant and null).

This restriction does not appear to have any impact in practice.



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