[llvm] [IR] Filter dumps by source location (PR #203393)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 15:58:37 PDT 2026


================
@@ -153,14 +157,47 @@ static cl::opt<std::string>
                 cl::desc("exe called with module IR after each pass that "
                          "changes it"));
 
+bool loopContainsPrintSourceLoc(const Loop &L) {
+  const Function *F = L.getHeader()->getParent();
+  if (!isFunctionInPrintList(F->getName()))
+    return false;
+
+  if (isSourceLocFilterEmpty())
+    return true;
+
+  for (const BasicBlock *BB : L.blocks())
+    for (const Instruction &I : *BB)
+      if (isSourceLocInPrintList(I.getDebugLoc()))
+        return true;
+  return false;
+}
+
+bool shouldGenerateData(const Function &F) {
----------------
aeubanks wrote:

why the rename?

https://github.com/llvm/llvm-project/pull/203393


More information about the llvm-commits mailing list