@@ -125,14 +125,14 @@ def sign_extension_in_reg : GICombineRule<
125125 (apply [{ applyCombineSignExtendInReg(*${sign_inreg}, ${matchinfo}); }])>;
126126
127127// Do the following combines :
128- // fmul x, select(y, A, B) -> ldexp (x, select i32 (y, a, b))
129- // fmul x, select(y, -A, -B) -> ldexp ((fneg x), select i32 (y, a, b))
130- def combine_fmul_with_select_to_ldexp : GICombineRule<
128+ // fmul x, select(y, A, B) -> fldexp (x, select i32 (y, a, b))
129+ // fmul x, select(y, -A, -B) -> fldexp ((fneg x), select i32 (y, a, b))
130+ def combine_fmul_with_select_to_fldexp : GICombineRule<
131131 (defs root:$root, build_fn_matchinfo:$matchinfo),
132132 (match (G_FMUL $dst, $x, $select):$root,
133133 (G_SELECT $select, $y, $A, $B):$sel,
134- [{ return Helper.matchCombineFmulWithSelectToLdexp (*${root}, *${sel}, ${matchinfo}); }]),
135- (apply [{ Helper.applyBuildFn(*${root}, ${matchinfo}); }])>;
134+ [{ return Helper.matchCombineFmulWithSelectToFldexp (*${root}, *${sel}, ${matchinfo}); }]),
135+ (apply [{ Helper.applyBuildFn(*${root}, ${matchinfo}); }])>;
136136
137137
138138let Predicates = [Has16BitInsts, NotHasMed3_16] in {
@@ -163,13 +163,13 @@ def gfx8_combines : GICombineGroup<[expand_promoted_fmed3]>;
163163
164164def AMDGPUPreLegalizerCombiner: GICombiner<
165165 "AMDGPUPreLegalizerCombinerImpl",
166- [all_combines, clamp_i64_to_i16, foldable_fneg]> {
166+ [all_combines, combine_fmul_with_select_to_fldexp, clamp_i64_to_i16, foldable_fneg]> {
167167 let CombineAllMethodName = "tryCombineAllImpl";
168168}
169169
170170def AMDGPUPostLegalizerCombiner: GICombiner<
171171 "AMDGPUPostLegalizerCombinerImpl",
172- [all_combines, gfx6gfx7_combines, gfx8_combines,
172+ [all_combines, gfx6gfx7_combines, gfx8_combines, combine_fmul_with_select_to_fldexp,
173173 uchar_to_float, cvt_f32_ubyteN, remove_fcanonicalize, foldable_fneg,
174174 rcp_sqrt_to_rsq, fdiv_by_sqrt_to_rsq_f16, sign_extension_in_reg, smulu64]> {
175175 let CombineAllMethodName = "tryCombineAllImpl";
0 commit comments