================ @@ -1200,6 +1224,27 @@ std::string Triple::normalize(StringRef Str) { } } + // Normalize DXIL triple if it does not include DXIL version number. + // Determine DXIL version number using the minor version number of Shader + // Model version specified in target triple, if any. Prior to decoupling DXIL + // version numbering from that of Shader Model DXIL version 1.Y corresponds to + // SM 6.Y. E.g., dxilv1.Y-unknown-shadermodelX.Y-hull + if (Components[0] == "dxil") { + std::string DXILVerStr{"dxilv1."}; + if (Components.size() > 2) { + // OS component specified + if (Components[2].starts_with("shadermodel6.")) { + Components[0] = DXILVerStr.append( + Components[2].drop_front(strlen("shadermodel6."))); + } else if (Components[2].starts_with("shadermodel")) { + // If shader model specified is other than 6.x, set DXIL Version to 1.0 + Components[0] = DXILVerStr.append("0"); + } + } ---------------- bogner wrote:
This doesn't look right. We've already parsed `Arch` and `OS` above, so I would expect this logic to look something like: ```c++ if (Arch == Triple::DXIL && SubArch == Triple::NoSubArch) { VersionTuple Ver = OS != Triple::UnknownOS ? parseVersionFromName(Components[2]) : VersionTuple(); if (Ver) Components[0] = Components[0].append("1.").append(Ver.Minor); else (Ver) // default case... } ``` https://github.com/llvm/llvm-project/pull/90809 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits