[PATCH] D143129: [GVN] Restrict equality propagation for pointers

Usman Nadeem via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 20:38:07 PDT 2023


mnadeem updated this revision to Diff 505980.
mnadeem added a comment.

- Guard `addToLeaderTable` with the pointer replacement check.

- Create two APIs
  - bool canReplacePointersIfEqual(const Value *From, const Value *To);
  - bool canReplacePointersIfEqualInUse(const Use &U, const Value *To);

- For the callback in `replaceDominatedUsesWithIf` I changed the `from` argument with a `Use`. But I still need the `to` value in the callback.

- Clang format

- Update tests


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143129/new/

https://reviews.llvm.org/D143129

Files:
  llvm/include/llvm/Analysis/Loads.h
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Analysis/Loads.cpp
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/Transforms/GVN/assume-equal.ll
  llvm/test/Transforms/GVN/condprop.ll
  llvm/unittests/Analysis/LoadsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143129.505980.patch
Type: text/x-patch
Size: 21566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230317/69ae6f72/attachment.bin>


More information about the llvm-commits mailing list