[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 13:54:11 PDT 2022


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

Changes in revision 3 of the patch

- return a conservative result from `getConstantDataArrayInfo` for past-the-end offsets,
- adds comments to `getConstantStringInfo` and `GetStringLengthH` explaining the decision to return a conservative result for out-of-bounds offsets,
- fold empty sequences in `optimizeMemRChr` and `optimizeMemRhr`,
- add new and adjust existing tests.


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.440373.patch
Type: text/x-patch
Size: 53113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220627/f9860e7d/attachment.bin>


More information about the llvm-commits mailing list