[all-commits] [llvm/llvm-project] b10e4b: [GVN] Restrict equality propagation for pointers (...

Usman Nadeem via All-commits all-commits at lists.llvm.org
Wed Apr 24 09:00:05 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b10e4b82e624af870c2a03ce0c5515148136e287
      https://github.com/llvm/llvm-project/commit/b10e4b82e624af870c2a03ce0c5515148136e287
  Author: Usman Nadeem <mnadeem at quicinc.com>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/Loads.h
    M llvm/include/llvm/Transforms/Utils/Local.h
    M llvm/lib/Analysis/Loads.cpp
    M llvm/lib/Transforms/Scalar/GVN.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/test/Transforms/GVN/condprop.ll
    M llvm/unittests/Analysis/LoadsTest.cpp

  Log Message:
  -----------
  [GVN] Restrict equality propagation for pointers (#82458)

This patch does the following:

Adds the following functions:
- replaceDominatedUsesWithIf() that takes a callback.

- canReplacePointersIfEqual(...) returns true if the underlying object
is the same, and for null and const dereferencable pointer replacements.

- canReplacePointersIfEqualInUse(...) returns true for the above as well
as if the use is in icmp/ptrtoint or phi/selects feeding into them.

Updates GVN using the functions above so that the pointer replacements
are only made using the above API.

https://reviews.llvm.org/D143129



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