[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 09:53:41 PDT 2024


================
@@ -4675,7 +4676,7 @@ bool CompilerInvocation::CreateFromArgsImpl(
   // FIXME: We shouldn't have to pass the DashX option around here
   InputKind DashX = Res.getFrontendOpts().DashX;
   ParseTargetArgs(Res.getTargetOpts(), Args, Diags);
-  llvm::Triple T(Res.getTargetOpts().Triple);
+  llvm::Triple T(llvm::Triple::normalize(Res.getTargetOpts().Triple));
----------------
bharadwajy wrote:

> Looks like part of this change is to normalize `Res.getTargetOpts().Triple` in many places where it is used.
> 
> Would it be possible to arrange it so that this is normalized in one place earlier on, so all users of `getTargetOpts()` can assume that it is normalized already?

I believe the triple accessible using the expression `getTargetOpts().Triple` denotes the target options specified for the compilation. It seems appropriate to leave it unmodified (un-normalized) for reference or other purposes during compilation.  

https://github.com/llvm/llvm-project/pull/90809


More information about the llvm-commits mailing list