Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SingleSource/Vectorizer] Add unit tests for FindLastIV pattern. #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mel-Chen
Copy link

This patch adds runtime test case for vectorization of FindLastIV reduction idiom:

int32_t Rdx = -1;
for (int32_t I = 0; I < TC; I++) {
  Rdx = A[I] > B[I] ? I : Rdx;
}
return Rdx;

Improving test coverage for llvm/llvm-project#67812 and llvm/llvm-project#120395.

Copy link
Member

@alexey-bataev alexey-bataev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but wait for couple days for others to review

@Mel-Chen
Copy link
Author

Mel-Chen commented Jan 3, 2025

@fhahn @Meinersbur Do you have any suggestions and comments?

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for, do we need smaller types to trigger epilogue vectorization on more platforms?

IIUC llvm/llvm-project#120395 will need to be fixed first, otherwise the new tests will fail?

@Mel-Chen
Copy link
Author

Mel-Chen commented Jan 8, 2025

Same as for, do we need smaller types to trigger epilogue vectorization on more platforms?

Sure, could you take a look at AnyOf #195 to see if the approach is appropriate? I will modify this patch in the same way if you feel good.

IIUC llvm/llvm-project#120395 will need to be fixed first, otherwise the new tests will fail?

Yes, the current implementation still produces incorrect output in the following datasets after enabling epilogue vectorization.

    // Check with only Src1[N - 1] > Src2[N - 1].
    for (unsigned I = 0; I != N; ++I)
      Src1[I] = Src2[I] = std::numeric_limits<Ty>::min();
    Src1[N - 1] = std::numeric_limits<Ty>::max();

llvm/llvm-project#120395 can fix this error.

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.

3 participants