-
Notifications
You must be signed in to change notification settings - Fork 769
[ESIMD] Don't add inline hints when compiling for -O0 #3422
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 guess this is not the first time I questioning overall design here: why can't we do the same transformation + launch alwaysinline pass within GPU vector backend?
It seems a bit strange to me that in target-independent tool like
sycl-post-link
we have quite a lot of workarounds specifically for GPU vector compute backend.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 believe that is the limitation of the GPU backend. @kbobrovs , can you please comment?
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 understand that this is a limitation, I just don't understand why device-specific backend can't apply device-specific lowering to its input so it is canonicalized before performing actual work on it?
Again, I understand that technically our interface is just a SPIR-V and we haven't documented any particular optimization level which is expected by the backend, but I would expect that such things as inlining (for example) should be simple enough to be implemented in device-specific backend if it is strictly needed in there. I would be complaining less if this were a requirement for more than one backend, i.e. it would be more generic.
Clarification: I'm not trying to block this particular PR, I'm just not so happy with the approach of putting things which are unique to a particular backend into this more or less generic tool. Just trying to see if there is something we can do about that
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.
@AlexeySachkov, yes you are right. The ideal is to have ESIMD BE do all necessary preparation, including recognition of some/all of the ESIMD/SPIRV intrinsics. This has been brought up few times before. But look at this from a different perspective: we have an external BE, which is not part of the LLVM Code Gen infrastructure, and we still want to use it given the interface it provides. Luckily, the BE is not quite external, so the plan is to gradually move ESIMD-dependent parts into the BE mid/long-term, and the extra LLVM IR passes should be the first candidate.
tagging @kvladimi
Strictly speaking, these particular changes are not sycl-post-link tools changes (which serves just as an LTO driver here) and are isolated in the LowerESIMD pass. But the point you raised is valid anyway. BTW, we plan to move LowerESIMD back to BackendUtils.cpp, as having it in LTO broke few things.