From 8e9cefa1d5074142a05641f694e58b68812b35a0 Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 10 May 2024 10:09:12 -0400 Subject: [PATCH] ExtractIRForPassTest: use %dxopt on the RUN line (#6519) Also, emit a better message when the desired pass does not exist (or is mis-spelled). Before this change, there would only be a confusing message about 'after' being None. --- utils/hct/ExtractIRForPassTest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/hct/ExtractIRForPassTest.py b/utils/hct/ExtractIRForPassTest.py index 639e2602f..a4a275fc4 100644 --- a/utils/hct/ExtractIRForPassTest.py +++ b/utils/hct/ExtractIRForPassTest.py @@ -86,6 +86,9 @@ def SplitAtPass(passes, pass_name, invocation=1): after = [line] continue before.append(line) + if after is None: + raise Exception(f"no such pass: {pass_name}") + return before, after @@ -143,7 +146,7 @@ def main(args): # 6. Inserts RUN line with -hlsl-passes-resume and desired pass with open(args.output_file, "wt") as f: f.write( - "; RUN: %opt %s -hlsl-passes-resume -{} -S | FileCheck %s\n\n".format( + "; RUN: %dxopt %s -hlsl-passes-resume -{} -S | FileCheck %s\n\n".format( args.desired_pass ) )