summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt-viewer/opt-stats.py
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-07-17 18:00:41 +0000
committerAdam Nemet <anemet@apple.com>2017-07-17 18:00:41 +0000
commit659d7dbb0e82ab3f13f2e5eb0f6303f22bfd34e4 (patch)
treeab5444df6e6320808699c35cf5b1991864b7158d /llvm/tools/opt-viewer/opt-stats.py
parent6af25595622bb874060f62b0c4531a1f47a7eaf4 (diff)
downloadbcm5719-llvm-659d7dbb0e82ab3f13f2e5eb0f6303f22bfd34e4.tar.gz
bcm5719-llvm-659d7dbb0e82ab3f13f2e5eb0f6303f22bfd34e4.zip
[opt-viewer] Accept directories that are searched for opt.yaml files
This allows to pass the build directory where all the opt.yaml files are rather than find | xargs which may invoke opt-viewer multiple times producing incomplete html output. The patch generalizes the same functionality from opt-diff. Differential Revision: https://reviews.llvm.org/D35491 llvm-svn: 308200
Diffstat (limited to 'llvm/tools/opt-viewer/opt-stats.py')
-rwxr-xr-xllvm/tools/opt-viewer/opt-stats.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/tools/opt-viewer/opt-stats.py b/llvm/tools/opt-viewer/opt-stats.py
index a7e598fdfd0..205b08ba8a7 100755
--- a/llvm/tools/opt-viewer/opt-stats.py
+++ b/llvm/tools/opt-viewer/opt-stats.py
@@ -15,7 +15,11 @@ from multiprocessing import cpu_count, Pool
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=desc)
- parser.add_argument('yaml_files', nargs='+')
+ parser.add_argument(
+ 'yaml_dirs_or_files',
+ nargs='+',
+ help='List of optimization record files or directories searched '
+ 'for optimization record files.')
parser.add_argument(
'--jobs',
'-j',
@@ -31,8 +35,14 @@ if __name__ == '__main__':
args = parser.parse_args()
print_progress = not args.no_progress_indicator
+
+ files = optrecord.find_opt_files(args.yaml_dirs_or_files)
+ if not files:
+ parser.error("No *.opt.yaml files found")
+ sys.exit(1)
+
all_remarks, file_remarks, _ = optrecord.gather_results(
- args.yaml_files, args.jobs, print_progress)
+ files, args.jobs, print_progress)
if print_progress:
print('\n')
OpenPOWER on IntegriCloud