Open
Conversation
rjodinchr
reviewed
May 27, 2024
8e3a917 to
3e2bbd6
Compare
rjodinchr
reviewed
May 28, 2024
Comment on lines
574
to
578
|
|
||
| pm.addPass(clspv::ReplaceLLVMIntrinsicsPass()); | ||
|
|
||
| if (clspv::Option::LanguageUsesGenericAddressSpace()) { |
Collaborator
There was a problem hiding this comment.
Why did you put this addPass outside of the if statement?
If we really want it outside, maybe put it before the comment, and add comment before it?
Contributor
Author
There was a problem hiding this comment.
I added it outside because it helps in general, and I thought it's somewhat a big change for it to just change due to generic address space.
I moved it more to the top of the pipeline with a comment
Collaborator
There was a problem hiding this comment.
Could you provide a test showing how it helps in general, it's not clear to me looking at the modified tests. test/LLVMIntrinsics/memcpy_from_constant.cl even tends to say that it is not helping.
3e2bbd6 to
918bbe6
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The LowerAddrSpaceCast pass obfuscates all intrinsics calls, so the rest of the llvm pipeline doesn't recognize them.
Additionally, lowering early might mean that the subsituted code has a chance of getting optimized more aggressively.
The tests fallout is:
test/CPlusPlus/issue-357.cl
The old testCopyInstance2 is now optimized out (it was copying uninitialized memory). The test now initializes the data before the copy.
test/LLVMIntrinsics/descend_into_array.cl
The PR results in some instructions being re-ordered.
test/LLVMIntrinsics/memcpy_from_constant.cl
This seems to be a minor regression.
Instead of:
the llvm ir before the producer is:
This seems to be due to the
HideConstantLoadsPass/UnhideConstantLoadsPass. Maybe it's too disruptive for the issue it was trying to fix? (#71)I will open an issue for this regression.
This closes #1350 and #1355