[llvm] [GISel] Funnel shift combiner port from SelectionDAG ISel to GlobalISel (PR #135132)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 13:06:25 PDT 2025


================
@@ -1033,6 +1033,26 @@ def funnel_shift_overshift: GICombineRule<
   (apply [{ Helper.applyFunnelShiftConstantModulo(*${root}); }])
 >;
 
+// Transform: fshl x, z, y | shl x, y -> fshl x, z, y
+def funnel_shift_or_shift_to_funnel_shift_left: GICombineRule<
+  (defs root:$root), 
+  (match (G_FSHL $out1, $x, $z, $y),
+         (G_SHL $out2, $x, $y),
+         (G_OR $root, $out1, $out2),
+         [{ return MRI.hasOneUse(${out2}.getReg()); }]),
----------------
arsenm wrote:

```suggestion
         [{ return MRI.hasOneNonDBGUse(${out2}.getReg()); }]),
```

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


More information about the llvm-commits mailing list