Skip to content

Reduction series : [polly] Make reduction detection checks more robust - part 1 #75297

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

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

kartcq
Copy link
Contributor

@kartcq kartcq commented Dec 13, 2023

Existing redection detection algorithm does two types of memory checks before marking a load store pair as reduction.
First is to check if load and store are pointing to the same memory.This check right now detects the following case as reduction. sum[0] = sum[1] + A[i]
This is because the check compares only base of the memory addresses involved and not their indices. This patch addresses this issue and introduces some debug prints. Added couple of test cases to verify the functionality of patch as well.

Existing redection detection algorithm does two types of memory checks
before marking a load store pair as reduction.
First is to check if load and store are pointing to the same memory.This
check right now detects the following case as reduction.
sum[0] = sum[1] + A[i]
This is because the check compares only base of the memory addresses
involved and not their indices. This patch addresses this issue and
introduces some debug prints. Added couple of test cases to verify the
functionality of patch as well.

Change-Id: Ibe523a7d5f1538162f802fb079f32b30ba32175f
Copy link
Collaborator

@efriedma-quic efriedma-quic left a comment

Choose a reason for hiding this comment

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

LGTM

@efriedma-quic efriedma-quic merged commit fa3307e into llvm:main Jan 31, 2024
efriedma-quic pushed a commit that referenced this pull request Feb 12, 2024
Existing reduction detection algorithm does two types of memory checks
before marking a load store pair as reduction.
Second check is to verify there is no other memory access in ScopStmt
overlapping with the memory of load and store that forms the reduction.
Existing check misses cases where there could be probable overlap such
as
	A[V] += A[P];
In the above case there is chance of overlap between A[V] and A[P] which
is missed.
This commit addresses this by removing the parameter from space before
checking for compatible space.

Part 1 of this patch :
[75297](#75297)
@kartcq kartcq deleted the reduction_check1 branch February 28, 2024 06:03
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.

2 participants