9
9
//===----------------------------------------------------------------------===//
10
10
include "llvm/Target/GlobalISel/Combine.td"
11
11
12
+ def aie_all_combines : GICombineGroup<[trivial_combines, vector_ops_combines,
13
+ insert_vec_elt_combines, extract_vec_elt_combines, combines_for_extload,
14
+ combine_extracted_vector_load,
15
+ undef_combines, identity_combines, phi_combines,
16
+ simplify_add_to_sub, hoist_logic_op_with_same_opcode_hands, shifts_too_big,
17
+ reassocs, ptr_add_immed_chain,
18
+ shl_ashr_to_sext_inreg, sext_inreg_of_load,
19
+ width_reduction_combines, select_combines,
20
+ known_bits_simplifications, ext_ext_fold,
21
+ not_cmp_fold, opt_brcond_by_inverting_cond,
22
+ unmerge_merge, unmerge_cst, unmerge_dead_to_trunc,
23
+ unmerge_zext_to_zext, merge_unmerge, trunc_ext_fold, trunc_shift,
24
+ const_combines, xor_of_and_with_same_reg, ptr_add_with_zero,
25
+ shift_immed_chain, shift_of_shifted_logic_chain, load_or_combine,
26
+ div_rem_to_divrem, funnel_shift_combines, commute_shift,
27
+ form_bitfield_extract, constant_fold_binops, constant_fold_fma,
28
+ constant_fold_cast_op, fabs_fneg_fold,
29
+ intdiv_combines, mulh_combines, redundant_neg_operands,
30
+ and_or_disjoint_mask, fma_combines, fold_binop_into_select,
31
+ sub_add_reg, select_to_minmax, redundant_binop_in_equality,
32
+ fsub_to_fneg, commute_constant_to_rhs, match_ands, match_ors,
33
+ double_icmp_zero_and_or_combine, match_addos, combine_shuffle_concat]>;
34
+
12
35
// AIE-specific offset folding for G_GLOBAL_VALUE.
13
36
def combine_globalval_offset_matchdata : GIDefMatchData<"uint64_t">;
14
37
def combine_globalval_offset : GICombineRule<
@@ -34,6 +57,13 @@ def combine_extract_vector_elt_and_zsa_ext : GICombineRule<
34
57
(apply [{ applyExtractVecEltAndExt(*${root}, MRI, B, ${matchinfo}); }])
35
58
>;
36
59
60
+ def combine_symmetric_build_vector : GICombineRule<
61
+ (defs root:$root, build_fn_matchinfo:$matchinfo),
62
+ (match (wip_match_opcode G_BUILD_VECTOR): $root,
63
+ [{ return matchSymmetricBuildVector(*${root}, MRI, Observer, ${matchinfo}); }]),
64
+ (apply [{ Helper.applyBuildFnNoErase(*${root}, ${matchinfo}); }])
65
+ >;
66
+
37
67
def combine_splat_vector_matchdata: GIDefMatchData<"std::pair<Register, Register>">;
38
68
def combine_splat_vector : GICombineRule<
39
69
(defs root:$root, combine_splat_vector_matchdata:$matchinfo),
@@ -122,19 +152,20 @@ def combine_vector_shuffle_bcst_to_copy : GICombineRule<
122
152
123
153
def AIE2PreLegalizerCombiner
124
154
: GICombiner<"AIE2PreLegalizerCombinerImpl", [ combine_unpad_vector, combine_pad_vector,
125
- all_combines , combine_S20NarrowingOpt,
155
+ aie_all_combines , combine_S20NarrowingOpt,
126
156
combine_globalval_offset,
127
157
combine_extract_vector_elt_and_zsa_ext,
128
158
combine_splat_vector, combine_concat_to_pad_vector,
129
- combine_single_diff_build_vector]> {
159
+ combine_single_diff_build_vector,
160
+ combine_symmetric_build_vector]> {
130
161
let CombineAllMethodName = "tryCombineAllImpl";
131
162
}
132
163
133
164
def AIE2PPreLegalizerCombiner
134
165
: GICombiner<"AIE2PPreLegalizerCombinerImpl", [ combine_unpad_vector, combine_pad_vector,
135
166
combine_vector_shuffle_to_copy,
136
167
combine_vector_shuffle_extract_subvec,
137
- all_combines , combine_S20NarrowingOpt,
168
+ aie_all_combines , combine_S20NarrowingOpt,
138
169
combine_globalval_offset,
139
170
combine_extract_vector_elt_and_zsa_ext,
140
171
combine_splat_vector,
@@ -145,16 +176,17 @@ def AIE2PPreLegalizerCombiner
145
176
combine_vector_shuffle_broadcast,
146
177
combine_single_diff_build_vector,
147
178
combine_vector_shuffle_to_extract_insert_elt,
148
- combine_vector_shuffle_concat_extracted_subvectors]> {
179
+ combine_vector_shuffle_concat_extracted_subvectors,
180
+ combine_symmetric_build_vector]> {
149
181
let CombineAllMethodName = "tryCombineAllImpl";
150
182
}
151
183
152
184
def AIE2PostLegalizerGenericCombiner
153
- : GICombiner<"AIE2PostLegalizerGenericCombinerImpl", [ all_combines ]> {
185
+ : GICombiner<"AIE2PostLegalizerGenericCombinerImpl", [ aie_all_combines ]> {
154
186
}
155
187
156
188
def AIE2PPostLegalizerGenericCombiner
157
- : GICombiner<"AIE2PPostLegalizerGenericCombinerImpl", [ all_combines ]> {
189
+ : GICombiner<"AIE2PPostLegalizerGenericCombinerImpl", [ aie_all_combines ]> {
158
190
}
159
191
160
192
def combine_extract_concat_matchdata: GIDefMatchData<"Register">;
0 commit comments