[PATCH] D146964: [llvm-exegesis] if lit can't find llvm-exegesis, fail gracefully

Ties Stuij via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 07:36:15 PDT 2023


stuij created this revision.
Herald added a subscriber: mstojanovic.
Herald added a project: All.
stuij requested review of this revision.
Herald added subscribers: llvm-commits, courbet.
Herald added a project: LLVM.

currently in can_use_perfcounters() in
llvm/test/tools/llvm-exegesis/lit.local.cfg, we check if we can execute
llvm-exegesis. But we don't check if we did actually find llvm-exegesis. If we
didn't, lit.util.which() will return None, and we try to execute that.

Change-Id: I81d302266322fb44e2a402bb4ad1ec7161d01e06


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146964

Files:
  llvm/test/tools/llvm-exegesis/lit.local.cfg


Index: llvm/test/tools/llvm-exegesis/lit.local.cfg
===================================================================
--- llvm/test/tools/llvm-exegesis/lit.local.cfg
+++ llvm/test/tools/llvm-exegesis/lit.local.cfg
@@ -14,6 +14,9 @@
     # only know that at runtime, so we try to measure an empty code snippet
     # and bail out on error.
     llvm_exegesis_exe = lit.util.which('llvm-exegesis', config.llvm_tools_dir)
+    if llvm_exegesis_exe is None:
+       print('could not find llvm-exegesis')
+       return False
     try:
         return_code = subprocess.call(
             [llvm_exegesis_exe, '-mode', mode, '-snippets-file', '/dev/null'] + extra_options,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146964.508652.patch
Type: text/x-patch
Size: 668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230327/8cb9c539/attachment.bin>


More information about the llvm-commits mailing list