[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 May 3 02:43:24 PDT 2023
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1405
+ for (size_t i = 1; i < SortedStr.size(); ++i) {
+ if (SortedStr[i] > SortedStr[i - 1] + 1) {
+ NonContRanges++;
----------------
So, the reason why this checks `>` rather than `!=` is to handle the case where the same char appears in the string multiple times, right? I don't think there is a test for this case right now, could you please add one?
================
Comment at: llvm/test/Transforms/InstCombine/memchr-7.ll:2
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
----------------
Can you please add `-instcombine-infinite-loop-threshold=2` to this test, to make sure this doesn't require multiple iteration to fold.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128011/new/
https://reviews.llvm.org/D128011
More information about the llvm-commits
mailing list