[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
Fri Jun 24 10:56:20 PDT 2022


msebor updated this revision to Diff 439819.
msebor marked an inline comment as done.
msebor added a comment.

- Have `getConstantStringInfo` fail for empty array slices when `TrimAtNul` is set.
- Have `GetStringLengthH` fail for empty array slices.
- Gracefully handle empty array slices in `memchr` and `memrchr` folders.
- Add 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/strcall-no-nul.ll
  llvm/test/Transforms/InstCombine/strnlen-1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128364.439819.patch
Type: text/x-patch
Size: 46457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220624/abd6ea25/attachment.bin>


More information about the llvm-commits mailing list