[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp PPCISelLowering.h

Evan Cheng evan.cheng at apple.com
Mon Mar 12 16:29:18 PDT 2007



Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.260 -> 1.261
PPCISelLowering.h updated: 1.61 -> 1.62
---
Log message:

More flexible TargetLowering LSR hooks for testing whether an immediate is a legal target address immediate or scale.

---
Diffs of the changes:  (+10 -5)

 PPCISelLowering.cpp |    5 +++--
 PPCISelLowering.h   |   10 +++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.260 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.261
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.260	Mon Mar  5 18:59:59 2007
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Mon Mar 12 18:29:01 2007
@@ -3152,8 +3152,9 @@
 }
 
 /// isLegalAddressImmediate - Return true if the integer value can be used
-/// as the offset of the target addressing mode.
-bool PPCTargetLowering::isLegalAddressImmediate(int64_t V) const {
+/// as the offset of the target addressing mode for load / store of the
+/// given type.
+bool PPCTargetLowering::isLegalAddressImmediate(int64_t V,const Type *Ty) const{
   // PPC allows a sign-extended 16-bit immediate field.
   return (V > -(1 << 16) && V < (1 << 16)-1);
 }


Index: llvm/lib/Target/PowerPC/PPCISelLowering.h
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.h:1.61 llvm/lib/Target/PowerPC/PPCISelLowering.h:1.62
--- llvm/lib/Target/PowerPC/PPCISelLowering.h:1.61	Thu Mar  1 07:11:38 2007
+++ llvm/lib/Target/PowerPC/PPCISelLowering.h	Mon Mar 12 18:29:01 2007
@@ -237,9 +237,13 @@
                                           SelectionDAG &DAG);
 
     /// isLegalAddressImmediate - Return true if the integer value can be used
-    /// as the offset of the target addressing mode.
-    virtual bool isLegalAddressImmediate(int64_t V) const;
-    virtual bool isLegalAddressImmediate(llvm::GlobalValue*) const;
+    /// as the offset of the target addressing mode for load / store of the
+    /// given type.
+    virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const;
+
+    /// isLegalAddressImmediate - Return true if the GlobalValue can be used as
+    /// the offset of the target addressing mode.
+    virtual bool isLegalAddressImmediate(GlobalValue *GV) const;
 
     SDOperand LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG);
   };






More information about the llvm-commits mailing list