[llvm] GlobalISel needs fdiv 1 / sqrt(x) to rsq combine (PR #78673)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 23:39:30 PST 2024


================
@@ -33,6 +33,11 @@ def rcp_sqrt_to_rsq : GICombineRule<
          [{ return matchRcpSqrtToRsq(*${rcp}, ${matchinfo}); }]),
   (apply [{ Helper.applyBuildFn(*${rcp}, ${matchinfo}); }])>;
 
+def fdiv_1_by_sqrt_to_rsq : GICombineRule<
+  (defs root:$root, build_fn_matchinfo:$matchinfo),
+  (match (wip_match_opcode G_FSQRT, G_FDIV):$root,
----------------
tschuett wrote:

You can remove the `G_FSQRT`.

https://github.com/llvm/llvm-project/pull/78673


More information about the llvm-commits mailing list