[llvm] [RISCV] add more generic macrofusions (PR #151140)
Daniel Henrique Barboza via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 1 04:35:36 PDT 2025
================
@@ -91,3 +100,87 @@ def TuneLDADDFusion
CheckIsImmOperand<2>,
CheckImmOperand<2, 0>
]>>;
+
+// Fuse add with lw:
+// add rd, rs1, rs2
+// lw rd, 0(rd)
+def TuneADDLWFusion
+ : SimpleFusion<"add-lw-fusion", "HasADDLWFusion", "Enable ADD+LW macrofusion",
+ CheckOpcode<[ADD]>,
+ CheckAll<[
+ CheckOpcode<[LW]>,
+ CheckIsImmOperand<2>,
+ CheckImmOperand<2, 0>
+ ]>>;
+
+// Fuse add followed by a load (lb, lh, lw, ld, lbu, lhu, lwu):
+// add rd, rs1, rs2
+// load rd, 0(rd)
----------------
danielhb wrote:
It doesn't. I forgot to update the comment after removing the immediate check. I'll fix it
https://github.com/llvm/llvm-project/pull/151140
More information about the llvm-commits
mailing list