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

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 15:20:59 PDT 2024


================
@@ -744,7 +744,7 @@ void codegen::setFunctionAttributes(StringRef CPU, StringRef Features,
 Expected<std::unique_ptr<TargetMachine>>
 codegen::createTargetMachineForTriple(StringRef TargetTriple,
                                       CodeGenOptLevel OptLevel) {
-  Triple TheTriple(TargetTriple);
+  Triple TheTriple(llvm::Triple::normalize(TargetTriple.str()));
----------------
bogner wrote:

It's a bit of a grey area because this function is only really used by testing tools but I don't think we should normalize here. If someone is running llvm-reduce or one of the fuzzers on a module with an invalid triple they may well be doing that intentionally.

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


More information about the cfe-commits mailing list