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

Run AlignModuleStructsPass earlier. #465

Merged
merged 1 commit into from
May 22, 2024

Conversation

hvdijk
Copy link
Collaborator

@hvdijk hvdijk commented May 22, 2024

Overview

Run AlignModuleStructsPass earlier.

Reason for change

The AlignModuleStructsPass patches up structs according to OpenCL alignment requirements so that they behave the same way on all implementations. We were already calling this, but we were calling it after running a number of upstream LLVM passes, so we were feeding them incorrect input and hoping we could correct that afterwards. A change has gone in on LLVM 19 that performs a valid optimization that we cannot correct afterwards.

Description of change

Make sure we run AlignModuleStructsPass as soon as we know what target we are compiling for.

Anything else we should know?

If there's any other relevant information we should know that may help us in
understanding and verifying your patch, please include it here.

Checklist

  • Read and follow the project Code of Conduct.
  • Make sure the project builds successfully with your changes.
  • Run relevant testing locally to avoid regressions.
  • Run clang-format-17 on all modified code.

The AlignModuleStructsPass patches up structs according to OpenCL
alignment requirements so that they behave the same way on all
implementations. We were already calling this, but we were calling it
after running a number of upstream LLVM passes, so we were feeding them
incorrect input and hoping we could correct that afterwards. A change
has gone in on LLVM 19 that performs a valid optimization that we cannot
correct afterwards, so make sure we run AlignModuleStructsPass as soon
as we know what target we are compiling for.
@hvdijk hvdijk force-pushed the align-module-structs-early branch from 04274d0 to 9f6d9f4 Compare May 22, 2024 11:48
@hvdijk hvdijk merged commit 43c9200 into codeplaysoftware:main May 22, 2024
3 checks passed
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.

None yet

2 participants