Skip to content

[SYCL] Handle address space casts in the LowerWGScope #3120

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 6 commits into from
Feb 2, 2021

Conversation

againull
Copy link
Contributor

No description provided.

@DenisBakhvalov
Copy link
Contributor

LGTM, however, please address CI failures.

@bader
Copy link
Contributor

bader commented Jan 29, 2021

LGTM, however, please address CI failures.

@againull, please, check if 2b2ded9 address the CI failure correctly.

@againull
Copy link
Contributor Author

LGTM, however, please address CI failures.

@againull, please, check if 2b2ded9 address the CI failure correctly.

Thanks, this commit is fixing the fail.

@@ -0,0 +1,83 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -LowerWGScope -S | FileCheck %s

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment what this test checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment.

; CHECK-NEXT: [[TMP5:%.*]] = addrspacecast %struct.bar* [[ARG1]] to [[STRUCT_BAR:%.*]] addrspace(4)*
; CHECK-NEXT: [[TMP6:%.*]] = addrspacecast [[STRUCT_SPAM]] addrspace(4)* [[TMP4]] to %struct.spam*
; CHECK-NEXT: call spir_func void @widget(%struct.bar addrspace(4)* dereferenceable_or_null(32) [[TMP5]], %struct.spam* byval(%struct.spam) align 8 [[TMP6]])
; CHECK-NEXT: ret void
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:
Can the number of checks be reduced to addrspace cast dependence chain only?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to validate all the code generated by the pass to ensure correctness.
These checks should be easy to maintain as they are auto-generated (see the note at line 1).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with Alexey here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to validate all the code generated by the pass to ensure correctness.

I think regression tests are written for particular fixes and should be focused on testing the fix, not entire pass/feature, as there should exist other tests. But anyway, that was a nit, so either way is fine with me.
The script for automated maintenance is a good argument too.

@bader
Copy link
Contributor

bader commented Jan 30, 2021

LGTM, however, please address CI failures.

@againull, please, check if 2b2ded9 address the CI failure correctly.

Thanks, this commit is fixing the fail.

I know, but I'd like you confirm that the fix is correct. :)

UPDATE: I just noticed that checks in the test are auto-generated, so the right way to fix it is to run the script again. I made my changes manually.

Comment on lines 636 to 637
auto *Cast = dyn_cast<AddrSpaceCastInst>(LambdaObj);
if (Cast)
Copy link
Contributor

Choose a reason for hiding this comment

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

From https://github.com/intel/llvm/pull/2864/files#r567811589:
Combine into if (auto *Cast = dyn_cast<AddrSpaceCastInst>(LambdaObj))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@againull
Copy link
Contributor Author

againull commented Feb 2, 2021

LGTM, however, please address CI failures.

@againull, please, check if 2b2ded9 address the CI failure correctly.

Thanks, this commit is fixing the fail.

I know, but I'd like you confirm that the fix is correct. :)

UPDATE: I just noticed that checks in the test are auto-generated, so the right way to fix it is to run the script again. I made my changes manually.

Thanks, fixed.

; CHECK-NEXT: [[TMP5:%.*]] = addrspacecast %struct.bar* [[ARG1]] to [[STRUCT_BAR:%.*]] addrspace(4)*
; CHECK-NEXT: [[TMP6:%.*]] = addrspacecast [[STRUCT_SPAM]] addrspace(4)* [[TMP4]] to %struct.spam*
; CHECK-NEXT: call spir_func void @widget(%struct.bar addrspace(4)* dereferenceable_or_null(32) [[TMP5]], %struct.spam* byval(%struct.spam) align 8 [[TMP6]])
; CHECK-NEXT: ret void
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to validate all the code generated by the pass to ensure correctness.

I think regression tests are written for particular fixes and should be focused on testing the fix, not entire pass/feature, as there should exist other tests. But anyway, that was a nit, so either way is fine with me.
The script for automated maintenance is a good argument too.

@againull againull merged commit e37882e into intel:sycl Feb 2, 2021
@againull againull deleted the handle_addrspacecasts branch December 3, 2022 00:06
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.

4 participants