Skip to content

Commit a4cc5f5

Browse files
committed
rebase: also move the recently added errno fix
1 parent abc954f commit a4cc5f5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

llvm/lib/Target/DirectX/DXILPrepare.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,6 @@ class DXILPrepareModule : public ModulePass {
246246
}
247247
}
248248

249-
// llvm.errno.tbaa was recently added but is not supported in LLVM 3.7 and
250-
// causes all tests using the DXIL Validator to fail.
251-
//
252-
// This is a temporary fix and should be replaced with a whitelist once
253-
// we have determined all metadata that the DXIL Validator allows
254-
if (NamedMDNode *ErrNo = M.getNamedMetadata("llvm.errno.tbaa"))
255-
ErrNo->eraseFromParent();
256-
257249
return true;
258250
}
259251

llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,14 @@ static void translateGlobalMetadata(Module &M, DXILResourceMap &DRM,
431431
// remove it as it is not recognized in DXIL
432432
if (NamedMDNode *RootSignature = M.getNamedMetadata("dx.rootsignatures"))
433433
RootSignature->eraseFromParent();
434+
435+
// llvm.errno.tbaa was recently added but is not supported in LLVM 3.7 and
436+
// causes all tests using the DXIL Validator to fail.
437+
//
438+
// This is a temporary fix and should be replaced with a whitelist once
439+
// we have determined all metadata that the DXIL Validator allows
440+
if (NamedMDNode *ErrNo = M.getNamedMetadata("llvm.errno.tbaa"))
441+
ErrNo->eraseFromParent();
434442
}
435443

436444
PreservedAnalyses DXILTranslateMetadata::run(Module &M,

llvm/test/CodeGen/DirectX/strip-llvm-errno-tbaa.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
; RUN: opt -S -dxil-prepare < %s | FileCheck %s
1+
; RUN: opt -S -dxil-translate < %s | FileCheck %s
22

3-
; Ensures that dxil-prepare will remove the llvm.errno.tbaa metadata
3+
; Ensures that dxil-translate will remove the llvm.errno.tbaa metadata
44

55
target triple = "dxil-unknown-shadermodel6.0-compute"
66

0 commit comments

Comments
 (0)