[llvm] c93df83 - [opt-viewer] Account for optimization records YAML files generated by LTO (#135059)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 14:03:49 PST 2025


Author: Min-Yih Hsu
Date: 2025-11-04T22:03:45Z
New Revision: c93df83b0469902ad22de3e98a8325406a96b960

URL: https://github.com/llvm/llvm-project/commit/c93df83b0469902ad22de3e98a8325406a96b960
DIFF: https://github.com/llvm/llvm-project/commit/c93df83b0469902ad22de3e98a8325406a96b960.diff

LOG: [opt-viewer] Account for optimization records YAML files generated by LTO (#135059)

The optimization records YAML files generated by Clang's LTO pipeline
are named "\*.opt.ld.yaml" rather than "\*.opt.yaml". This patch adds
that pattern into the search list of `find_opt_files` as well.

Added: 
    

Modified: 
    llvm/tools/opt-viewer/optrecord.py

Removed: 
    


################################################################################
diff  --git a/llvm/tools/opt-viewer/optrecord.py b/llvm/tools/opt-viewer/optrecord.py
index b9244fd1ae739..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*"):
+                    if fnmatch.fnmatch(file, "*.opt.yaml*") or fnmatch.fnmatch(
+                        file, "*.opt.ld.yaml*"
+                    ):
                         all.append(os.path.join(dir, file))
     return all


        


More information about the llvm-commits mailing list