[llvm] [TableGen][MacroFusion] Predicate if the first inst has the same register (PR #137778)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 1 02:56:33 PDT 2025


================
@@ -55,11 +55,20 @@ class TieReg<int firstOpIdx, int secondOpIdx> : BothFusionPredicate {
   int SecondOpIdx = secondOpIdx;
 }
 
+// The operand of `FirstMI` at position `firstOpIdx` should be the same as the
+// operand at position `secondOpIdx`.
+// If the fusion has `IsCommutable` being true and the operand at `secondOpIdx`
+// has commutable operand, then the commutable operand will be checked too.
+class FirstSameReg<int firstOpIdx, int secondOpIdx> : FirstFusionPredicate {
----------------
arsenm wrote:

It's doubly confusing because this is referring to first and second meaning the instructions and first and second as in the operands. What about

FirstInstOperandsAreSameReg, etc. 

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


More information about the llvm-commits mailing list