[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)
S. Bharadwaj Yadavalli via cfe-commits
cfe-commits at lists.llvm.org
Mon May 6 13:17:31 PDT 2024
================
@@ -115,6 +115,30 @@ StringRef Triple::getArchName(ArchType Kind, SubArchType SubArch) {
if (SubArch == AArch64SubArch_arm64e)
return "arm64e";
break;
+ case Triple::dxil:
+ switch (SubArch) {
+ case Triple::NoSubArch:
+ case Triple::DXILSubArch_v1_0:
+ return "dxilv1.0";
+ case Triple::DXILSubArch_v1_1:
+ return "dxilv1.1";
+ case Triple::DXILSubArch_v1_2:
+ return "dxilv1.2";
+ case Triple::DXILSubArch_v1_3:
+ return "dxilv1.3";
+ case Triple::DXILSubArch_v1_4:
+ return "dxilv1.4";
+ case Triple::DXILSubArch_v1_5:
+ return "dxilv1.5";
+ case Triple::DXILSubArch_v1_6:
+ return "dxilv1.6";
+ case Triple::DXILSubArch_v1_7:
+ return "dxilv1.7";
+ case Triple::DXILSubArch_v1_8:
+ return "dxilv1.8";
+ default:
+ return "";
----------------
bharadwajy wrote:
> I would argue that returning an empty string here is just as inconsistent as erroring out/crashing. We should probably just do (2) even though it's obviously ridiculous, since for other architectures if you provide an invalid subarch they are indeed just as ridiculous.
OK. Pushed a change that uses option (2).
https://github.com/llvm/llvm-project/pull/90809
More information about the cfe-commits
mailing list