MachineCSE: Add a target query for the LookAheadLimit heurisitic
[oota-llvm.git] / include / llvm / Target / TargetInstrInfo.h
index f9c1e523e5a843d56d965e1556c3f658d226ef2b..2b0a888fa77d5495b98363c703e379096db3355e 100644 (file)
@@ -1235,6 +1235,14 @@ public:
     return false;
   }
 
+  /// \brief Return the value to use for the MachineCSE's LookAheadLimit,
+  /// which is a heuristic used for CSE'ing phys reg defs.
+  virtual unsigned getMachineCSELookAheadLimit () const {
+    // The default lookahead is small to prevent unprofitable quadratic
+    // behavior.
+    return 5;
+  }
+
 private:
   int CallFrameSetupOpcode, CallFrameDestroyOpcode;
 };