[llvm] [RISCV] Add MachineCombiner to fold (sh3add Z, (add X, (slli Y, 6))) -> (sh3add (sh3add Y, Z), X). (PR #87884)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 10:05:14 PDT 2024


================
@@ -1918,6 +1999,78 @@ static void combineFPFusedMultiply(MachineInstr &Root, MachineInstr &Prev,
   DelInstrs.push_back(&Root);
 }
 
+// Combine (sh3add Z, (add X, (slli Y, 5))) to (sh3add (sh2add Y, Z), X).
----------------
wangpc-pp wrote:

`(sh3add Z, (add X, (slli Y, 5))) to (sh3add (sh2add Y, Z), X)` is too specific to the implementation below.

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


More information about the llvm-commits mailing list