-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang][SPIR-V] Fix OpenCL addrspace mapping when using non-zero default AS #137187
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
…ult AS Signed-off-by: Sarnie, Nick <[email protected]>
@llvm/pr-subscribers-clang Author: Nick Sarnie (sarnex) ChangesBased on feedback from #136753, remove the dummy values for OpenCL and make them match the zero default AS map. Full diff: https://github.com/llvm/llvm-project/pull/137187.diff 1 Files Affected:
diff --git a/clang/lib/Basic/Targets/SPIR.h b/clang/lib/Basic/Targets/SPIR.h
index 310ef9f2df2c6..bf249e271a870 100644
--- a/clang/lib/Basic/Targets/SPIR.h
+++ b/clang/lib/Basic/Targets/SPIR.h
@@ -58,15 +58,13 @@ static const unsigned SPIRDefIsPrivMap[] = {
// Used by both the SPIR and SPIR-V targets.
static const unsigned SPIRDefIsGenMap[] = {
4, // Default
- // Some OpenCL address space values for this map are dummy and they can't be
- // used
1, // opencl_global
- 0, // opencl_local
- 0, // opencl_constant
+ 3, // opencl_local
+ 2, // opencl_constant
0, // opencl_private
- 0, // opencl_generic
- 0, // opencl_global_device
- 0, // opencl_global_host
+ 4, // opencl_generic
+ 5, // opencl_global_device
+ 6, // opencl_global_host
// cuda_* address space mapping is intended for HIPSPV (HIP to SPIR-V
// translation). This mapping is enabled when the language mode is HIP.
1, // cuda_device
|
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.
This change is LGTM, but I'm starting to wonder, if those maps (with the only difference in default) can be unified and setAddressSpaceMap
function changed appropriately.
Probably yes, but I'd prefer to leave that to future work, I have enough on my plate :) |
…ult AS (llvm#137187) Based on feedback from llvm#136753, remove the dummy values for OpenCL and make them match the zero default AS map. Signed-off-by: Sarnie, Nick <[email protected]>
…ult AS (llvm#137187) Based on feedback from llvm#136753, remove the dummy values for OpenCL and make them match the zero default AS map. Signed-off-by: Sarnie, Nick <[email protected]>
…ult AS (llvm#137187) Based on feedback from llvm#136753, remove the dummy values for OpenCL and make them match the zero default AS map. Signed-off-by: Sarnie, Nick <[email protected]>
…ult AS (llvm#137187) Based on feedback from llvm#136753, remove the dummy values for OpenCL and make them match the zero default AS map. Signed-off-by: Sarnie, Nick <[email protected]>
…ult AS (llvm#137187) Based on feedback from llvm#136753, remove the dummy values for OpenCL and make them match the zero default AS map. Signed-off-by: Sarnie, Nick <[email protected]>
Hi @sarnex , this change is crucial for the device sanitizers since it addresses a long-standing OMP related issue of us. Please help keep this change. Thanks. |
@yingcong-wu I'm glad this fixes something! I don't think this change was reverted anywhere, so could you let me know what you mean by helping you keep this change? Thanks |
Hi @sarnex , I just want to let you know that this change is important to us, and want to express our gratitude to you in the previous comment. |
Ah ok thank you! I'm surprised this work effects anything as I was mostly doing it for upstream OMP SPV which doesnt' work yet :) |
Based on feedback from #136753, remove the dummy values for OpenCL and make them match the zero default AS map.