-
Notifications
You must be signed in to change notification settings - Fork 801
[SYCL] Turn off part of SimplifyCFG optimizations in SYCL mode. #5283
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
Conversation
|
/summary:run |
|
@maksimsab Why is this change marked as [NFC]? |
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 wonder, would it be better to simply add a "complete switch off" option to the pass itself? Something similar to what is done in #5149?
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 thought about that. It seemed for me that compiler should behave as usual in case when sycl isn't involved (when -fsycl option is not present).
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.
It seemed for me that compiler should behave as usual in case when sycl isn't involved (when -fsycl option is not present).
So the idea is to have that new switch off by default, i.e. by default the pass is working as-is. Under SYCL mode we will turn it on. Anyway, it seems to me that we can minimize amount of changes by simply disabling hoisting common instructions which is only done once (see my other comment)
I guess technically, it is supposed to be a non-functional change, because optimizations must not alter the functionality. But the tag on this PR still makes me a bit nervous :) |
8d2a9e7 to
3b13d88
Compare
I prefer a lacking |
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.
Alexey, thanks for creating this new patch. This patch has a better trade-off than previous one. Is it feasible to disable SimplifyCFG for “common call instructions” for SYCL? If it will take a long time to do so. I am ok for you to get your current patch merged first.
It should be feasible to disable host/sink of "convergent" instructions. I think it's not as simple as config pass update, but we can investigate this option. @maksimsab, please fix linter complains to unblock further pre-commit testing. |
3b13d88 to
80b1377
Compare
|
@maksimsab, #5305 has been merged. Please, update your branch. |
|
/summary:run |
Usually clang with SimplifyCFG pass optimizes constructs like:
into one simple
func()invocation.This behaviour might be wrong in cases when func's behaviour depends on
a place where it is written. For this cases we turn off part of optimizations of SimplifyCFG pass.
There is a relevant discussion about introducing a reliable tool for such cases: https://reviews.llvm.org/D85603