Replace TargetLowering::isIntImmLegal() with
[oota-llvm.git] / include / llvm / TargetTransformInfo.h
index 519ccb92630b783f1d2903216787ad936c34e467..59fcf3b78558464e45f898394ea33c5927144e13 100644 (file)
@@ -140,6 +140,13 @@ public:
   virtual PopcntHwSupport getPopcntHwSupport(unsigned IntTyWidthInBit) const {
     return None;
   }
+
+  /// getIntImmCost - Return the expected cost of materializing the given
+  /// integer immediate of the specified type.
+  virtual unsigned getIntImmCost(const APInt&, Type*) const {
+    // Default assumption is immediate is cheap.
+    return 1;
+  }
 };
 
 /// VectorTargetTransformInfo - This interface is used by the vectorizers