-
Notifications
You must be signed in to change notification settings - Fork 761
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
Conversation
178f9e7
to
e3dbe8b
Compare
There was a problem hiding this 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?
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. |
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
89e735a
to
c38d9f4
Compare
Caught up PR to upstream and resolved failing tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM
There was a problem hiding this 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?
Thanks for the catch. Changed it to generate a function parameter attribute instead of metadata. |
There was a problem hiding this 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.
There was a problem hiding this 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.
LGTM. I looked at the pre-commit failure: Failed Tests (1): @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. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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 {{.*}} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR - #4283
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.