[NFC][DirectX] Refactor DXILPrepare/DXILTranslateMetadata (#164285)
This pr updates `DXILPrepare` and `DXILTranslateMetadata` by moving all the removal of metadata from `DXILPrepare` to `DXILTranslateMetadata` to have a more consistent definition of what each pass is doing. It restricts the `DXILPrepare` to only update function attributes and insert bitcasts, and moves the removal of metadata to `DXILTranslateMetadata` so that all manipulation of metadata is done in a single pass.
This commit is contained in:
parent
0b01b96864
commit
0fd330dfe3
@ -118,9 +118,10 @@ The passes to generate DXIL IR follow the flow:
|
||||
Each of these passes has a defined responsibility:
|
||||
|
||||
#. DXILOpLowering translates LLVM intrinsic calls to dx.op calls.
|
||||
#. DXILPrepare transforms the DXIL IR to be compatible with LLVM 3.7, and
|
||||
inserts bitcasts to allow typed pointers to be inserted.
|
||||
#. DXILTranslateMetadata emits the DXIL Metadata structures.
|
||||
#. DXILPrepare updates functions in the DXIL IR to be compatible with LLVM 3.7,
|
||||
namely removing attributes, and inserting bitcasts to allow typed pointers
|
||||
to be inserted.
|
||||
#. DXILTranslateMetadata transforms and emits all recognized DXIL Metadata.
|
||||
|
||||
The passes to encode DXIL to binary in the DX Container follow the flow:
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
///
|
||||
/// \file This file contains pases and utilities to convert a modern LLVM
|
||||
/// \file This file contains passes and utilities to convert a modern LLVM
|
||||
/// module into a module compatible with the LLVM 3.7-based DirectX Intermediate
|
||||
/// Language (DXIL).
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -16,7 +16,6 @@
|
||||
#include "DirectX.h"
|
||||
#include "DirectXIRPasses/PointerTypeAnalysis.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/StringSet.h"
|
||||
#include "llvm/Analysis/DXILMetadataAnalysis.h"
|
||||
#include "llvm/Analysis/DXILResource.h"
|
||||
@ -27,7 +26,6 @@
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/InitializePasses.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Support/VersionTuple.h"
|
||||
|
||||
#define DEBUG_TYPE "dxil-prepare"
|
||||
@ -116,31 +114,6 @@ static void removeStringFunctionAttributes(Function &F,
|
||||
F.removeRetAttrs(DeadAttrs);
|
||||
}
|
||||
|
||||
static void cleanModuleFlags(Module &M) {
|
||||
NamedMDNode *MDFlags = M.getModuleFlagsMetadata();
|
||||
if (!MDFlags)
|
||||
return;
|
||||
|
||||
SmallVector<llvm::Module::ModuleFlagEntry> FlagEntries;
|
||||
M.getModuleFlagsMetadata(FlagEntries);
|
||||
bool Updated = false;
|
||||
for (auto &Flag : FlagEntries) {
|
||||
// llvm 3.7 only supports behavior up to AppendUnique.
|
||||
if (Flag.Behavior <= Module::ModFlagBehavior::AppendUnique)
|
||||
continue;
|
||||
Flag.Behavior = Module::ModFlagBehavior::Warning;
|
||||
Updated = true;
|
||||
}
|
||||
|
||||
if (!Updated)
|
||||
return;
|
||||
|
||||
MDFlags->eraseFromParent();
|
||||
|
||||
for (auto &Flag : FlagEntries)
|
||||
M.addModuleFlag(Flag.Behavior, Flag.Key->getString(), Flag.Val);
|
||||
}
|
||||
|
||||
class DXILPrepareModule : public ModulePass {
|
||||
|
||||
static Value *maybeGenerateBitcast(IRBuilder<> &Builder,
|
||||
@ -202,15 +175,6 @@ class DXILPrepareModule : public ModulePass {
|
||||
Builder.getPtrTy(PtrTy->getAddressSpace())));
|
||||
}
|
||||
|
||||
static std::array<unsigned, 6> getCompatibleInstructionMDs(llvm::Module &M) {
|
||||
return {M.getMDKindID("dx.nonuniform"),
|
||||
M.getMDKindID("dx.controlflow.hints"),
|
||||
M.getMDKindID("dx.precise"),
|
||||
llvm::LLVMContext::MD_range,
|
||||
llvm::LLVMContext::MD_alias_scope,
|
||||
llvm::LLVMContext::MD_noalias};
|
||||
}
|
||||
|
||||
public:
|
||||
bool runOnModule(Module &M) override {
|
||||
PointerTypeMap PointerTypes = PointerTypeAnalysis::run(M);
|
||||
@ -224,10 +188,7 @@ public:
|
||||
const dxil::ModuleMetadataInfo MetadataInfo =
|
||||
getAnalysis<DXILMetadataAnalysisWrapperPass>().getModuleMetadata();
|
||||
VersionTuple ValVer = MetadataInfo.ValidatorVersion;
|
||||
bool SkipValidation = ValVer.getMajor() == 0 && ValVer.getMinor() == 0;
|
||||
|
||||
// construct allowlist of valid metadata node kinds
|
||||
std::array<unsigned, 6> DXILCompatibleMDs = getCompatibleInstructionMDs(M);
|
||||
bool AllowExperimental = ValVer.getMajor() == 0 && ValVer.getMinor() == 0;
|
||||
|
||||
for (auto &F : M.functions()) {
|
||||
F.removeFnAttrs(AttrMask);
|
||||
@ -235,7 +196,7 @@ public:
|
||||
// Only remove string attributes if we are not skipping validation.
|
||||
// This will reserve the experimental attributes when validation version
|
||||
// is 0.0 for experiment mode.
|
||||
removeStringFunctionAttributes(F, SkipValidation);
|
||||
removeStringFunctionAttributes(F, AllowExperimental);
|
||||
for (size_t Idx = 0, End = F.arg_size(); Idx < End; ++Idx)
|
||||
F.removeParamAttrs(Idx, AttrMask);
|
||||
|
||||
@ -243,11 +204,17 @@ public:
|
||||
IRBuilder<> Builder(&BB);
|
||||
for (auto &I : make_early_inc_range(BB)) {
|
||||
|
||||
I.dropUnknownNonDebugMetadata(DXILCompatibleMDs);
|
||||
if (auto *CB = dyn_cast<CallBase>(&I)) {
|
||||
CB->removeFnAttrs(AttrMask);
|
||||
CB->removeRetAttrs(AttrMask);
|
||||
for (size_t Idx = 0, End = CB->arg_size(); Idx < End; ++Idx)
|
||||
CB->removeParamAttrs(Idx, AttrMask);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Emtting NoOp bitcast instructions allows the ValueEnumerator to be
|
||||
// unmodified as it reserves instruction IDs during contruction.
|
||||
if (auto LI = dyn_cast<LoadInst>(&I)) {
|
||||
if (auto *LI = dyn_cast<LoadInst>(&I)) {
|
||||
if (Value *NoOpBitcast = maybeGenerateBitcast(
|
||||
Builder, PointerTypes, I, LI->getPointerOperand(),
|
||||
LI->getType())) {
|
||||
@ -257,7 +224,7 @@ public:
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (auto SI = dyn_cast<StoreInst>(&I)) {
|
||||
if (auto *SI = dyn_cast<StoreInst>(&I)) {
|
||||
if (Value *NoOpBitcast = maybeGenerateBitcast(
|
||||
Builder, PointerTypes, I, SI->getPointerOperand(),
|
||||
SI->getValueOperand()->getType())) {
|
||||
@ -268,39 +235,16 @@ public:
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (auto GEP = dyn_cast<GetElementPtrInst>(&I)) {
|
||||
if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) {
|
||||
if (Value *NoOpBitcast = maybeGenerateBitcast(
|
||||
Builder, PointerTypes, I, GEP->getPointerOperand(),
|
||||
GEP->getSourceElementType()))
|
||||
GEP->setOperand(0, NoOpBitcast);
|
||||
continue;
|
||||
}
|
||||
if (auto *CB = dyn_cast<CallBase>(&I)) {
|
||||
CB->removeFnAttrs(AttrMask);
|
||||
CB->removeRetAttrs(AttrMask);
|
||||
for (size_t Idx = 0, End = CB->arg_size(); Idx < End; ++Idx)
|
||||
CB->removeParamAttrs(Idx, AttrMask);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove flags not for DXIL.
|
||||
cleanModuleFlags(M);
|
||||
|
||||
// dx.rootsignatures will have been parsed from its metadata form as its
|
||||
// binary form as part of the RootSignatureAnalysisWrapper, so safely
|
||||
// remove it as it is not recognized in DXIL
|
||||
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;
|
||||
}
|
||||
@ -308,11 +252,11 @@ public:
|
||||
DXILPrepareModule() : ModulePass(ID) {}
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const override {
|
||||
AU.addRequired<DXILMetadataAnalysisWrapperPass>();
|
||||
AU.addRequired<RootSignatureAnalysisWrapper>();
|
||||
AU.addPreserved<RootSignatureAnalysisWrapper>();
|
||||
AU.addPreserved<ShaderFlagsAnalysisWrapper>();
|
||||
|
||||
AU.addPreserved<DXILMetadataAnalysisWrapperPass>();
|
||||
AU.addPreserved<DXILResourceWrapperPass>();
|
||||
AU.addPreserved<RootSignatureAnalysisWrapper>();
|
||||
AU.addPreserved<ShaderFlagsAnalysisWrapper>();
|
||||
}
|
||||
static char ID; // Pass identification.
|
||||
};
|
||||
@ -323,7 +267,6 @@ char DXILPrepareModule::ID = 0;
|
||||
INITIALIZE_PASS_BEGIN(DXILPrepareModule, DEBUG_TYPE, "DXIL Prepare Module",
|
||||
false, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(DXILMetadataAnalysisWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(RootSignatureAnalysisWrapper)
|
||||
INITIALIZE_PASS_END(DXILPrepareModule, DEBUG_TYPE, "DXIL Prepare Module", false,
|
||||
false)
|
||||
|
||||
|
||||
@ -7,8 +7,10 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "DXILTranslateMetadata.h"
|
||||
#include "DXILRootSignature.h"
|
||||
#include "DXILShaderFlags.h"
|
||||
#include "DirectX.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Analysis/DXILMetadataAnalysis.h"
|
||||
@ -204,9 +206,9 @@ getEntryPropAsMetadata(const EntryProperties &EP, uint64_t EntryShaderFlags,
|
||||
return MDNode::get(Ctx, MDVals);
|
||||
}
|
||||
|
||||
MDTuple *constructEntryMetadata(const Function *EntryFn, MDTuple *Signatures,
|
||||
MDNode *Resources, MDTuple *Properties,
|
||||
LLVMContext &Ctx) {
|
||||
static MDTuple *constructEntryMetadata(const Function *EntryFn,
|
||||
MDTuple *Signatures, MDNode *Resources,
|
||||
MDTuple *Properties, LLVMContext &Ctx) {
|
||||
// Each entry point metadata record specifies:
|
||||
// * reference to the entry point function global symbol
|
||||
// * unmangled name
|
||||
@ -290,42 +292,82 @@ static MDTuple *emitTopLevelLibraryNode(Module &M, MDNode *RMD,
|
||||
return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
|
||||
}
|
||||
|
||||
// TODO: We might need to refactor this to be more generic,
|
||||
// in case we need more metadata to be replaced.
|
||||
static void translateBranchMetadata(Module &M) {
|
||||
static void translateBranchMetadata(Module &M, Instruction *BBTerminatorInst) {
|
||||
MDNode *HlslControlFlowMD =
|
||||
BBTerminatorInst->getMetadata("hlsl.controlflow.hint");
|
||||
|
||||
if (!HlslControlFlowMD)
|
||||
return;
|
||||
|
||||
assert(HlslControlFlowMD->getNumOperands() == 2 &&
|
||||
"invalid operands for hlsl.controlflow.hint");
|
||||
|
||||
MDBuilder MDHelper(M.getContext());
|
||||
|
||||
llvm::Metadata *HintsStr = MDHelper.createString("dx.controlflow.hints");
|
||||
llvm::Metadata *HintsValue = MDHelper.createConstant(
|
||||
mdconst::extract<ConstantInt>(HlslControlFlowMD->getOperand(1)));
|
||||
|
||||
MDNode *MDNode = llvm::MDNode::get(M.getContext(), {HintsStr, HintsValue});
|
||||
|
||||
BBTerminatorInst->setMetadata("dx.controlflow.hints", MDNode);
|
||||
BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
|
||||
}
|
||||
|
||||
static std::array<unsigned, 6> getCompatibleInstructionMDs(llvm::Module &M) {
|
||||
return {
|
||||
M.getMDKindID("dx.nonuniform"), M.getMDKindID("dx.controlflow.hints"),
|
||||
M.getMDKindID("dx.precise"), llvm::LLVMContext::MD_range,
|
||||
llvm::LLVMContext::MD_alias_scope, llvm::LLVMContext::MD_noalias};
|
||||
}
|
||||
|
||||
static void translateInstructionMetadata(Module &M) {
|
||||
// construct allowlist of valid metadata node kinds
|
||||
std::array<unsigned, 6> DXILCompatibleMDs = getCompatibleInstructionMDs(M);
|
||||
|
||||
for (Function &F : M) {
|
||||
for (BasicBlock &BB : F) {
|
||||
Instruction *BBTerminatorInst = BB.getTerminator();
|
||||
// This needs to be done first so that "hlsl.controlflow.hints" isn't
|
||||
// removed in the whitelist below
|
||||
if (auto *I = BB.getTerminator())
|
||||
translateBranchMetadata(M, I);
|
||||
|
||||
MDNode *HlslControlFlowMD =
|
||||
BBTerminatorInst->getMetadata("hlsl.controlflow.hint");
|
||||
|
||||
if (!HlslControlFlowMD)
|
||||
continue;
|
||||
|
||||
assert(HlslControlFlowMD->getNumOperands() == 2 &&
|
||||
"invalid operands for hlsl.controlflow.hint");
|
||||
|
||||
MDBuilder MDHelper(M.getContext());
|
||||
ConstantInt *Op1 =
|
||||
mdconst::extract<ConstantInt>(HlslControlFlowMD->getOperand(1));
|
||||
|
||||
SmallVector<llvm::Metadata *, 2> Vals(
|
||||
ArrayRef<Metadata *>{MDHelper.createString("dx.controlflow.hints"),
|
||||
MDHelper.createConstant(Op1)});
|
||||
|
||||
MDNode *MDNode = llvm::MDNode::get(M.getContext(), Vals);
|
||||
|
||||
BBTerminatorInst->setMetadata("dx.controlflow.hints", MDNode);
|
||||
BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
|
||||
for (auto &I : make_early_inc_range(BB)) {
|
||||
I.dropUnknownNonDebugMetadata(DXILCompatibleMDs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void translateMetadata(Module &M, DXILResourceMap &DRM,
|
||||
DXILResourceTypeMap &DRTM,
|
||||
const ModuleShaderFlags &ShaderFlags,
|
||||
const ModuleMetadataInfo &MMDI) {
|
||||
static void cleanModuleFlags(Module &M) {
|
||||
NamedMDNode *MDFlags = M.getModuleFlagsMetadata();
|
||||
if (!MDFlags)
|
||||
return;
|
||||
|
||||
SmallVector<llvm::Module::ModuleFlagEntry> FlagEntries;
|
||||
M.getModuleFlagsMetadata(FlagEntries);
|
||||
bool Updated = false;
|
||||
for (auto &Flag : FlagEntries) {
|
||||
// llvm 3.7 only supports behavior up to AppendUnique.
|
||||
if (Flag.Behavior <= Module::ModFlagBehavior::AppendUnique)
|
||||
continue;
|
||||
Flag.Behavior = Module::ModFlagBehavior::Warning;
|
||||
Updated = true;
|
||||
}
|
||||
|
||||
if (!Updated)
|
||||
return;
|
||||
|
||||
MDFlags->eraseFromParent();
|
||||
|
||||
for (auto &Flag : FlagEntries)
|
||||
M.addModuleFlag(Flag.Behavior, Flag.Key->getString(), Flag.Val);
|
||||
}
|
||||
|
||||
static void translateGlobalMetadata(Module &M, DXILResourceMap &DRM,
|
||||
DXILResourceTypeMap &DRTM,
|
||||
const ModuleShaderFlags &ShaderFlags,
|
||||
const ModuleMetadataInfo &MMDI) {
|
||||
LLVMContext &Ctx = M.getContext();
|
||||
IRBuilder<> IRB(Ctx);
|
||||
SmallVector<MDNode *> EntryFnMDNodes;
|
||||
@ -381,6 +423,22 @@ static void translateMetadata(Module &M, DXILResourceMap &DRM,
|
||||
M.getOrInsertNamedMetadata("dx.entryPoints");
|
||||
for (auto *Entry : EntryFnMDNodes)
|
||||
EntryPointsNamedMD->addOperand(Entry);
|
||||
|
||||
cleanModuleFlags(M);
|
||||
|
||||
// dx.rootsignatures will have been parsed from its metadata form as its
|
||||
// binary form as part of the RootSignatureAnalysisWrapper, so safely
|
||||
// remove it as it is not recognized in DXIL
|
||||
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 allowlist once
|
||||
// we have determined all metadata that the DXIL Validator allows
|
||||
if (NamedMDNode *ErrNo = M.getNamedMetadata("llvm.errno.tbaa"))
|
||||
ErrNo->eraseFromParent();
|
||||
}
|
||||
|
||||
PreservedAnalyses DXILTranslateMetadata::run(Module &M,
|
||||
@ -390,8 +448,8 @@ PreservedAnalyses DXILTranslateMetadata::run(Module &M,
|
||||
const ModuleShaderFlags &ShaderFlags = MAM.getResult<ShaderFlagsAnalysis>(M);
|
||||
const dxil::ModuleMetadataInfo MMDI = MAM.getResult<DXILMetadataAnalysis>(M);
|
||||
|
||||
translateMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
|
||||
translateBranchMetadata(M);
|
||||
translateGlobalMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
|
||||
translateInstructionMetadata(M);
|
||||
|
||||
return PreservedAnalyses::all();
|
||||
}
|
||||
@ -409,10 +467,13 @@ public:
|
||||
AU.addRequired<DXILResourceWrapperPass>();
|
||||
AU.addRequired<ShaderFlagsAnalysisWrapper>();
|
||||
AU.addRequired<DXILMetadataAnalysisWrapperPass>();
|
||||
AU.addPreserved<DXILResourceWrapperPass>();
|
||||
AU.addRequired<RootSignatureAnalysisWrapper>();
|
||||
|
||||
AU.addPreserved<DXILMetadataAnalysisWrapperPass>();
|
||||
AU.addPreserved<ShaderFlagsAnalysisWrapper>();
|
||||
AU.addPreserved<DXILResourceBindingWrapperPass>();
|
||||
AU.addPreserved<DXILResourceWrapperPass>();
|
||||
AU.addPreserved<RootSignatureAnalysisWrapper>();
|
||||
AU.addPreserved<ShaderFlagsAnalysisWrapper>();
|
||||
}
|
||||
|
||||
bool runOnModule(Module &M) override {
|
||||
@ -425,8 +486,8 @@ public:
|
||||
dxil::ModuleMetadataInfo MMDI =
|
||||
getAnalysis<DXILMetadataAnalysisWrapperPass>().getModuleMetadata();
|
||||
|
||||
translateMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
|
||||
translateBranchMetadata(M);
|
||||
translateGlobalMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
|
||||
translateInstructionMetadata(M);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@ -443,6 +504,7 @@ INITIALIZE_PASS_BEGIN(DXILTranslateMetadataLegacy, "dxil-translate-metadata",
|
||||
"DXIL Translate Metadata", false, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(DXILResourceWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(ShaderFlagsAnalysisWrapper)
|
||||
INITIALIZE_PASS_DEPENDENCY(RootSignatureAnalysisWrapper)
|
||||
INITIALIZE_PASS_DEPENDENCY(DXILMetadataAnalysisWrapperPass)
|
||||
INITIALIZE_PASS_END(DXILTranslateMetadataLegacy, "dxil-translate-metadata",
|
||||
"DXIL Translate Metadata", false, false)
|
||||
|
||||
@ -13,7 +13,8 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
/// A pass that transforms DXIL Intrinsics that don't have DXIL opCodes
|
||||
/// A pass that transforms LLVM Metadata in the module to it's DXIL equivalent,
|
||||
/// then emits all recognized DXIL Metadata
|
||||
class DXILTranslateMetadata : public PassInfoMixin<DXILTranslateMetadata> {
|
||||
public:
|
||||
PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
; RUN: opt -S -dxil-prepare -mtriple=dxil-unknown-shadermodel6.0-compute %s | FileCheck %s
|
||||
; RUN: opt -S -dxil-translate-metadata -mtriple=dxil-unknown-shadermodel6.0-compute %s | FileCheck %s
|
||||
|
||||
; Make sure behavior flag > 6 is fixed.
|
||||
; CHECK: !{i32 2, !"frame-pointer", i32 2}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
; RUN: opt -S -dxil-prepare -mtriple=dxil-unknown-shadermodel6.0-library %s | FileCheck %s
|
||||
; RUN: opt -S -dxil-translate-metadata -mtriple=dxil-unknown-shadermodel6.0-library %s | FileCheck %s
|
||||
|
||||
; CHECK: define void @main()
|
||||
; Make sure behavior flag > 6 is fixed.
|
||||
|
||||
@ -40,8 +40,8 @@
|
||||
; CHECK-NEXT: DXIL Resources Analysis
|
||||
; CHECK-NEXT: DXIL Module Metadata analysis
|
||||
; CHECK-NEXT: DXIL Shader Flag Analysis
|
||||
; CHECK-NEXT: DXIL Translate Metadata
|
||||
; CHECK-NEXT: DXIL Root Signature Analysis
|
||||
; CHECK-NEXT: DXIL Translate Metadata
|
||||
; CHECK-NEXT: DXIL Post Optimization Validation
|
||||
; CHECK-NEXT: DXIL Op Lowering
|
||||
; CHECK-NEXT: DXIL Prepare Module
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
; RUN: opt -S --dxil-prepare %s | FileCheck %s
|
||||
; RUN: opt -S --dxil-translate-metadata %s | FileCheck %s
|
||||
|
||||
; Test that only metadata nodes that are valid in DXIL are allowed through
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
; RUN: opt -S -dxil-prepare < %s | FileCheck %s
|
||||
; RUN: opt -S -dxil-translate-metadata < %s | FileCheck %s
|
||||
|
||||
; Ensures that dxil-prepare will remove the llvm.errno.tbaa metadata
|
||||
; Ensures that dxil-translate-metadata will remove the llvm.errno.tbaa metadata
|
||||
|
||||
target triple = "dxil-unknown-shadermodel6.0-compute"
|
||||
|
||||
@ -10,7 +10,6 @@ entry:
|
||||
}
|
||||
|
||||
; CHECK-NOT: !llvm.errno.tbaa
|
||||
; CHECK-NOT: {{^!}}
|
||||
|
||||
!llvm.errno.tbaa = !{!0}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
; RUN: opt -S -dxil-prepare < %s | FileCheck %s
|
||||
; RUN: opt -S -dxil-translate-metadata < %s | FileCheck %s
|
||||
|
||||
; Ensures that dxil-prepare will remove the dx.rootsignatures metadata
|
||||
; Ensures that dxil-translate-metadata will remove the dx.rootsignatures metadata
|
||||
|
||||
target triple = "dxil-unknown-shadermodel6.0-compute"
|
||||
|
||||
@ -10,7 +10,6 @@ entry:
|
||||
}
|
||||
|
||||
; CHECK-NOT: !dx.rootsignatures
|
||||
; CHECK-NOT: {{^!}}
|
||||
|
||||
!dx.rootsignatures = !{!2} ; list of function/root signature pairs
|
||||
!2 = !{ ptr @main, !3, i32 2 } ; function, root signature
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user