From 758d4bfcf488302baad10a0f4f87abdf2a1d0894 Mon Sep 17 00:00:00 2001 From: Min Hsu Date: Wed, 9 Apr 2025 10:35:26 -0700 Subject: [PATCH 1/2] [opt-viewer] Account for optimization records YAML generated by LTO --- llvm/tools/opt-viewer/optrecord.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/tools/opt-viewer/optrecord.py b/llvm/tools/opt-viewer/optrecord.py index 8014204a64f45..4ff092dfc4869 100644 --- a/llvm/tools/opt-viewer/optrecord.py +++ b/llvm/tools/opt-viewer/optrecord.py @@ -361,6 +361,6 @@ def find_opt_files(*dirs_or_files): d for d in subdirs if not os.path.ismount(os.path.join(dir, d)) ] for file in files: - if fnmatch.fnmatch(file, "*.opt.yaml*"): + if fnmatch.fnmatch(file, "*.opt.yaml*") or fnmatch.fnmatch(file, "*.opt.ld.yaml*"): all.append(os.path.join(dir, file)) return all From 6d453a178a01e5338af78a45fe210905d37966ba Mon Sep 17 00:00:00 2001 From: Min-Yih Hsu Date: Tue, 4 Nov 2025 13:30:29 -0800 Subject: [PATCH 2/2] fixup! Format the python code --- llvm/tools/opt-viewer/optrecord.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/tools/opt-viewer/optrecord.py b/llvm/tools/opt-viewer/optrecord.py index c83e9faa36f44..07e21028535c4 100644 --- a/llvm/tools/opt-viewer/optrecord.py +++ b/llvm/tools/opt-viewer/optrecord.py @@ -344,6 +344,8 @@ def find_opt_files(*dirs_or_files): d for d in subdirs if not os.path.ismount(os.path.join(dir, d)) ] for file in files: - if fnmatch.fnmatch(file, "*.opt.yaml*") or fnmatch.fnmatch(file, "*.opt.ld.yaml*"): + if fnmatch.fnmatch(file, "*.opt.yaml*") or fnmatch.fnmatch( + file, "*.opt.ld.yaml*" + ): all.append(os.path.join(dir, file)) return all