[RegisterCoalescer] Add new subtarget hook allowing targets to opt-out of coalescing.
[oota-llvm.git] / include / llvm / Target / TargetSubtargetInfo.h
index bbb83efc780bc25049f82334af2051d9ec220df8..e2aea45f4c1d8d2a7c050945138960f398543250 100644 (file)
@@ -115,6 +115,16 @@ public:
 
   /// \brief Reset the features for the subtarget.
   virtual void resetSubtargetFeatures(const MachineFunction *MF) { }
+
+  /// \brief SrcRC and DstRC will be morphed into NewRC if this returns true.
+  virtual bool shouldCoalesce(MachineInstr *MI,
+                              const TargetRegisterClass *SrcRC,
+                              unsigned SubReg,
+                              const TargetRegisterClass *DstRC,
+                              unsigned DstSubReg,
+                              const TargetRegisterClass *NewRC) const
+  { return true; }
+
 };
 
 } // End llvm namespace