Skip to content

Commit dfa87b6

Browse files
committed
[DirectX] add "llvm.loop" to metadata whitelist
1 parent 6311180 commit dfa87b6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,17 @@ static void translateBranchMetadata(Module &M, Instruction *BBTerminatorInst) {
296296
BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
297297
}
298298

299-
static std::array<unsigned, 6> getCompatibleInstructionMDs(llvm::Module &M) {
299+
static std::array<unsigned, 7> getCompatibleInstructionMDs(llvm::Module &M) {
300300
return {
301301
M.getMDKindID("dx.nonuniform"), M.getMDKindID("dx.controlflow.hints"),
302302
M.getMDKindID("dx.precise"), llvm::LLVMContext::MD_range,
303-
llvm::LLVMContext::MD_alias_scope, llvm::LLVMContext::MD_noalias};
303+
llvm::LLVMContext::MD_alias_scope, llvm::LLVMContext::MD_noalias,
304+
M.getMDKindID("llvm.loop")};
304305
}
305306

306307
static void translateInstructionMetadata(Module &M) {
307308
// construct allowlist of valid metadata node kinds
308-
std::array<unsigned, 6> DXILCompatibleMDs = getCompatibleInstructionMDs(M);
309+
std::array<unsigned, 7> DXILCompatibleMDs = getCompatibleInstructionMDs(M);
309310

310311
for (Function &F : M) {
311312
for (BasicBlock &BB : F) {

0 commit comments

Comments
 (0)