[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h

Chris Lattner sabre at nondot.org
Fri Mar 30 16:15:10 PDT 2007



Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.117 -> 1.118
---
Log message:

add one addressing mode description hook to rule them all.


---
Diffs of the changes:  (+21 -1)

 TargetLowering.h |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.117 llvm/include/llvm/Target/TargetLowering.h:1.118
--- llvm/include/llvm/Target/TargetLowering.h:1.117	Tue Mar 27 20:51:02 2007
+++ llvm/include/llvm/Target/TargetLowering.h	Fri Mar 30 18:14:50 2007
@@ -853,9 +853,29 @@
                                                      MachineBasicBlock *MBB);
 
   //===--------------------------------------------------------------------===//
-  // Loop Strength Reduction hooks
+  // Addressing mode description hooks (used by LSR etc).
   //
 
+  /// AddrMode - This represents an addressing mode of:
+  ///    BaseGV + BaseOffs + BaseReg + Scale*ScaleReg
+  /// If BaseGV is null,  there is no BaseGV.
+  /// If BaseOffs is zero, there is no base offset.
+  /// If HasBaseReg is false, there is no base register.
+  /// If Scale is zero, there is no ScaleReg.  Scale of 1 indicates a reg with
+  /// no scale.
+  ///
+  struct AddrMode {
+    GlobalValue *BaseGV;
+    int64_t      BaseOffs;
+    bool         HasBaseReg;
+    int64_t      Scale;
+  };
+  
+  /// isLegalAddressingMode - Return true if the addressing mode represented by
+  /// AM is legal for this target, for a load/store of the specified type.
+  /// TODO: Handle pre/postinc as well.
+  virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const;
+  
   /// isLegalAddressImmediate - Return true if the integer value can be used as
   /// the offset of the target addressing mode for load / store of the given
   /// type.






More information about the llvm-commits mailing list