-
Notifications
You must be signed in to change notification settings - Fork 738
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-WEB] Fix test failures in address-space-conversions #12843
Conversation
1. Add __attribute__((sycl_device)) to so that the IR won't be empty. 2. Replace CHECK with CHECK-DAG because of the function order 3. Replace dso_local to {{*}} because of linkage 4. Replace declaration of tmpl to empty define tmpl..{}
@mmoadeli Please have a look? It would be great if these changes can be upstream to llorg so that we don't need to resolve the conflict in sycl pulldown. Thanks. |
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.
I don't think you should be changing the CHECKs to CHECK_DAG here. What is causing the ordering to get messed up? Why you need to add attribute((sycl_device)). How did this pass before? What commit caused these tests to start failing?
I agree with @elizabethandrews that simply replacing the checks with check_dag may not resolve the issue. The tests currently succeed upstream, indicating that the problem lies elsewhere. Interestingly, I've been tasked for substituting the check_dags with checks recently. My impression is that a merge of upstream to intel/llvm has shown the issue. |
The attribute((sycl_device)). was there before in sycl branch. It started to fail with @mmoadeli 's commit in https://github.com/llvm/llvm-project/commit//f54004475110bb0a4033261041594266c8296242
Sure, then please have a look to see how we can fix this for sycl. Thanks. |
The view in upstream is different as there is no device filtering yet (IIRC). |
Thanks @Naghasan . This explains the major differences. @mmoadeli Can I leave this to you to figure out proper solution? Thanks. |
Thanks @Naghasan. With that explanation the fix seems fine to me. It also explains why they used CHECK_DAG in first place. |
@jsji, Considering @Naghasan's input, I believe the approach you've taken is right. |
I would expect different ordering of function declarations, but not checks for instructions within functions. Do we still need to apply -DAG there? |
@elizabethandrews What is your opinion? |
The function declaration are after all the instructions now. So we either add |
Another conflict friendly fix is the use some option to control the device filtering. Do we know is there an existing option or env that can do this? SYCL_DEVICE_FILTER/ONEAPI_DEVICE_SELECTOR are runtime env, so won't take effect in compile time here. |
What @Naghasan mean by "device filtering" is source code separation into host and device parts. Upstream compiler does not do this separation yet. The device compiler in llorg compiles all functions as device code. DPC++ has no option to disable "device filtering". |
OK. Thanks @bader . Then I guess we have to use current solution until we upstream the "device filtering" to llorg. |
The explanation makes sense to me. I'm ok with this change. Thanks for explaining! |
@bader Any further comments? If not, I will merge it. |
No other comments. |
Per @Naghasan
The view in upstream is different as there is no device filtering yet (IIRC). sycl_device isn't there yet regardless (hence why it needs to be re-added) and in intel/llvm, nothing is emitted until you reach calls made by sycl_device function, causing the "reordering".