[llvm] [RISCV] Add macro fusion support for the Xqci extension instructions (PR #209542)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 14:54:04 PDT 2026


================
@@ -0,0 +1,146 @@
+//==---- RISCVMacroFusionXQCI.td - Macro Fusions for XQCI -----*- tablegen-*-=//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// ===---------------------------------------------------------------------===//
+// The following definitions describe macro fusion predicators applicable to
+// Xqci instructions.
+
+// Fuse two instructions where the destination register of the first
+// instruction is the same as the destination register of the second
+// instruction.
+class FirstRdEqSecondRdFusion<string name, string fieldName, string desc,
+                   MCInstPredicate firstPred, MCInstPredicate secondPred,
+                   int secondOpIdx=0, int firstOpIdx=0>
+  : Fusion<name, fieldName, desc,
+           [
+             SecondFusionPredicateWithMCInstPredicate<secondPred>,
+             WildcardTrue,
+             FirstFusionPredicateWithMCInstPredicate<firstPred>,
+             TieReg<firstOpIdx, secondOpIdx>
+           ]>;
+
+// Fuse two operations without tying any of their register operands.
+class XqciFusionNoTie<string name, string fieldName, string desc,
+                        MCInstPredicate firstPred, MCInstPredicate secondPred>
----------------
topperc wrote:

indented too far

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


More information about the llvm-commits mailing list