[PATCH] D123628: [InstCombine] Bail on memrchr calls with an excessive size.

Martin Sebor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 13:22:57 PDT 2022


msebor updated this revision to Diff 422631.
msebor retitled this revision from "[InstCombine] Fold memrchr calls with an excessive size to null." to "[InstCombine] Bail on memrchr calls with an excessive size.".
msebor added a comment.

Avoid folding `memrchr` calls with an excessive size to null.

I'm open to treating such calls with `unreachable` if there is broader support for it.  In my experience, some users/projects are in favor of it, others prefer the current approach of making the library call, and others still would like to see it replaced with a trap.  Providing a compiler option would let each group choose what works best for them.


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

https://reviews.llvm.org/D123628

Files:
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/memrchr-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123628.422631.patch
Type: text/x-patch
Size: 5188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220413/5be756f6/attachment.bin>


More information about the llvm-commits mailing list