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

[SYCL] Add clang implementation for accessor property no_alias #3452

Merged
merged 13 commits into from
Apr 9, 2021

Conversation

schittir
Copy link
Contributor

@schittir schittir commented Mar 31, 2021

no_alias is a compile-time-constant accessor property.
It exists in cl::sycl::ONEAPI::property scope.
When applied the LLVM IR should contain the noalias parameter attribute
on the kernel argument corresponding to that accessor.
This patch uses clang's RestrictAttr to emit noalias i.e., llvm::Attribute::NoAlias.

@schittir schittir force-pushed the accessor_no_alias_property branch from 178f9e7 to e3dbe8b Compare April 1, 2021 17:32
@schittir schittir marked this pull request as ready for review April 1, 2021 18:07
@schittir schittir requested a review from premanandrao as a code owner April 1, 2021 18:07
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.

Can you also remove [WIP] from the title and add [SYCL] instead?

@schittir schittir changed the title [WIP] Add clang implementation for accessor property no_alias Add clang implementation for accessor property no_alias Apr 1, 2021
@schittir schittir changed the title Add clang implementation for accessor property no_alias [SYCL] Add clang implementation for accessor property no_alias Apr 1, 2021
@schittir
Copy link
Contributor Author

schittir commented Apr 3, 2021

I'm not sure why the build bot lit test runs fail. They all pass on my local workspace.

@AaronBallman
Copy link
Contributor

I'm not sure why the build bot lit test runs fail. They all pass on my local workspace.

You should try catching the PR up to upstream. The testing issue may have been resolved elsewhere, or it'll restart CI in case the issues are transient.

schittir and others added 7 commits April 5, 2021 13:23
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
3. replace variable names with string literals
@schittir schittir force-pushed the accessor_no_alias_property branch from 89e735a to c38d9f4 Compare April 5, 2021 20:25
@schittir
Copy link
Contributor Author

schittir commented Apr 6, 2021

I'm not sure why the build bot lit test runs fail. They all pass on my local workspace.

You should try catching the PR up to upstream. The testing issue may have been resolved elsewhere, or it'll restart CI in case the issues are transient.

Caught up PR to upstream and resolved failing tests.

Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

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

Overall LGTM

Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

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

Wait a second. Wasn't no_alias property supposed to generate function parameter attribute, instead of a metadata?

@schittir
Copy link
Contributor Author

schittir commented Apr 7, 2021

Wait a second. Wasn't no_alias property supposed to generate function parameter attribute, instead of a metadata?

Thanks for the catch. Changed it to generate a function parameter attribute instead of metadata.

@schittir schittir requested a review from smanna12 April 7, 2021 01:13
Copy link
Contributor

@MrSidims MrSidims left a comment

Choose a reason for hiding this comment

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

LGTM, but you shall change the description.

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.

LGTM, but please check the pre-commit run-time failure.

@smanna12
Copy link
Contributor

smanna12 commented Apr 7, 2021

LGTM. I looked at the pre-commit failure:

http://icl-jenkins.sc.intel.com:8080/blue/organizations/jenkins/SYCL_CI%2Fintel%2FLin%2FLLVM_Test_Suite/detail/LLVM_Test_Suite/3272/pipeline

Failed Tests (1):
SYCL :: Reduction/reduction_nd_N_vars.cpp

@schittir, you can try restarting jenkins/precommit testing.

@bader
Copy link
Contributor

bader commented Apr 7, 2021

@schittir, you can try restarting jenkins/precommit testing.

This should not be the solution for pre-commit failures. The test must pass w/o re-starts. Please, investigate why the test gives wrong results.
Tagging @v-klochkov for awareness.

@schittir
Copy link
Contributor Author

schittir commented Apr 7, 2021

LGTM, but you shall change the description.

Done.

MrSidims
MrSidims previously approved these changes Apr 7, 2021
@schittir schittir requested a review from premanandrao April 7, 2021 16:39
premanandrao
premanandrao previously approved these changes Apr 7, 2021
smanna12
smanna12 previously approved these changes Apr 7, 2021
Copy link
Contributor

@smanna12 smanna12 left a comment

Choose a reason for hiding this comment

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

LGTM

@bader bader dismissed stale reviews from smanna12 and premanandrao via 067dae8 April 9, 2021 13:22
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!


// check that noalias parameter attribute is NOT emitted when it is not used
// CHECK: define {{.*}}spir_kernel void @_ZTSZ4mainE16kernel_function2{{.*}} !kernel_arg_buffer_location
// CHECK-NOT: define {{.*}}spir_kernel void @_ZTSZ4mainE16kernel_function2({{.*}} noalias {{.*}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Lines 6 and 7 here are broken. The first checks to see if that kernel is defined, and the 2nd just checks to see if it is defined AGAIN. This is not correct. Presumably there needs to be a 'CHECK-NOT'/'CHECK-SAME' combo, like in the example here:
https://llvm.org/docs/CommandGuide/FileCheck.html#the-check-same-directive

Copy link
Contributor

Choose a reason for hiding this comment

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

PR - #4283

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.

9 participants