-
Notifications
You must be signed in to change notification settings - Fork 51
/
rgx_utils.py
1853 lines (1805 loc) · 146 KB
/
rgx_utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# NCC: Neural Code Comprehension
# https://github.com/spcl/ncc
# Copyright 2018 ETH Zurich
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ==============================================================================
"""Helper variables and functions for regular expressions and statement tags"""
import re
########################################################################################################################
# Regex manipulation: helper functions
########################################################################################################################
def any_of(possibilities, to_add=''):
"""
Helper function for regex manipulation:
Construct a regex representing "any of" the given possibilities
:param possibilities: list of strings representing different word possibilities
:param to_add: string to add at the beginning of each possibility (optional)
:return: string corresponding to regex which represents any of the given possibilities
"""
assert len(possibilities) > 0
s = '(?:'
if len(to_add) > 0:
s += possibilities[0] + to_add + ' '
else:
s += possibilities[0]
for i in range(len(possibilities)-1):
if len(to_add) > 0:
s += '|' + possibilities[i+1] + to_add + ' '
else:
s += '|' + possibilities[i+1]
return s + ')'
########################################################################################################################
# Regex manipulation: helper variables
########################################################################################################################
# Identifiers
global_id = r'(?<!%")@["\w\d\.\-\_\$\\]+'
local_id_no_perc = '[\"\@\d\w\.\-\_\:]+'
local_id = '%' + local_id_no_perc
local_or_global_id = r'(' + global_id + r'|' + local_id + r')'
# Options and linkages
linkage = any_of([' private', ' external', ' internal', ' linkonce_odr', ' appending', ' external', ' internal',
' unnamed_addr', ' common', ' hidden', ' weak', ' linkonce', ' extern_weak', ' weak_odr', ' private',
' available_externally', ' local_unnamed_addr', ' thread_local', ' linker_private'])
# Immediate values
immediate_value_ad_hoc = r'#[\d\w]+'
immediate_value_true = r'true'
immediate_value_false = r'false'
immediate_value_bool = r'(?:' + immediate_value_true + r'|' + immediate_value_false + r')'
immediate_value_int = r'(?<!\w)[-]?[0-9]+'
immediate_value_float_sci = r'(?<!\w)[-]?[0-9]+\.[0-9]+(?:e\+?-?[0-9]+)?'
immediate_value_float_hexa = r'(?<!\w)[-]?0[xX][hklmHKLM]?[A-Fa-f0-9]+'
immediate_value_float = r'(?:' + immediate_value_float_sci + '|' + immediate_value_float_hexa + ')'
immediate_value_vector_bool = r'<i1 ' + immediate_value_bool + r'(?:, i1 (?:' + immediate_value_bool + '|undef))*>'
immediate_value_vector_int = r'<i\d+ ' + immediate_value_int + r'(?:, i\d+ (?:' + immediate_value_int + '|undef))*>'
immediate_value_vector_float = r'<float ' + immediate_value_float + r'(?:, float (?:' + immediate_value_float + \
'|undef))*>'
immediate_value_vector_double = r'<double ' + immediate_value_float + r'(?:, double (?:' + immediate_value_float + \
'|undef))*>'
immediate_value_string = r'(?<!\w)c".+"'
immediate_value_misc = r'(?:null|zeroinitializer)'
immediate_value = any_of([immediate_value_true, immediate_value_false,
immediate_value_int, immediate_value_float_sci, immediate_value_float_hexa,
immediate_value_string, immediate_value_misc])
immediate_value_undef = r'undef'
immediate_value_or_undef = any_of([immediate_value_true, immediate_value_false,
immediate_value_int, immediate_value_float_sci, immediate_value_float_hexa,
immediate_value_string,
immediate_value_misc, immediate_value_ad_hoc, immediate_value_undef])
# Combos
immediate_or_local_id = any_of([immediate_value_true, immediate_value_false,
immediate_value_int, immediate_value_float_sci, immediate_value_float_hexa,
immediate_value_vector_int, immediate_value_vector_float, immediate_value_vector_double,
local_id, immediate_value_misc])
immediate_or_local_id_or_undef = any_of([immediate_value_true, immediate_value_false,
immediate_value_int, immediate_value_float_sci, immediate_value_float_hexa,
immediate_value_vector_int, immediate_value_vector_float, immediate_value_vector_double,
local_id, immediate_value_misc, immediate_value_undef])
# Names of aggregate types
# Lookahead so that names like '%struct.attribute_group**' won't be matched as just %struct.attribute
struct_lookahead = r'(?=[\s,\*\]\}])'
struct_name_add_on = '(?:\([\w\d=]+\)")?'
struct_name_without_lookahead = \
'%[\"\@\d\w\.\-\_:]+(?:(?:<[\"\@\d\w\.\-\_:,<>\(\) \*]+>|\([\"\@\d\w\.\-\_:,<> \*]+\)|\w+)?::[\" \@\d\w\.\-\_:\)\(]*)*' \
+ struct_name_add_on
struct_name = struct_name_without_lookahead + struct_lookahead
# Functions
func_name = r'@[\"\w\d\._\$\\]+'
func_call_pattern = r'.* @[\w\d\._]+'
func_call_pattern_or_bitcast = r'(.* @[\w\d\._]+|.*bitcast .* @[\w\d\._]+ to .*)'
# new basic block
start_basic_block = r'((?:<label>:)?(' + local_id_no_perc + r'):|; <label>:' + local_id_no_perc + r' )'
# Types
base_type = r'(?:i\d+|double|float|opaque)\**'
first_class_types = ['i\d+', 'half', 'float', 'double', 'fp_128', 'x86_fp80', 'ppc_fp128', '<%ID>']
first_class_type = any_of(first_class_types) + '\**'
base_type_or_struct_name = any_of([base_type, struct_name_without_lookahead])
ptr_to_base_type = base_type + r'\*+'
vector_type = r'<\d+ x ' + base_type + r'>'
ptr_to_vector_type = vector_type + r'\*+'
array_type = r'\[\d+ x ' + base_type + r'\]'
ptr_to_array_type = array_type + r'\*+'
array_of_array_type = '\[\d+ x ' + '\[\d+ x ' + base_type + '\]' + '\]'
struct = struct_name_without_lookahead
ptr_to_struct = struct + r'\*+'
function_type = base_type + ' \(' + any_of([base_type, vector_type, array_type, '...'], ',') + '*' + \
any_of([base_type, vector_type, array_type, '...']) + '\)\**'
any_type = any_of([base_type, ptr_to_base_type, vector_type, ptr_to_vector_type, array_type, ptr_to_array_type])
any_type_or_struct = any_of([base_type, ptr_to_base_type, vector_type, ptr_to_vector_type, array_type,
ptr_to_array_type, ptr_to_struct])
structure_entry = any_of([base_type, vector_type, array_type, array_of_array_type, function_type, r'{ .* }\**'])
structure_entry_with_comma = any_of([base_type, vector_type, array_type, array_of_array_type, function_type], ',')
literal_structure = '(<?{ ' + structure_entry_with_comma + '*' + structure_entry + ' }>?|{})'
# Tokens
unknown_token = '!UNK' # starts with '!' to guarantee it will appear first in the alphabetically sorted vocabulary
########################################################################################################################
# Tags for clustering statements (by statement semantics) and helper functions
########################################################################################################################
# List of families of operations
llvm_IR_stmt_families = [
# ["tag level 1", "tag level 2", "tag level 3", "regex" ]
["unknown token", "unknown token", "unknown token", '!UNK'],
["integer arithmetic", "addition", "add integers", "<%ID> = add .*"],
["integer arithmetic", "subtraction", "subtract integers", "<%ID> = sub .*"],
["integer arithmetic", "multiplication", "multiply integers", "<%ID> = mul .*"],
["integer arithmetic", "division", "unsigned integer division", "<%ID> = udiv .*"],
["integer arithmetic", "division", "signed integer division", "<%ID> = sdiv .*"],
["integer arithmetic", "remainder", "remainder of signed div", "<%ID> = srem .*"],
["integer arithmetic", "remainder", "remainder of unsigned div.", "<%ID> = urem .*"],
["floating-point arithmetic", "addition", "add floats", "<%ID> = fadd .*"],
["floating-point arithmetic", "subtraction", "subtract floats", "<%ID> = fsub .*"],
["floating-point arithmetic", "multiplication", "multiply floats", "<%ID> = fmul .*"],
["floating-point arithmetic", "division", "divide floats", "<%ID> = fdiv .*"],
["bitwise arithmetic", "and", "and", "<%ID> = and .*"],
["bitwise arithmetic", "or", "or", "<%ID> = or .*"],
["bitwise arithmetic", "xor", "xor", "<%ID> = xor .*"],
["bitwise arithmetic", "shift left", "shift left", "<%ID> = shl .*"],
["bitwise arithmetic", "arithmetic shift right", "ashr", "<%ID> = ashr .*"],
["bitwise arithmetic", "logical shift right", "logical shift right", "<%ID> = lshr .*"],
["comparison operation", "compare integers", "compare integers", "<%ID> = icmp .*"],
["comparison operation", "compare floats", "compare floats", "<%ID> = fcmp .*"],
["conversion operation", "bitcast", "bitcast single val",
'<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque) .* to .*'],
["conversion operation", "bitcast", "bitcast single val*",
'<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\* .* to .*'],
["conversion operation", "bitcast", "bitcast single val**",
'<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\* .* to .*'],
["conversion operation", "bitcast", "bitcast single val***",
'<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\*\* .* to .*'],
["conversion operation", "bitcast", "bitcast single val****",
'<%ID> = bitcast (i\d+|float|double|x86_fp80|opaque)\*\*\*\* .* to .*'],
["conversion operation", "bitcast", "bitcast array", '<%ID> = bitcast \[\d.* to .*'],
["conversion operation", "bitcast", "bitcast vector", '<%ID> = bitcast <\d.* to .*'],
["conversion operation", "bitcast", "bitcast structure", '<%ID> = bitcast (%"|<{|<%|{).* to .*'],
["conversion operation", "bitcast", "bitcast void", '<%ID> = bitcast void '],
["conversion operation", "extension/truncation", "extend float", "<%ID> = fpext .*"],
["conversion operation", "extension/truncation", "truncate floats", "<%ID> = fptrunc .*"],
["conversion operation", "extension/truncation", "sign extend ints", "<%ID> = sext .*"],
["conversion operation", "extension/truncation", "truncate int to ... ", "<%ID> = trunc .* to .*"],
["conversion operation", "extension/truncation", "zero extend integers", "<%ID> = zext .*"],
["conversion operation", "convert", "convert signed integers to... ", "<%ID> = sitofp .*"],
["conversion operation", "convert", "convert unsigned integer to... ", "<%ID> = uitofp .*"],
["conversion operation", "convert int to ptr", "convert int to ptr", "<%ID> = inttoptr .*"],
["conversion operation", "convert ptr to int", "convert ptr to int", "<%ID> = ptrtoint .*"],
["conversion operation", "convert floats", "convert float to sint", "<%ID> = fptosi .*"],
["conversion operation", "convert floats", "convert float to uint", "<%ID> = fptoui .*"],
["control flow", "phi", "phi", "<%ID> = phi .*"],
["control flow", "switch", "jump table line", "i\d{1,2} <(INT|FLOAT)>, label <%ID>"],
["control flow", "select", "select", "<%ID> = select .*"],
["control flow", "invoke", "invoke and ret type", "<%ID> = invoke .*"],
["control flow", "invoke", "invoke void", "invoke (fastcc )?void .*"],
["control flow", "branch", "branch conditional", "br i1 .*"],
["control flow", "branch", "branch unconditional", "br label .*"],
["control flow", "branch", "branch indirect", "indirectbr .*"],
["control flow", "control flow", "switch", "switch .*"],
["control flow", "return", "return", "ret .*"],
["control flow", "resume", "resume", "resume .*"],
["control flow", "unreachable", "unreachable", "unreachable.*"],
["control flow", "exception handling", "catch block", "catch .*"],
["control flow", "exception handling", "cleanup clause", "cleanup"],
["control flow", "exception handling", "landingpad for exceptions", "<%ID> = landingpad ."],
["function", "function call", "sqrt (llvm-intrinsic)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>) @(llvm|llvm\..*)\.sqrt.*"],
["function", "function call", "fabs (llvm-intr.)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.fabs.*"],
["function", "function call", "max (llvm-intr.)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.max.*"],
["function", "function call", "min (llvm-intr.)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.min.*"],
["function", "function call", "fma (llvm-intr.)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.fma.*"],
["function", "function call", "phadd (llvm-intr.)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.phadd.*"],
["function", "function call", "pabs (llvm-intr.)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.pabs.*"],
["function", "function call", "pmulu (llvm-intr.)",
"<%ID> = (tail |musttail |notail )?call (fast |)?(i\d+|float|double|x86_fp80|<%ID>|<\d x float>|<\d x double>|<\d x i\d+>) @(llvm|llvm\..*)\.pmulu.*"],
["function", "function call", "umul (llvm-intr.)", "<%ID> = (tail |musttail |notail )?call {.*} @llvm\.umul.*"],
["function", "function call", "prefetch (llvm-intr.)", "(tail |musttail |notail )?call void @llvm\.prefetch.*"],
["function", "function call", "trap (llvm-intr.)", "(tail |musttail |notail )?call void @llvm\.trap.*"],
["function", "func decl / def", "function declaration", "declare .*"],
["function", "func decl / def", "function definition", "define .*"],
["function", "function call", "function call void",
"(tail |musttail |notail )?call( \w+)? void [\w\)\(\}\{\.\,\*\d\[\]\s<>%]*(<[@%]ID>\(|.*bitcast )"],
["function", "function call", "function call mem lifetime",
"(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.lifetime.*"],
["function", "function call", "function call mem copy",
"(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.memcpy\..*"],
["function", "function call", "function call mem set",
"(tail |musttail |notail )?call( \w+)? void ([\w)(\.\,\*\d ])*@llvm\.memset\..*"],
["function", "function call", "function call single val",
'<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80|<\d+ x (i\d+|float|double)>) (.*<[@%]ID>\(|(\(.*\) )?bitcast ).*'],
["function", "function call", "function call single val*",
'<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80)\* (.*<[@%]ID>\(|\(.*\) bitcast ).*'],
["function", "function call", "function call single val**",
'<%ID> = (tail |musttail |notail )?call[^{]* (i\d+|float|double|x86_fp80)\*\* (.*<[@%]ID>\(|\(.*\) bitcast ).*'],
["function", "function call", "function call array",
'<%ID> = (tail |musttail |notail )?call[^{]* \[.*\] (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )'],
["function", "function call", "function call array*",
'<%ID> = (tail |musttail |notail )?call[^{]* \[.*\]\* (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )'],
["function", "function call", "function call array**",
'<%ID> = (tail |musttail |notail )?call[^{]* \[.*\]\*\* (\(.*\) )?(<[@%]ID>\(|\(.*\) bitcast )'],
["function", "function call", "function call structure",
'<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|<?\{ .* \}>?|opaque|\{\}|<%ID>) (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )'],
["function", "function call", "function call structure*",
'<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|<?\{ .* \}>?|opaque|\{\}|<%ID>)\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )'],
["function", "function call", "function call structure**",
'<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|<?\{ .* \}>?|opaque|\{\}|<%ID>)\*\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )'],
["function", "function call", "function call structure***",
'<%ID> = (tail |musttail |notail )?call[^{]* (\{ .* \}[\w\_]*|<?\{ .* \}>?|opaque|\{\}|<%ID>)\*\*\* (\(.*\)\*? )?(<[@%]ID>\(|\(.*\) bitcast )'],
["function", "function call", "function call asm value", '<%ID> = (tail |musttail |notail )?call.* asm .*'],
["function", "function call", "function call asm void", '(tail |musttail |notail )?call void asm .*'],
["function", "function call", "function call function",
'<%ID> = (tail |musttail |notail )?call[^{]* void \([^\(\)]*\)\** <[@%]ID>\('],
["global variables", "glob. var. definition", "???", "<@ID> = (?!.*constant)(?!.*alias).*"],
["global variables", "constant definition", "???", "<@ID> = .*constant .*"],
["memory access", "load from memory", "load structure", '<%ID> = load (\w* )?(%"|<\{|\{ <|\{ \[|\{ |<%|opaque).*'],
["memory access", "load from memory", "load single val", '<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)[, ].*'],
["memory access", "load from memory", "load single val*",
'<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*[, ].*'],
["memory access", "load from memory", "load single val**",
'<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*[, ].*'],
["memory access", "load from memory", "load single val***",
'<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*[, ].*'],
["memory access", "load from memory", "load single val****",
'<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*[, ].*'],
["memory access", "load from memory", "load single val*****",
'<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*[, ].*'],
["memory access", "load from memory", "load single val******",
'<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*\*[, ].*'],
["memory access", "load from memory", "load single val*******",
'<%ID> = load (\w* )?(i\d+|float|double|x86_fp80)\*\*\*\*\*\*\*[, ].*'],
["memory access", "load from memory", "load vector", '<%ID> = load <\d+ x .*'],
["memory access", "load from memory", "load array", '<%ID> = load \[\d.*'],
["memory access", "load from memory", "load fction ptr", '<%ID> = load void \('],
["memory access", "store", "store", 'store.*'],
["memory addressing", "GEP", "GEP", "<%ID> = getelementptr .*"],
["memory allocation", "allocate on stack", "allocate structure", '<%ID> = alloca (%"|<{|<%|{ |opaque).*'],
["memory allocation", "allocate on stack", "allocate vector", "<%ID> = alloca <\d.*"],
["memory allocation", "allocate on stack", "allocate array", "<%ID> = alloca \[\d.*"],
["memory allocation", "allocate on stack", "allocate single value", "<%ID> = alloca (double|float|i\d{1,3})\*?.*"],
["memory allocation", "allocate on stack", "allocate void", "<%ID> = alloca void \(.*"],
["memory atomics", "atomic memory modify", "atomicrw xchg", "<%ID> = atomicrmw.* xchg .*"],
["memory atomics", "atomic memory modify", "atomicrw add", "<%ID> = atomicrmw.* add .*"],
["memory atomics", "atomic memory modify", "atomicrw sub", "<%ID> = atomicrmw.* sub .*"],
["memory atomics", "atomic memory modify", "atomicrw or", "<%ID> = atomicrmw.* or .*"],
["memory atomics", "atomic compare exchange", "cmpxchg single val",
"<%ID> = cmpxchg (weak )?(i\d+|float|double|x86_fp80)\*"],
["non-instruction", "label", "label declaration", "; <label>:.*(\s+; preds = <LABEL>)?"],
["non-instruction", "label", "label declaration", "<LABEL>:( ; preds = <LABEL>)?"],
["value aggregation", "extract value", "extract value", "<%ID> = extractvalue .*"],
["value aggregation", "insert value", "insert value", "<%ID> = insertvalue .*"],
["vector operation", "insert element", "insert element", "<%ID> = insertelement .*"],
["vector operation", "extract element", "extract element", "<%ID> = extractelement .*"],
["vector operation", "shuffle vector", "shuffle vector", "<%ID> = shufflevector .*"]
]
# Helper functions for exploring llvm_IR_families
def get_list_tag_level_1():
"""
Get the list of all level-1 tags in the data structure llvm_IR_families
:return: list containing strings corresponding to all level 1 tags
"""
list_tags = list()
for fam in llvm_IR_stmt_families:
list_tags.append(fam[0])
return list(set(list_tags))
def get_list_tag_level_2(tag_level_1='all'):
"""
Get the list of all level-2 tags in the data structure llvm_IR_families
corresponding to the string given as an input, or absolutely all of them
if input == 'all'
:param tag_level_1: string containing the level-1 tag to query, or 'all'
:return: list of strings
"""
# Make sure the input parameter is valid
assert tag_level_1 in get_list_tag_level_1() or tag_level_1 == 'all', tag_level_1 + ' invalid'
list_tags = list()
if tag_level_1 == 'all':
for fam in llvm_IR_stmt_families:
list_tags.append(fam[1])
list_tags = sorted(set(list_tags))
else:
for fam in llvm_IR_stmt_families:
if fam[0] == tag_level_1:
list_tags.append(fam[1])
return list(set(list_tags))
def get_list_tag_level_3(tag_level_2='all'):
"""
Get the list of all level-2 tags in the data structure llvm_IR_families
corresponding to the string given as an input, or absolutely all of them
if input == 'all'
:param tag_level_2: string containing the level-2 tag to query, or 'all'
:return: list of strings
"""
# Make sure the input parameter is valid
assert tag_level_2 in get_list_tag_level_2() or tag_level_2 == 'all'
list_tags = list()
if tag_level_2 == 'all':
for fam in llvm_IR_stmt_families:
list_tags.append(fam[2])
list_tags = sorted(set(list_tags))
else:
for fam in llvm_IR_stmt_families:
if fam[1] == tag_level_2:
list_tags.append(fam[2])
return list(set(list_tags))
def get_count(data, tag, level):
"""
Count the total number of occurrences of a given tag at a certain level
:param fams:
:param tag:
:param level:
:return:
"""
# Make sure the input is valid
assert level in [1, 2, 3]
# Count
count = 0
# Depending on tag level:
if level == 1:
assert tag in get_list_tag_level_1()
for fam in llvm_IR_stmt_families:
if fam[0] == tag:
# count += fam[3]
# count occurences in data
for key, value in data.items():
if re.match(fam[3], key):
count += value
elif level == 2:
assert tag in get_list_tag_level_2()
for fam in llvm_IR_stmt_families:
if fam[1] == tag:
# count += fam[3]
# count occurences in data
for key, value in data.items():
if re.match(fam[3], key):
count += value
elif level == 3:
assert tag in get_list_tag_level_3()
for fam in llvm_IR_stmt_families:
if fam[2] == tag:
# count += fam[3]
# count occurences in data
for key, value in data.items():
if re.match(fam[3], key):
count += value
return count
########################################################################################################################
# Tags for clustering statements (by statement type)
########################################################################################################################
# Helper lists
types_int = ['i1', 'i8', 'i16', 'i32', 'i64']
types_flpt = ['half', 'float', 'double', 'fp128', 'x86_fp80', 'ppc_fp128']
fast_math_flag = ['', 'nnan ', 'ninf ', 'nsz ', 'arcp ', 'contract ', 'afn ', 'reassoc ', 'fast ']
opt_load = ['atomic ', 'volatile ']
opt_addsubmul = ['nsw ', 'nuw ', 'nuw nsw ']
opt_usdiv = ['', 'exact ']
opt_icmp = ['eq ', 'ne ', 'ugt ', 'uge ', 'ult ', 'ule ', 'sgt ', 'sge ', 'slt ', 'sle ']
opt_fcmp = ['false ', 'oeq ', 'ogt ', 'oge ', 'olt ', 'olt ', 'ole ', 'one ', 'ord ', 'ueq ', 'ugt ',
'uge ', 'ult ', 'ule ', 'une ', 'uno ', 'true ']
opt_define = ['', 'linkonce_odr ', 'linkonce_odr ', 'zeroext ', 'dereferenceable\(\d+\) ', 'hidden ', 'internal ',
'nonnull ', 'weak_odr ', 'fastcc ', 'noalias ', 'signext ', 'spir_kernel ']
opt_invoke = ['', 'dereferenceable\(\d+\) ', 'noalias ', 'fast ', 'zeroext ', 'signext ', 'fastcc ']
opt_GEP = ['', 'inbounds ']
# Helper functions
def any_of(possibilities, to_add=''):
"""
Construct a regex representing "any of" the given possibilities
:param possibilities: list of strings representing different word possibilities
:param to_add: string to add at the beginning of each possibility (optional)
:return: string corresponding to regex which represents any of the given possibilities
"""
assert len(possibilities) > 0
s = '('
if len(to_add) > 0:
s += possibilities[0] + to_add + ' '
else:
s += possibilities[0]
for i in range(len(possibilities)-1):
if len(to_add) > 0:
s += '|' + possibilities[i+1] + to_add + ' '
else:
s += '|' + possibilities[i+1]
return s + ')'
# Main tags
llvm_IR_stmt_tags = [
# ['regex' 'tag' 'tag general'
['<@ID> = (?!.*constant)(?!.*alias).*', 'global definition', 'global variable definition'],
['<@ID> = .*constant .*', 'global const. def.', 'global variable definition'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i1 .*', 'i1 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i2 .*', 'i2 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i4 .*', 'i4 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i8 .*', 'i8 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i16 .*', 'i16 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i32 .*', 'i32 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i64 .*', 'i64 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?i128 .*', 'i128 operation', 'int operation'],
['<%ID> = add ' + any_of(opt_addsubmul) + '?<\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i1 .*', 'i1 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i2 .*', 'i2 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i4 .*', 'i4 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i8 .*', 'i8 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i16 .*', 'i16 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i32 .*', 'i32 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i64 .*', 'i64 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?i128 .*', 'i128 operation', 'int operation'],
['<%ID> = sub ' + any_of(opt_addsubmul) + '?<\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i1 .*', 'i1 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i2 .*', 'i2 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i4 .*', 'i4 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i8 .*', 'i8 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i16 .*', 'i16 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i32 .*', 'i32 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i64 .*', 'i64 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?i128 .*', 'i128 operation', 'int operation'],
['<%ID> = mul ' + any_of(opt_addsubmul) + '?<\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i1 .*', 'i1 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i2 .*', 'i2 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i4 .*', 'i4 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i8 .*', 'i8 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i16 .*', 'i16 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i32 .*', 'i32 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i64 .*', 'i64 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?i128 .*', 'i128 operation', 'int operation'],
['<%ID> = udiv ' + any_of(opt_usdiv) + '?<\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i1 .*', 'i1 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i2 .*', 'i2 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i4 .*', 'i4 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i8 .*', 'i8 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i16 .*', 'i16 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i32 .*', 'i32 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i64 .*', 'i64 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?i128 .*', 'i128 operation', 'int operation'],
['<%ID> = sdiv ' + any_of(opt_usdiv) + '?<\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<%ID> .*', 'struct operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<%ID>\* .*', 'struct* operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<%ID>\*\* .*', 'struct** operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<%ID>\*\*\* .*', 'struct*** operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i1 .*', 'i1 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i2 .*', 'i2 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i4 .*', 'i4 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i8 .*', 'i8 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i16 .*', 'i16 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i24 .*', 'i24 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i24> .*', '<d x i24> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i32 .*', 'i32 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i40 .*', 'i40 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i40> .*', '<d x i40> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i64 .*', 'i64 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i128 .*', 'i128 operation', 'int operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i1\* .*', 'i1* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i2\* .*', 'i2* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i4\* .*', 'i4* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i8\* .*', 'i8* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i16\* .*', 'i16* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i32\* .*', 'i32* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i40\* .*', 'i40* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i64\* .*', 'i64* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i128\* .*', 'i128* operation', 'int* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?x86_fp80\* .*', 'float* operation', 'floating point* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?float\* .*', 'float* operation', 'floating point* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?double\* .*', 'double* operation', 'floating point* operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i1\*\* .*', 'i1** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i2\*\* .*', 'i2** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i4\*\* .*', 'i4** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i8\*\* .*', 'i8** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i16\*\* .*', 'i16** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i32\*\* .*', 'i32** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i40\*\* .*', 'i40** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i64\*\* .*', 'i64** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?i128\*\* .*', 'i128** operation', 'int** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?x86_fp80\*\* .*', 'float** operation', 'floating point** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?float\*\* .*', 'float** operation', 'floating point** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?double\*\* .*', 'double** operation', 'floating point** operation'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<%ID>\* .*', 'struct/class op', 'struct/class op'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?(%"|opaque).*', 'struct/class op', 'struct/class op'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?<?{.*', 'struct/class op', 'struct/class op'],
['<%ID> = icmp ' + any_of(opt_icmp) + '?void \(.*', 'function op', 'struct/class op'],
['<%ID> = srem i1 .*', 'i1 operation', 'int operation'],
['<%ID> = srem <\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = srem i2 .*', 'i2 operation', 'int operation'],
['<%ID> = srem <\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = srem i4 .*', 'i4 operation', 'int operation'],
['<%ID> = srem <\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = srem i8 .*', 'i8 operation', 'int operation'],
['<%ID> = srem <\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = srem i16 .*', 'i16 operation', 'int operation'],
['<%ID> = srem <\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = srem i32 .*', 'i32 operation', 'int operation'],
['<%ID> = srem <\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = srem i64 .*', 'i64 operation', 'int operation'],
['<%ID> = srem <\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = srem i128 .*', 'i128 operation', 'int operation'],
['<%ID> = srem <\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = urem i1 .*', 'i1 operation', 'int operation'],
['<%ID> = urem <\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = urem i2 .*', 'i2 operation', 'int operation'],
['<%ID> = urem <\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = urem i4 .*', 'i4 operation', 'int operation'],
['<%ID> = urem <\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = urem i8 .*', 'i8 operation', 'int operation'],
['<%ID> = urem <\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = urem i16 .*', 'i16 operation', 'int operation'],
['<%ID> = urem <\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = urem i32 .*', 'i32 operation', 'int operation'],
['<%ID> = urem <\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = urem i64 .*', 'i32 operation', 'int operation'],
['<%ID> = urem <\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = urem i128 .*', 'i128 operation', 'int operation'],
['<%ID> = urem <\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = fadd ' + any_of(fast_math_flag) + '?x86_fp80.*', 'float operation', 'floating point operation'],
['<%ID> = fadd ' + any_of(fast_math_flag) + '?<\d+ x x86_fp80>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fadd ' + any_of(fast_math_flag) + '?float.*', 'float operation', 'floating point operation'],
['<%ID> = fadd ' + any_of(fast_math_flag) + '?<\d+ x float>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fadd ' + any_of(fast_math_flag) + '?double.*', 'double operation', 'floating point operation'],
['<%ID> = fadd ' + any_of(fast_math_flag) + '?<\d+ x double>.*', '<d x double> operation',
'<d x floating point> operation'],
['<%ID> = fsub ' + any_of(fast_math_flag) + '?x86_fp80.*', 'float operation', 'floating point operation'],
['<%ID> = fsub ' + any_of(fast_math_flag) + '?<\d+ x x86_fp80>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fsub ' + any_of(fast_math_flag) + '?float.*', 'float operation', 'floating point operation'],
['<%ID> = fsub ' + any_of(fast_math_flag) + '?<\d+ x float>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fsub ' + any_of(fast_math_flag) + '?double.*', 'double operation', 'floating point operation'],
['<%ID> = fsub ' + any_of(fast_math_flag) + '?<\d+ x double>.*', '<d x double> operation',
'<d x floating point> operation'],
['<%ID> = fmul ' + any_of(fast_math_flag) + '?x86_fp80.*', 'float operation', 'floating point operation'],
['<%ID> = fmul ' + any_of(fast_math_flag) + '?<\d+ x x86_fp80>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fmul ' + any_of(fast_math_flag) + '?float.*', 'float operation', 'floating point operation'],
['<%ID> = fmul ' + any_of(fast_math_flag) + '?<\d+ x float>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fmul ' + any_of(fast_math_flag) + '?double.*', 'double operation', 'floating point operation'],
['<%ID> = fmul ' + any_of(fast_math_flag) + '?<\d+ x double>.*', '<d x double> operation',
'<d x floating point> operation'],
['<%ID> = fdiv ' + any_of(fast_math_flag) + '?x86_fp80.*', 'float operation', 'floating point operation'],
['<%ID> = fdiv ' + any_of(fast_math_flag) + '?<\d+ x x86_fp80>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fdiv ' + any_of(fast_math_flag) + '?float.*', 'float operation', 'floating point operation'],
['<%ID> = fdiv ' + any_of(fast_math_flag) + '?<\d+ x float>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fdiv ' + any_of(fast_math_flag) + '?double.*', 'double operation', 'floating point operation'],
['<%ID> = fdiv ' + any_of(fast_math_flag) + '?<\d+ x double>.*', '<d x double> operation',
'<d x floating point> operation'],
['<%ID> = frem ' + any_of(fast_math_flag) + '?x86_fp80.*', 'float operation', 'floating point operation'],
['<%ID> = frem ' + any_of(fast_math_flag) + '?<\d+ x x86_fp80>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = frem ' + any_of(fast_math_flag) + '?float.*', 'float operation', 'floating point operation'],
['<%ID> = frem ' + any_of(fast_math_flag) + '?<\d+ x float>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = frem ' + any_of(fast_math_flag) + '?double.*', 'double operation', 'floating point operation'],
['<%ID> = frem ' + any_of(fast_math_flag) + '?<\d+ x double>.*', '<d x double> operation',
'<d x floating point> operation'],
['<%ID> = fcmp (fast |)?' + any_of(opt_fcmp) + '?x86_fp80.*', 'float operation', 'floating point operation'],
['<%ID> = fcmp (fast |)?' + any_of(opt_fcmp) + '?<\d+ x x86_fp80>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fcmp (fast |)?' + any_of(opt_fcmp) + '?float.*', 'float operation', 'floating point operation'],
['<%ID> = fcmp (fast |)?' + any_of(opt_fcmp) + '?<\d+ x float>.*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = fcmp (fast |)?' + any_of(opt_fcmp) + '?double.*', 'double operation', 'floating point operation'],
['<%ID> = fcmp (fast |)?' + any_of(opt_fcmp) + '?<\d+ x double>.*', '<d x double> operation',
'<d x floating point> operation'],
['<%ID> = atomicrmw add i1\* .*', 'i1* operation', 'int* operation'],
['<%ID> = atomicrmw add i2\* .*', 'i2* operation', 'int* operation'],
['<%ID> = atomicrmw add i4\* .*', 'i4* operation', 'int* operation'],
['<%ID> = atomicrmw add i8\* .*', 'i8* operation', 'int* operation'],
['<%ID> = atomicrmw add i16\* .*', 'i16* operation', 'int* operation'],
['<%ID> = atomicrmw add i32\* .*', 'i32* operation', 'int* operation'],
['<%ID> = atomicrmw add i64\* .*', 'i64* operation', 'int* operation'],
['<%ID> = atomicrmw add i128\* .*', 'i128* operation', 'int* operation'],
['<%ID> = atomicrmw sub i1\* .*', 'i1* operation', 'int* operation'],
['<%ID> = atomicrmw sub i2\* .*', 'i2* operation', 'int* operation'],
['<%ID> = atomicrmw sub i4\* .*', 'i4* operation', 'int* operation'],
['<%ID> = atomicrmw sub i8\* .*', 'i8* operation', 'int* operation'],
['<%ID> = atomicrmw sub i16\* .*', 'i16* operation', 'int* operation'],
['<%ID> = atomicrmw sub i32\* .*', 'i32* operation', 'int* operation'],
['<%ID> = atomicrmw sub i64\* .*', 'i64* operation', 'int* operation'],
['<%ID> = atomicrmw sub i128\* .*', 'i128* operation', 'int* operation'],
['<%ID> = atomicrmw or i1\* .*', 'i1* operation', 'int* operation'],
['<%ID> = atomicrmw or i2\* .*', 'i2* operation', 'int* operation'],
['<%ID> = atomicrmw or i4\* .*', 'i4* operation', 'int* operation'],
['<%ID> = atomicrmw or i8\* .*', 'i8* operation', 'int* operation'],
['<%ID> = atomicrmw or i16\* .*', 'i16* operation', 'int* operation'],
['<%ID> = atomicrmw or i32\* .*', 'i32* operation', 'int* operation'],
['<%ID> = atomicrmw or i64\* .*', 'i64* operation', 'int* operation'],
['<%ID> = atomicrmw or i128\* .*', 'i128* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i1\* .*', 'i1* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i2\* .*', 'i2* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i4\* .*', 'i4* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i8\* .*', 'i8* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i16\* .*', 'i16* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i32\* .*', 'i32* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i64\* .*', 'i64* operation', 'int* operation'],
['<%ID> = atomicrmw xchg i128\* .*', 'i128* operation', 'int* operation'],
['<%ID> = alloca i1($|,).*', 'i1 operation', 'int operation'],
['<%ID> = alloca i2($|,).*', 'i2 operation', 'int operation'],
['<%ID> = alloca i4($|,).*', 'i4 operation', 'int operation'],
['<%ID> = alloca i8($|,).*', 'i8 operation', 'int operation'],
['<%ID> = alloca i16($|,).*', 'i16 operation', 'int operation'],
['<%ID> = alloca i32($|,).*', 'i32 operation', 'int operation'],
['<%ID> = alloca i64($|,).*', 'i64 operation', 'int operation'],
['<%ID> = alloca i128($|,).*', 'i128 operation', 'int operation'],
['<%ID> = alloca i1\*($|,).*', 'i1* operation', 'int* operation'],
['<%ID> = alloca i2\*($|,).*', 'i2* operation', 'int* operation'],
['<%ID> = alloca i4\*($|,).*', 'i4* operation', 'int* operation'],
['<%ID> = alloca i8\*($|,).*', 'i8* operation', 'int* operation'],
['<%ID> = alloca i16\*($|,).*', 'i16* operation', 'int* operation'],
['<%ID> = alloca i32\*($|,).*', 'i32* operation', 'int* operation'],
['<%ID> = alloca i64\*($|,).*', 'i64* operation', 'int* operation'],
['<%ID> = alloca i128\*($|,).*', 'i128* operation', 'int* operation'],
['<%ID> = alloca x86_fp80($|,).*', 'float operation', 'floating point operation'],
['<%ID> = alloca float($|,).*', 'float operation', 'floating point operation'],
['<%ID> = alloca double($|,).*', 'double operation', 'floating point operation'],
['<%ID> = alloca x86_fp80\*($|,).*', 'float* operation', 'floating point* operation'],
['<%ID> = alloca float\*($|,).*', 'float* operation', 'floating point* operation'],
['<%ID> = alloca double\*($|,).*', 'double* operation', 'floating point* operation'],
['<%ID> = alloca %".*', 'struct/class op', 'struct/class op'],
['<%ID> = alloca <%.*', 'struct/class op', 'struct/class op'],
['<%ID> = alloca <?{.*', 'struct/class op', 'struct/class op'],
['<%ID> = alloca opaque.*', 'struct/class op', 'struct/class op'],
['<%ID> = alloca <\d+ x i1>, .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x i2>, .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x i4>, .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x i8>, .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x i16>, .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x i32>, .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x i64>, .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x i128>, .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = alloca <\d+ x x86_fp80>, .*', '<d x float> operation', '<d x floating point> operation'],
['<%ID> = alloca <\d+ x float>, .*', '<d x float> operation', '<d x floating point> operation'],
['<%ID> = alloca <\d+ x double>, .*', '<d x double> operation', '<d x floating point> operation'],
['<%ID> = alloca <\d+ x \{ .* \}>, .*', '<d x structure> operation', '<d x structure> operation'],
['<%ID> = alloca <\d+ x i1>\*, .*', '<d x i1>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x i2>\*, .*', '<d x i2>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x i4>\*, .*', '<d x i4>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x i8>\*, .*', '<d x i8>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x i16>\*, .*', '<d x i16>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x i32>\*, .*', '<d x i32>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x i64>\*, .*', '<d x i64>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x i128>\*, .*', '<d x i128>* operation', '<d x int>* operation'],
['<%ID> = alloca <\d+ x x86_fp80>\*, .*', '<d x float>* operation', '<d x floating point>* operation'],
['<%ID> = alloca <\d+ x float>\*, .*', '<d x float>* operation', '<d x floating point>* operation'],
['<%ID> = alloca <\d+ x double>\*, .*', '<d x double>* operation', '<d x floating point>* operation'],
['<%ID> = alloca <\d+ x \{ .* \}>\*, .*', '<d x structure>* operation', '<d x structure>* operation'],
['<%ID> = alloca \[\d+ x i1\], .*', '[d x i1] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x i2\], .*', '[d x i2] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x i4\], .*', '[d x i4] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x i8\], .*', '[d x i8] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x i16\], .*', '[d x i16] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x i32\], .*', '[d x i32] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x i64\], .*', '[d x i64] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x i128\], .*', '[d x i128] operation', '[d x int] operation'],
['<%ID> = alloca \[\d+ x x86_fp80\], .*', '[d x float] operation', '[d x floating point] operation'],
['<%ID> = alloca \[\d+ x float\], .*', '[d x float] operation', '[d x floating point] operation'],
['<%ID> = alloca \[\d+ x double\], .*', '[d x double] operation', '[d x floating point] operation'],
['<%ID> = alloca \[\d+ x \{ .* \}\], .*', '[d x structure] operation', '[d x structure] operation'],
['<%ID> = alloca { { float, float } }, .*', '{ float, float } operation', 'complex operation'],
['<%ID> = alloca { { double, double } }, .*', '{ double, double } operation', 'complex operation'],
['<%ID> = load ' + any_of(opt_load) + '?i1, .*', 'i1 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i2, .*', 'i2 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i4, .*', 'i4 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i8, .*', 'i8 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i16, .*', 'i16 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i24, .*', 'i16 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i32, .*', 'i32 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i40, .*', 'i40 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i64, .*', 'i64 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i128, .*', 'i128 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i256, .*', 'i256 operation', 'int operation'],
['<%ID> = load ' + any_of(opt_load) + '?i1\*, .*', 'i1* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i2\*, .*', 'i2* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i4\*, .*', 'i4* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i8\*, .*', 'i8* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i16\*, .*', 'i16* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i24\*, .*', 'i16* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i32\*, .*', 'i32* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i40\*, .*', 'i40* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i64\*, .*', 'i64* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i128\*, .*', 'i128* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i256\*, .*', 'i256* operation', 'int* operation'],
['<%ID> = load ' + any_of(opt_load) + '?i1\*\*, .*', 'i1** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i2\*\*, .*', 'i2** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i4\*\*, .*', 'i4** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i8\*\*, .*', 'i8** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i16\*\*, .*', 'i16** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i24\*\*, .*', 'i16** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i32\*\*, .*', 'i32** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i40\*\*, .*', 'i40** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i64\*\*, .*', 'i64** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i128\*\*, .*', 'i128** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i256\*\*, .*', 'i256** operation', 'int** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i1\*\*\*, .*', 'i1*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i2\*\*\*, .*', 'i2*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i4\*\*\*, .*', 'i4*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i8\*\*\*, .*', 'i8*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i16\*\*\*, .*', 'i16*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i24\*\*\*, .*', 'i16*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i32\*\*\*, .*', 'i32*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i40\*\*\*, .*', 'i40*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i64\*\*\*, .*', 'i64*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i128\*\*\*, .*', 'i128*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?i256\*\*\*, .*', 'i256*** operation', 'int*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?x86_fp80, .*', 'float operation', 'floating point operation'],
['<%ID> = load ' + any_of(opt_load) + '?float, .*', 'float operation', 'floating point operation'],
['<%ID> = load ' + any_of(opt_load) + '?double, .*', 'double operation', 'floating point operation'],
['<%ID> = load ' + any_of(opt_load) + '?x86_fp80\*, .*', 'float* operation', 'floating point* operation'],
['<%ID> = load ' + any_of(opt_load) + '?float\*, .*', 'float* operation', 'floating point* operation'],
['<%ID> = load ' + any_of(opt_load) + '?double\*, .*', 'double* operation', 'floating point* operation'],
['<%ID> = load ' + any_of(opt_load) + '?x86_fp80\*\*, .*', 'float** operation', 'floating point** operation'],
['<%ID> = load ' + any_of(opt_load) + '?float\*\*, .*', 'float** operation', 'floating point** operation'],
['<%ID> = load ' + any_of(opt_load) + '?double\*\*, .*', 'double** operation', 'floating point** operation'],
['<%ID> = load ' + any_of(opt_load) + '?x86_fp80\*\*\*, .*', 'float*** operation', 'floating point*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?float\*\*\*, .*', 'float*** operation', 'floating point*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?double\*\*\*, .*', 'double*** operation', 'floating point*** operation'],
['<%ID> = load ' + any_of(opt_load) + '?%".*', 'struct/class op', 'struct/class op'],
['<%ID> = load ' + any_of(opt_load) + '?<%.*', 'struct/class op', 'struct/class op'],
['<%ID> = load ' + any_of(opt_load) + '?<?{.*', 'struct/class op', 'struct/class op'],
['<%ID> = load ' + any_of(opt_load) + '?opaque.*', 'struct/class op', 'struct/class op'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i1>, .*', '<d x i1> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i2>, .*', '<d x i2> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i4>, .*', '<d x i4> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i8>, .*', '<d x i8> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i16>, .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i24>, .*', '<d x i16> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i32>, .*', '<d x i32> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i40>, .*', '<d x i40> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i64>, .*', '<d x i64> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i128>, .*', '<d x i128> operation', '<d x int> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x x86_fp80>, .*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x float>, .*', '<d x float> operation',
'<d x floating point> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x double>, .*', '<d x double> operation',
'<d x floating point> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x \{ .* \}>, .*', '<d x structure> operation',
'<d x structure> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i1\*>, .*', '<d x i1*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i2\*>, .*', '<d x i2*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i4\*>, .*', '<d x i4*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i8\*>, .*', '<d x i8*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i16\*>, .*', '<d x i16*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i24\*>, .*', '<d x i16*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i32\*>, .*', '<d x i32*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i40\*>, .*', '<d x i40*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i64\*>, .*', '<d x i64*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i128\*>, .*', '<d x i128*> operation', '<d x int*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x x86_fp80\*>, .*', '<d x float*> operation',
'<d x floating point*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x float\*>, .*', '<d x float*> operation',
'<d x floating point*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x double\*>, .*', '<d x double*> operation',
'<d x floating point*> operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i1>\*, .*', '<d x i1>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i2>\*, .*', '<d x i2>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i4>\*, .*', '<d x i4>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i8>\*, .*', '<d x i8>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i16>\*, .*', '<d x i16>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i24>\*, .*', '<d x i16>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i32>\*, .*', '<d x i32>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i40>\*, .*', '<d x i40>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i64>\*, .*', '<d x i64>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x i128>\*, .*', '<d x i128>* operation', '<d x int>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x x86_fp80>\*, .*', '<d x float>* operation',
'<d x floating point>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x float>\*, .*', '<d x float>* operation',
'<d x floating point>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x double>\*, .*', '<d x double>* operation',
'<d x floating point>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x \{ .* \}>\*, .*', '<d x structure>* operation',
'<d x structure>* operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x x86_fp80>\*\*, .*', '<d x float>** operation',
'<d x floating point>** operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x float>\*\*, .*', '<d x float>** operation',
'<d x floating point>** operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x double>\*\*, .*', '<d x double>** operation',
'<d x floating point>** operation'],
['<%ID> = load ' + any_of(opt_load) + '?<\d+ x \{ .* \}>\*\*, .*', '<d x structure>** operation',
'<d x structure>** operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i1\], .*', '[d x i1] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i2\], .*', '[d x i2] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i4\], .*', '[d x i4] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i8\], .*', '[d x i8] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i16\], .*', '[d x i16] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i24\], .*', '[d x i16] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i32\], .*', '[d x i32] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i40\], .*', '[d x i40] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i64\], .*', '[d x i64] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i128\], .*', '[d x i128] operation', '[d x int] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x x86_fp80\], .*', '[d x float] operation',
'[d x floating point] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x float\], .*', '[d x float] operation',
'[d x floating point] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x double\], .*', '[d x double] operation',
'[d x floating point] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x \{ .* \}\], .*', '[d x structure] operation',
'[d x structure] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i1\]\*, .*', '[d x i1]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i2\]\*, .*', '[d x i2]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i4\]\*, .*', '[d x i4]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i8\]\*, .*', '[d x i8]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i16\]\*, .*', '[d x i16]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i32\]\*, .*', '[d x i32]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i40\]\*, .*', '[d x i40]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i64\]\*, .*', '[d x i64]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x i128\]\*, .*', '[d x i128]* operation', '[d x int]* operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x x86_fp80\]\*, .*', '[d x float]* operation',
'[d x floating point] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x float\]\*, .*', '[d x float]* operation',
'[d x floating point] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x double\]\*, .*', '[d x double]* operation',
'[d x floating point] operation'],
['<%ID> = load ' + any_of(opt_load) + '?\[\d+ x \{ .* \}\]\*, .*', '[d x structure]* operation',
'[d x floating point] operation'],
['<%ID> = load ' + any_of(opt_load) + '?.*\(.*\)\*+, .*', 'function operation', 'function operation'],
['store ' + any_of(opt_load) + '?i1 .*', 'i1 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i2 .*', 'i2 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i4 .*', 'i4 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i8 .*', 'i8 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i16 .*', 'i16 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i24 .*', 'i16 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i32 .*', 'i32 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i40 .*', 'i32 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i64 .*', 'i64 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i128 .*', 'i128 operation', 'int operation'],
['store ' + any_of(opt_load) + '?i1\* .*', 'i1* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i2\* .*', 'i2* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i4\* .*', 'i4* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i8\* .*', 'i8* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i16\* .*', 'i16* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i32\* .*', 'i32* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i64\* .*', 'i64* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i128\* .*', 'i128* operation', 'int* operation'],
['store ' + any_of(opt_load) + '?i1\*\* .*', 'i1** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?i2\*\* .*', 'i2** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?i4\*\* .*', 'i4** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?i8\*\* .*', 'i8** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?i16\*\* .*', 'i16** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?i32\*\* .*', 'i32** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?i64\*\* .*', 'i64** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?i128\*\* .*', 'i128** operation', 'int** operation'],
['store ' + any_of(opt_load) + '?x86_fp80 .*', 'float operation', 'floating point operation'],
['store ' + any_of(opt_load) + '?float .*', 'float operation', 'floating point operation'],
['store ' + any_of(opt_load) + '?double .*', 'double operation', 'floating point operation'],
['store ' + any_of(opt_load) + '?x86_fp80\* .*', 'float* operation', 'floating point* operation'],
['store ' + any_of(opt_load) + '?float\* .*', 'float* operation', 'floating point* operation'],
['store ' + any_of(opt_load) + '?double\* .*', 'double* operation', 'floating point* operation'],
['store ' + any_of(opt_load) + '?x86_fp80\*\* .*', 'float** operation', 'floating point** operation'],
['store ' + any_of(opt_load) + '?float\*\* .*', 'float** operation', 'floating point** operation'],
['store ' + any_of(opt_load) + '?double\*\* .*', 'double** operation', 'floating point** operation'],
['store ' + any_of(opt_load) + '?void \(.*', 'function op', 'function op'],
['store ' + any_of(opt_load) + '?%".*', 'struct/class op', 'struct/class op'],
['store ' + any_of(opt_load) + '?<%.*', 'struct/class op', 'struct/class op'],
['store ' + any_of(opt_load) + '?<?{.*', 'struct/class op', 'struct/class op'],
['store ' + any_of(opt_load) + '?opaque.*', 'struct/class op', 'struct/class op'],
['store ' + any_of(opt_load) + '?<\d+ x i1> .*', '<d x i1> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i2> .*', '<d x i2> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i4> .*', '<d x i4> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i8> .*', '<d x i8> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i16> .*', '<d x i16> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i32> .*', '<d x i32> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i64> .*', '<d x i64> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i128> .*', '<d x i128> operation', '<d x int> operation'],
['store ' + any_of(opt_load) + '?<\d+ x x86_fp80> .*', '<d x float> operation', '<d x floating point> operation'],
['store ' + any_of(opt_load) + '?<\d+ x float> .*', '<d x float> operation', '<d x floating point> operation'],
['store ' + any_of(opt_load) + '?<\d+ x double> .*', '<d x double> operation', '<d x floating point> operation'],
['store ' + any_of(opt_load) + '?<\d+ x \{ .* \}> .*', '<d x \{ .* \}> operation', '<d x \{ .* \}> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i1\*> .*', '<d x i1*> operation', '<d x int*> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i2\*> .*', '<d x i2*> operation', '<d x int*> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i4\*> .*', '<d x i4*> operation', '<d x int*> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i8\*> .*', '<d x i8*> operation', '<d x int*> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i16\*> .*', '<d x i16*> operation', '<d x int*> operation'],
['store ' + any_of(opt_load) + '?<\d+ x i32\*> .*', '<d x i32*> operation', '<d x int*> operation'],