[llvm] [GlobalIsel] Visit ICmp (PR #105991)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 09:20:34 PDT 2024


================
@@ -1884,6 +1881,28 @@ def cast_combines: GICombineGroup<[
   buildvector_of_truncate
 ]>;
 
+def visit_icmp : GICombineRule<
+  (defs root:$root, build_fn_matchinfo:$matchinfo),
+  (match (G_ICMP $root, $pred, $lhs, $rhs):$cmp,
+         [{ return Helper.visitICmp(*${cmp}, ${matchinfo}); }]),
+  (apply [{ Helper.applyBuildFn(*${cmp}, ${matchinfo}); }])>;
+
+def icmp_of_zero : GICombineRule<
----------------
tschuett wrote:

The icmp x, 0 combine has precise MIR pattern and is not part of the visit function. I would never ever do that.

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


More information about the llvm-commits mailing list