Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to 16-byte...
[oota-llvm.git] / include / llvm / Target / TargetLowering.h
index b010a69ef7217f0d2b303946b0124930639d5f2d..4f04ce34fc6da02e1aa8c79288350439d6c6054a 100644 (file)
@@ -548,17 +548,23 @@ public:
 
   /// getIfCvtBlockLimit - returns the target specific if-conversion block size
   /// limit. Any block whose size is greater should not be predicated.
-  virtual unsigned getIfCvtBlockSizeLimit() const {
+  unsigned getIfCvtBlockSizeLimit() const {
     return IfCvtBlockSizeLimit;
   }
 
   /// getIfCvtDupBlockLimit - returns the target specific size limit for a
   /// block to be considered for duplication. Any block whose size is greater
   /// should not be duplicated to facilitate its predication.
-  virtual unsigned getIfCvtDupBlockSizeLimit() const {
+  unsigned getIfCvtDupBlockSizeLimit() const {
     return IfCvtDupBlockSizeLimit;
   }
 
+  /// getPrefLoopAlignment - return the preferred loop alignment.
+  ///
+  unsigned getPrefLoopAlignment() const {
+    return PrefLoopAlignment;
+  }
+  
   /// getPreIndexedAddressParts - returns true by value, base pointer and
   /// offset pointer and addressing mode by reference if the node's address
   /// can be legally represented as pre-indexed load / store address.
@@ -583,7 +589,7 @@ public:
   /// jumptable.
   virtual SDOperand getPICJumpTableRelocBase(SDOperand Table,
                                              SelectionDAG &DAG) const;
-  
+
   //===--------------------------------------------------------------------===//
   // TargetLowering Optimization Methods
   //
@@ -890,6 +896,12 @@ protected:
   void setIfCvtDupBlockSizeLimit(unsigned Limit) {
     IfCvtDupBlockSizeLimit = Limit;
   }
+
+  /// setPrefLoopAlignment - Set the target's preferred loop alignment. Default
+  /// alignment is zero, it means the target does not care about loop alignment.
+  void setPrefLoopAlignment(unsigned Align) {
+    PrefLoopAlignment = Align;
+  }
   
 public:
 
@@ -1276,6 +1288,10 @@ private:
   /// duplicated during if-conversion.
   unsigned IfCvtDupBlockSizeLimit;
 
+  /// PrefLoopAlignment - The perferred loop alignment.
+  ///
+  unsigned PrefLoopAlignment;
+
   /// StackPointerRegisterToSaveRestore - If set to a physical register, this
   /// specifies the register that llvm.savestack/llvm.restorestack should save
   /// and restore.