1515import os # Used to advertise this file's name ("autogenerated_note").
1616import sys
1717
18- from UpdateTestChecks import common , mir
18+ from UpdateTestChecks import common
1919
2020# llc is the only llc-like in the LLVM tree but downstream forks can add
2121# additional ones here if they have them.
@@ -33,7 +33,6 @@ def update_test(ti: common.TestInfo):
3333 break
3434
3535 run_list = []
36- mir_run_list = []
3736 for l in ti .run_lines :
3837 if "|" not in l :
3938 common .warn ("Skipping unparsable RUN line: " + l )
@@ -58,14 +57,9 @@ def update_test(ti: common.TestInfo):
5857 if m :
5958 march_in_cmd = m .groups ()[0 ]
6059
61- target_list = run_list
6260 m = common .DEBUG_ONLY_ARG_RE .search (llc_cmd )
6361 if m and m .groups ()[0 ] == "isel" :
6462 from UpdateTestChecks import isel as output_type
65- elif not m and common .STOP_PASS_RE .search (llc_cmd ):
66- # MIR output mode. If -debug-only is present assume
67- # the debug output is the main point of interest.
68- target_list = mir_run_list
6963 else :
7064 from UpdateTestChecks import asm as output_type
7165
@@ -90,7 +84,7 @@ def update_test(ti: common.TestInfo):
9084
9185 # FIXME: We should use multiple check prefixes to common check lines. For
9286 # now, we just ignore all but the last.
93- target_list .append (
87+ run_list .append (
9488 (
9589 check_prefixes ,
9690 llc_tool ,
@@ -125,20 +119,14 @@ def update_test(ti: common.TestInfo):
125119 ginfo = ginfo ,
126120 )
127121
128- # Dictionary to store MIR function bodies separately
129- mir_func_dict = {}
130- for run_tuple , is_mir in [(run , False ) for run in run_list ] + [
131- (run , True ) for run in mir_run_list
132- ]:
133- (
134- prefixes ,
135- llc_tool ,
136- llc_args ,
137- preprocess_cmd ,
138- triple_in_cmd ,
139- march_in_cmd ,
140- ) = run_tuple
141-
122+ for (
123+ prefixes ,
124+ llc_tool ,
125+ llc_args ,
126+ preprocess_cmd ,
127+ triple_in_cmd ,
128+ march_in_cmd ,
129+ ) in run_list :
142130 common .debug ("Extracted LLC cmd:" , llc_tool , llc_args )
143131 common .debug ("Extracted FileCheck prefixes:" , str (prefixes ))
144132
@@ -153,54 +141,22 @@ def update_test(ti: common.TestInfo):
153141 if not triple :
154142 triple = common .get_triple_from_march (march_in_cmd )
155143
156- if is_mir :
157- # MIR output mode
158- common .debug ("Detected MIR output mode for prefixes:" , str (prefixes ))
159- for prefix in prefixes :
160- if prefix not in mir_func_dict :
161- mir_func_dict [prefix ] = {}
162-
163- mir .build_function_info_dictionary (
164- ti .path ,
165- raw_tool_output ,
166- triple ,
167- prefixes ,
168- mir_func_dict ,
169- ti .args .verbose ,
144+ scrubber , function_re = output_type .get_run_handler (triple )
145+ if 0 == builder .process_run_line (
146+ function_re , scrubber , raw_tool_output , prefixes
147+ ):
148+ common .warn (
149+ "Couldn't match any function. Possibly the wrong target triple has been provided"
170150 )
171- else :
172- # ASM output mode
173- scrubber , function_re = output_type .get_run_handler (triple )
174- if 0 == builder .process_run_line (
175- function_re , scrubber , raw_tool_output , prefixes
176- ):
177- common .warn (
178- "Couldn't match any function. Possibly the wrong target triple has been provided"
179- )
180- builder .processed_prefixes (prefixes )
151+ builder .processed_prefixes (prefixes )
181152
182153 func_dict = builder .finish_and_get_func_dict ()
183-
184- # Check for conflicts: same prefix used for both ASM and MIR
185- conflicting_prefixes = set (func_dict .keys ()) & set (mir_func_dict .keys ())
186- if conflicting_prefixes :
187- common .warn (
188- "The following prefixes are used for both ASM and MIR output, which will cause FileCheck failures: {}" .format (
189- ", " .join (sorted (conflicting_prefixes ))
190- ),
191- test_file = ti .path ,
192- )
193- for prefix in conflicting_prefixes :
194- mir_func_dict [prefix ] = {}
195- func_dict [prefix ] = {}
196-
197154 global_vars_seen_dict = {}
198155
199156 is_in_function = False
200157 is_in_function_start = False
201158 func_name = None
202159 prefix_set = set ([prefix for p in run_list for prefix in p [0 ]])
203- prefix_set .update ([prefix for p in mir_run_list for prefix in p [0 ]])
204160 common .debug ("Rewriting FileCheck prefixes:" , str (prefix_set ))
205161 output_lines = []
206162
@@ -265,22 +221,6 @@ def update_test(ti: common.TestInfo):
265221 is_filtered = builder .is_filtered (),
266222 )
267223 )
268-
269- # Also add MIR checks if we have them for this function
270- if mir_run_list and func_name :
271- mir .add_mir_checks_for_function (
272- ti .path ,
273- output_lines ,
274- mir_run_list ,
275- mir_func_dict ,
276- func_name ,
277- single_bb = False , # Don't skip basic block labels.
278- print_fixed_stack = False , # Don't print fixed stack (ASM tests don't need it).
279- first_check_is_next = False , # First check is LABEL, not NEXT.
280- at_the_function_name = False , # Use "name:" not "@name".
281- check_indent = "" , # No indentation for IR files (not MIR files).
282- )
283-
284224 is_in_function_start = False
285225
286226 if is_in_function :
0 commit comments