[PATCH] D128364: [InstCombine] Look through more casts when folding memchr and memcmp

Martin Sebor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 16:36:40 PDT 2022


msebor updated this revision to Diff 440431.
msebor added a comment.

Changes in revision 4 of the patch:

- use `getUnderlyingObject` and `stripAndAccumulateConstantOffsets` and avoid recursion in `getConstantDataArrayInfo`,
- add tests to exercise long chain of GEPs.


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

https://reviews.llvm.org/D128364

Files:
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/memchr-10.ll
  llvm/test/Transforms/InstCombine/memchr-9.ll
  llvm/test/Transforms/InstCombine/memcmp-7.ll
  llvm/test/Transforms/InstCombine/memcmp-8.ll
  llvm/test/Transforms/InstCombine/memrchr-7.ll
  llvm/test/Transforms/InstCombine/str-int-3.ll
  llvm/test/Transforms/InstCombine/strcall-no-nul.ll
  llvm/test/Transforms/InstCombine/strlen-9.ll
  llvm/test/Transforms/InstCombine/strnlen-1.ll
  llvm/test/Transforms/InstCombine/wcslen-1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128364.440431.patch
Type: text/x-patch
Size: 56920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220627/3d01787d/attachment-0001.bin>


More information about the llvm-commits mailing list