[llvm] [RISCV] add more generic macrofusions (PR #151140)

Daniel Henrique Barboza via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 1 04:34:48 PDT 2025


================
@@ -28,6 +28,15 @@ def TuneAUIPCADDIFusion
                  CheckOpcode<[AUIPC]>,
                  CheckOpcode<[ADDI]>>;
 
+// Fuse AUIPC followed by ADDIW:
+//   auipc rd, imm20
+//   addiw rd, rd, imm12
+def TuneAUIPCADDIWFusion
+  : SimpleFusion<"auipc-addiw-fusion", "HasAUIPCADDIWFusion",
+                 "Enable AUIPC+ADDIW macrofusion",
+                 CheckOpcode<[AUIPC]>,
+                 CheckOpcode<[ADDIW]>>;
----------------
danielhb wrote:

This was added because the design happens to support it, but we can remove it. In fact I struggle to see this one in my spec runs, although auipc + addi is very popular 

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


More information about the llvm-commits mailing list