[PATCH] D128011: [SimplifyLibCalls] Transform memchr(STR, C, N) to chain of ORs
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 22 11:51:26 PDT 2022
nikic added a comment.
I think for the limit, the important thing to consider is comparisons that collapse into range checks. We don't want to limit the total number of characters being checked, but rather the number of of non-contiguous ranges. The motivating cases reduce down to just one or two range checks, which is certainly profitable. The cases that would require a switch for decent lowering are less clearly profitable, especially when we take into account that such a switch is not being reliably produced (as your phase ordering test shows).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128011/new/
https://reviews.llvm.org/D128011
More information about the llvm-commits
mailing list