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

Usman Nadeem via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 25 16:35:31 PST 2023


mnadeem updated this revision to Diff 500469.
mnadeem retitled this revision from "[GVN] Do not propagate equalities for noalias pointers" to "[GVN] Restrict equality propagation for pointers".
mnadeem added a comment.

- Added a new method `replaceDominatedUsesWithIf()` that takes a callback.
- Updated `canReplacePointersIfEqual()` to return true for the following:
  - Uses in ICmpInst and PtrToIntInst
  - Replacements with null
  - When underlying objects are the same
- Update tests.
- New LLVM test suite bitcode diff using O3 <https://reviews.llvm.org/owners/package/3/> (assembly files were more difficult to analyze): https://github.com/UsmanNadeem/vigilant-octo-journey/commit/65a770a65eca4ed2cb37f6ff6a36ec6193fe8b73

Not sure about the changes in the `assume-equal.ll` test.


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.500469.patch
Type: text/x-patch
Size: 21596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230226/0bcaad3f/attachment.bin>


More information about the llvm-commits mailing list