Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions llvm/lib/Target/DirectX/DXILPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ class DXILPrepareModule : public ModulePass {
if (NamedMDNode *RootSignature = M.getNamedMetadata("dx.rootsignatures"))
RootSignature->eraseFromParent();

// llvm.errno.tbaa was recently added but is not supported in LLVM 3.7 and
// causes all tests using the DXIL Validator to fail.
//
// This is a temporary fix and should be replaced with a whitelist once
// we have determined all metadata that the DXIL Validator allows
if (NamedMDNode *ErrNo = M.getNamedMetadata("llvm.errno.tbaa"))
ErrNo->eraseFromParent();

return true;
}

Expand Down
19 changes: 19 additions & 0 deletions llvm/test/CodeGen/DirectX/strip-llvm-errno-tbaa.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; RUN: opt -S -dxil-prepare < %s | FileCheck %s

; Ensures that dxil-prepare will remove the llvm.errno.tbaa metadata

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

define void @main() {
entry:
ret void
}

; CHECK-NOT: !llvm.errno.tbaa
; CHECK-NOT: {{^!}}

!llvm.errno.tbaa = !{!0}

!0 = !{!1, !1, i64 0}
!1 = !{!"omnipotent char", !2}
!2 = !{!"Simple C/C++ TBAA"}
Loading