More flexible TargetLowering LSR hooks for testing whether an immediate is a legal...
authorEvan Cheng <evan.cheng@apple.com>
Mon, 12 Mar 2007 23:29:01 +0000 (23:29 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 12 Mar 2007 23:29:01 +0000 (23:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35074 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h

index b11b1f79b4e3169e2ee1ed415cbf973d3b4a178d..5e6e8004c7d49badb6a000e7bf9e3f392a52e85e 100644 (file)
@@ -3152,8 +3152,9 @@ isOperandValidForConstraint(SDOperand Op, char Letter, SelectionDAG &DAG) {
 }
 
 /// 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 009ceb0d9666412879d9f055adc1454be6d55cfb..cc1f032493f0031a27abd47c3afbb7cd27c7395c 100644 (file)
@@ -237,9 +237,13 @@ namespace llvm {
                                           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);
   };