Add isExtractSubreg property.
[oota-llvm.git] / include / llvm / MC / MCInstrDesc.h
index 72bf3ef0574992efe93cff033b663cb86aa5b62a..03b74256850668754b8200583605b7fdd4404a27 100644 (file)
@@ -126,7 +126,8 @@ namespace MCID {
     CheapAsAMove,
     ExtraSrcRegAllocReq,
     ExtraDefRegAllocReq,
-    RegSequence
+    RegSequence,
+    ExtractSubreg
   };
 }
 
@@ -370,6 +371,21 @@ public:
   /// override accordingly.
   bool isRegSequenceLike() const { return Flags & (1 << MCID::RegSequence); }
 
+  /// \brief Return true if this instruction behaves
+  /// the same way as the generic EXTRACT_SUBREG instructions.
+  /// E.g., on ARM,
+  /// rX, rY VMOVRRD dZ
+  /// is equivalent to two EXTRACT_SUBREG:
+  /// rX = EXTRACT_SUBREG dZ, ssub_0
+  /// rY = EXTRACT_SUBREG dZ, ssub_1
+  ///
+  /// Note that for the optimizers to be able to take advantage of
+  /// this property, TargetInstrInfo::getExtractSubregLikeInputs has to be
+  /// override accordingly.
+  bool isExtractSubregLike() const {
+    return Flags & (1 << MCID::ExtractSubreg);
+  }
+
   //===--------------------------------------------------------------------===//
   // Side Effect Analysis
   //===--------------------------------------------------------------------===//