Skip to content

Commit 9541b04

Browse files
committed
[DirectX] add "llvm.loop" to metadata whitelist
1 parent 7c8aa55 commit 9541b04

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
@@ -294,16 +294,17 @@ static void translateBranchMetadata(Module &M, Instruction *BBTerminatorInst) {
294294
BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
295295
}
296296

297-
static std::array<unsigned, 6> getCompatibleInstructionMDs(llvm::Module &M) {
297+
static std::array<unsigned, 7> getCompatibleInstructionMDs(llvm::Module &M) {
298298
return {
299299
M.getMDKindID("dx.nonuniform"), M.getMDKindID("dx.controlflow.hints"),
300300
M.getMDKindID("dx.precise"), llvm::LLVMContext::MD_range,
301-
llvm::LLVMContext::MD_alias_scope, llvm::LLVMContext::MD_noalias};
301+
llvm::LLVMContext::MD_alias_scope, llvm::LLVMContext::MD_noalias,
302+
M.getMDKindID("llvm.loop")};
302303
}
303304

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

308309
for (Function &F : M) {
309310
for (BasicBlock &BB : F) {

0 commit comments

Comments
 (0)