-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang][SPIR-V] Set AS for the SPIR-V logical triple #88939
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
This was missed in llvm#88455, causing most of the .hlsl to SPIR-V tests to fail (such as clang\test\Driver\hlsl-lang-targets-spirv.hlsl)
@llvm/pr-subscribers-clang Author: Justin Bogner (bogner) ChangesThis was missed in #88455, causing most of the .hlsl to SPIR-V tests to fail (such as clang\test\Driver\hlsl-lang-targets-spirv.hlsl) Full diff: https://github.com/llvm/llvm-project/pull/88939.diff 1 Files Affected:
diff --git a/clang/lib/Basic/Targets/SPIR.h b/clang/lib/Basic/Targets/SPIR.h
index 9a4a8b501460b6..44265445ff004b 100644
--- a/clang/lib/Basic/Targets/SPIR.h
+++ b/clang/lib/Basic/Targets/SPIR.h
@@ -315,7 +315,7 @@ class LLVM_LIBRARY_VISIBILITY SPIRVTargetInfo : public BaseSPIRVTargetInfo {
// SPIR-V IDs are represented with a single 32-bit word.
SizeType = TargetInfo::UnsignedInt;
resetDataLayout("e-i64:64-v16:16-v24:32-v32:32-v48:64-"
- "v96:128-v192:256-v256:256-v512:512-v1024:1024");
+ "v96:128-v192:256-v256:256-v512:512-v1024:1024-G1");
}
void getTargetDefines(const LangOptions &Opts,
|
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.
Thanks!
a) Thanks!; b) apologies for the noise; c) this was actually done on purpose, I actively eschewed changing Logical SPIRV because it wasn't actually clear to me if in the long run it'd have the same AS map / would use numerical 1 for globals. If Logical SPIRV is going to go with numerical 1 for globals, LGTM (perhaps it's worth reflecting that in AutoUpgrade.cpp & associated tests, wherein the predicate guards autoupgrades from occuring on Logical SPIRV)! As a sidenote, as far as I can tell, this flared up because in LLVM's SPIRV TargetMachine there's no segregation between Logical & Physical SPIRV. Would it be worthwhile to add 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.
LGTM, please have a peek at the comment if possible.
@Keenuts Do you have thoughts here? I'm not sure there's been much discussion around this. I'm going to go ahead and push this as is to get the tests passing and we should follow up as necessary. |
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.
Looks good
Thanks all! |
This was missed in #88455, causing most of the .hlsl to SPIR-V tests to fail (such as clang\test\Driver\hlsl-lang-targets-spirv.hlsl)