Skip to content

[SYCL][Clang] Fix annotations applied to integer fields #8198

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

Conversation

Fznamznon
Copy link
Contributor

Due to incorrect conflict resolution between 8e13852 (intel/llvm customization) and https://reviews.llvm.org/D138722 clang started emitting annotations applied to integer class/struct fields incorrectly. Incorrect overload of llvm.ptr.annotation intrinsic was picked up and this resulted in invalid IR emission. This patch restores behavior introduced by 8e13852.
The existing test added for 8e13852 didn't catch the problem since it is modified upstream test CodeGen/annotations-field.c which doesn't test typed pointers.

Due to incorrect conflict resolution between 8e13852 (intel/llvm
customization) and https://reviews.llvm.org/D138722 clang started
emitting annotations applied to integer class/struct fields incorrectly.
Incorrect overload of llvm.ptr.annotation intrinsic was picked up and
this resulted in invalid IR emission. This patch restores behaviour
introduced by 8e13852.
The existing test added for 8e13852 didn't catch the problem since it
is modified upstream test `CodeGen/annotations-field.c` which doesn't
test typed pointers.
@Fznamznon Fznamznon requested a review from a team as a code owner February 3, 2023 14:20
@Fznamznon Fznamznon temporarily deployed to aws February 3, 2023 14:55 — with GitHub Actions Inactive
@Fznamznon Fznamznon temporarily deployed to aws February 3, 2023 15:27 — with GitHub Actions Inactive
@Fznamznon Fznamznon temporarily deployed to aws February 3, 2023 15:59 — with GitHub Actions Inactive
It seems these numbers mean line of code, didn't know about that.
@Fznamznon Fznamznon temporarily deployed to aws February 3, 2023 16:32 — with GitHub Actions Inactive
@Fznamznon
Copy link
Contributor Author

Hip failure is unrelated. The corresponding test is being disabled in intel/llvm-test-suite#1572 .

@Fznamznon Fznamznon temporarily deployed to aws February 3, 2023 17:04 — with GitHub Actions Inactive
struct foo f;
f.v = 1;
// CHECK: getelementptr inbounds %struct.foo, %struct.foo addrspace(4)* %{{.*}}, i32 0, i32 0
// CHECK-NEXT: call i32 addrspace(4)* @llvm.ptr.annotation.p4i32.p1i8({{.*}}str{{.*}}str{{.*}}i32 14, i8 addrspace(1)* null)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this str a variable holding annotation?. Also what does 14 here refer to?

Just curious and for my own learning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, str is a variable with annotation string. 14 seems to be a line of code on which annotation happened.

@Fznamznon
Copy link
Contributor Author

@intel/llvm-gatekeepers , please merge as soon as possible. This is a blocker for the downstream.

@steffenlarsen
Copy link
Contributor

HIP Failed Tests (1):
SYCL :: KernelAndProgram/spec_constants_after_link.cpp
Fixed in intel/llvm-test-suite#1572.

@steffenlarsen steffenlarsen merged commit 56ef705 into intel:sycl Feb 3, 2023
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.

5 participants