Files
clang-p2996/llvm/lib/Analysis/Loads.cpp
Usman Nadeem b10e4b82e6 [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
2024-04-24 08:59:42 -07:00

31 KiB