[Machine Combiner] Refactor machine reassociation code to be target-independent.
[oota-llvm.git] / include / llvm / CodeGen / MachineCombinerPattern.h
index 176af14dc317675a8955d1de86d741ac4229abf7..d8462888ec772c4dceecaa44f50498f755dc8666 100644 (file)
@@ -22,7 +22,29 @@ namespace llvm {
 ///
 namespace MachineCombinerPattern {
 // Forward declaration
-enum MC_PATTERN : int;
+enum MC_PATTERN : int {
+  // These are commutative variants for reassociating a computation chain. See
+  // the comments before getMachineCombinerPatterns() in TargetInstrInfo.cpp.
+  MC_REASSOC_AX_BY = 0,
+  MC_REASSOC_AX_YB = 1,
+  MC_REASSOC_XA_BY = 2,
+  MC_REASSOC_XA_YB = 3,
+
+  /// Enumeration of instruction pattern supported by AArch64 machine combiner
+  MC_NONE,
+  MC_MULADDW_OP1,
+  MC_MULADDW_OP2,
+  MC_MULSUBW_OP1,
+  MC_MULSUBW_OP2,
+  MC_MULADDWI_OP1,
+  MC_MULSUBWI_OP1,
+  MC_MULADDX_OP1,
+  MC_MULADDX_OP2,
+  MC_MULSUBX_OP1,
+  MC_MULSUBX_OP2,
+  MC_MULADDXI_OP1,
+  MC_MULSUBXI_OP1
+};
 } // end namespace MachineCombinerPattern
 } // end namespace llvm