From fea65392ea282dec9a43c3ab86fb63b890f6354e Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Mon, 2 Dec 2024 18:04:47 +0100 Subject: [PATCH] remove useless code in PrintfPass.cpp (#1426) This code does not make much sense. clspv read PrintKernelMetadataName only for SPIR_KERNEL, so setting it for other function is useless. Remove it also removes a warning because of the break inside the loop (-Wno-unreachable-code-loop-increment) --- lib/PrintfPass.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/PrintfPass.cpp b/lib/PrintfPass.cpp index cc4cc265d..ad937a9f2 100644 --- a/lib/PrintfPass.cpp +++ b/lib/PrintfPass.cpp @@ -339,14 +339,6 @@ PreservedAnalyses clspv::PrintfPass::run(Module &M, ModuleAnalysisManager &) { F->addMetadata(clspv::PrintfKernelMetadataName(), *MDNode::get(M.getContext(), {})); } - } else { - for (auto &F : M) { - if (!F.getMetadata(clspv::PrintfKernelMetadataName())) { - F.addMetadata(clspv::PrintfKernelMetadataName(), - *MDNode::get(M.getContext(), {})); - } - break; - } } }