[llvm] [GlobalISel] Combine (X >> C) << C to X & ((-1 >> C) << C) (PR #114821)
Dávid Ferenc Szabó via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 5 06:40:13 PST 2024
================
@@ -365,6 +365,13 @@ def bitreverse_lshr : GICombineRule<
MRI.getType(${amt}.getReg())}}); }]),
(apply (G_SHL $d, $val, $amt))>;
+def lsb_bits_clearing_by_shifts_to_and: GICombineRule<
+ (defs root:$root, build_fn_matchinfo:$matchinfo),
+ (match (G_LSHR $d, $src, $amt1),
+ (G_SHL $root, $d, $amt2):$root,
----------------
dfszabo wrote:
I did but the problem was that there are two case: one where they both use the same G_CONSTANT and the other where they use two different G_CONSTANT, but with the same value. The two different constant case was working but if I added another similar pattern with one and both G_LSHR and G_SHL use that it throwed tablegen errors.
https://github.com/llvm/llvm-project/pull/114821
More information about the llvm-commits
mailing list