Skip to content

[UnitTests/Vectorizer] Add unit tests for find_first_of pattern#333

Open
hazzlim wants to merge 1 commit intollvm:mainfrom
hazzlim:find-first-of-test
Open

[UnitTests/Vectorizer] Add unit tests for find_first_of pattern#333
hazzlim wants to merge 1 commit intollvm:mainfrom
hazzlim:find-first-of-test

Conversation

@hazzlim
Copy link

@hazzlim hazzlim commented Feb 3, 2026

This patch adds runtime test cases for vectorization of the find_first_of idiom:

for (; first != last; ++first)
for (s_it = s_first; s_it != s_last; ++s_it)
if (*first == *s_it)
return first;
return last;

NOTE: this idiom is currently only vectorized by LoopIdiomVectorize, which is not affected by #pragma clang loop vectorize(enable).

This patch adds runtime test cases for vectorization of the
find_first_of idiom:

  for (; first != last; ++first)
    for (s_it = s_first; s_it != s_last; ++s_it)
      if (*first == *s_it)
        return first;
  return last;

NOTE: this idiom is currently only vectorized by LoopIdiomVectorize,
which is not affected by `#pragma clang loop vectorize(enable)`.
@hazzlim hazzlim requested review from david-arm and fhahn February 3, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant