aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorS. Bharadwaj Yadavalli <Bharadwaj.Yadavalli@microsoft.com>2024-05-06 18:33:57 -0400
committerGitHub <noreply@github.com>2024-05-06 18:33:57 -0400
commit080978dd2067d0c9ea7e229aa7696c2480d89ef1 (patch)
treefd0b31724495febade372d0eb56ccfa3dbf6bb4c /llvm/lib/IR/Verifier.cpp
parent89e0557e48155d7eaab2a25426f6dfc9493f2474 (diff)
downloadllvm-080978dd2067d0c9ea7e229aa7696c2480d89ef1.zip
llvm-080978dd2067d0c9ea7e229aa7696c2480d89ef1.tar.gz
llvm-080978dd2067d0c9ea7e229aa7696c2480d89ef1.tar.bz2
[DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (#90809)
An earlier commit provided a way to decouple DXIL version from Shader Model version by representing the DXIL version as `SubArch` in the DXIL Target Triple and adding corresponding valid DXIL Arch types. This change constructs DXIL target triple with DXIL version that is deduced from Shader Model version specified in the following scenarios: 1. When compilation target profile is specified: For e.g., DXIL target triple `dxilv1.8-unknown-shader6.8-library` is constructed when `-T lib_6_8` is specified. 2. When DXIL target triple without DXIL version is specified: For e.g., DXIL target triple `dxilv1.8-pc-shadermodel6.8-library` is constructed when `-mtriple=dxil-pc-shadermodel6.8-library` is specified. Updated relevant HLSL tests that check for target triple. Validated that Clang (`check-clang`) and LLVM (`check-llvm`) regression tests pass.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 41d3fce..a463e67 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -152,8 +152,8 @@ struct VerifierSupport {
bool TreatBrokenDebugInfoAsError = true;
explicit VerifierSupport(raw_ostream *OS, const Module &M)
- : OS(OS), M(M), MST(&M), TT(M.getTargetTriple()), DL(M.getDataLayout()),
- Context(M.getContext()) {}
+ : OS(OS), M(M), MST(&M), TT(Triple::normalize(M.getTargetTriple())),
+ DL(M.getDataLayout()), Context(M.getContext()) {}
private:
void Write(const Module *M) {