[TLI] Add a new hook to TargetLowering to query the target if a load of a constant...
[oota-llvm.git] / include / llvm / Target / TargetLowering.h
index c8351b7c5ef747b695f91e8454c4736b575c951d..e9d87291aae75176b3e2e51b216051d665653df4 100644 (file)
@@ -1287,6 +1287,15 @@ public:
     return false;
   }
 
+  /// \brief Return true if it is beneficial to convert a load of a constant to
+  /// just the constant itself.
+  /// On some targets it might be more efficient to use a combination of
+  /// arithmetic instructions to materialize the constant instead of loading it
+  /// from a constant pool.
+  virtual bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
+                                                 Type *Ty) const {
+    return false;
+  }
   //===--------------------------------------------------------------------===//
   // Runtime Library hooks
   //