Skip to content

Conversation

@smanna12
Copy link
Contributor

@smanna12 smanna12 commented Jun 21, 2022

This patch allows safelen = 0 with ivdep attribute and emits suppressible warning when safelen of 0 or 1 is used

Current behaviour:

ivdep with safelen of 1 is allowed with no warning. Safelen of 0 causes an error.

Desired behaviour:

safelen of 1 and 0 should both be allowed but will have no effect on the loop.

Both should emit a warning. The warning should be suppressible with a -Wno flag.

Justification:

The safelen parameter of an ivdep will sometimes be set based on a template argument.
It makes this type of code much cleaner if the setting of 0 is permitted.

The warning for both the 0 and 1 case is helpful for users who might misunderstand the
meaning of the safelen parameter and set a value of 1 (or possibly 0) thinking it will have some effect.
The warning should be suppressible for those developers using the templated coding pattern described
above who understand and accept that a safelen of 0 will have no effect.

Signed-off-by: Soumi Manna soumi.manna@intel.com

smanna12 added 3 commits June 21, 2022 14:34
This patch allows safelen = 0 with ivdep attribute and emits suppressible warning when safelen of 0 or 1 is used

Current behaviour:

ivdep with safelen of 1 is allowed with no warning.  Safelen of 0 causes an error.

Desired behaviour:

safelen of 1 and 0 should both be allowed

Both should emit a warning. The warning should be suppressible with a -Wno flag.

Justification:

The safelen parameter of an ivdep will sometimes be set based on a template argument.
It makes this type of code much cleaner if the setting of 0 is permitted.

The warning for both the 0 and 1 case is helpful for users who might misunderstand the
meaning of the safelen parameter and set a value of 1 (or possibly 0) thinking it will have some effect.
The warning should be suppressible for those developers using the templated coding pattern described
above who understand and accept that a safelen of 0 will have no effect.

Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12 smanna12 marked this pull request as ready for review June 21, 2022 22:12
@smanna12 smanna12 requested a review from a team as a code owner June 21, 2022 22:12
@smanna12 smanna12 requested a review from erichkeane June 21, 2022 22:13
Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

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

Do we need to modify the docs?

Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12
Copy link
Contributor Author

Do we need to modify the docs?

Thanks @premanandrao for review. I have updated docs as well.

Signed-off-by: Soumi Manna <soumi.manna@intel.com>
AaronBallman
AaronBallman previously approved these changes Jun 22, 2022
Copy link
Contributor

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

LGTM as far as that goes

@smanna12
Copy link
Contributor Author

smanna12 commented Jun 22, 2022

LGTM as far as that goes

Thanks @AaronBallman for reviews and feedbacks.

Signed-off-by: Soumi Manna <soumi.manna@intel.com>
premanandrao
premanandrao previously approved these changes Jun 23, 2022
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
@smanna12
Copy link
Contributor Author

Thank you for the reviews everyone.

@intel/llvm-gatekeepers, this PR is ready for a merge. Thank you

@pvchupin pvchupin merged commit 558b3ba into intel:sycl Jun 23, 2022
@smanna12 smanna12 deleted the update_ivdep_attr branch June 23, 2022 19:51
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.

6 participants