diff options
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 18 | ||||
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.h | 11 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index bd7fa5cf6c..17a41c5aaa 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -1379,6 +1379,24 @@ bool ARMTargetLowering::isLegalAddressScale(int64_t S, const Type *Ty) const { } } +/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale +/// and V works for isLegalAddressImmediate _and_ both can be applied +/// simultaneously to the same instruction. +bool ARMTargetLowering::isLegalAddressScaleAndImm(int64_t S, int64_t V, + const Type* Ty) const { + if (V == 0) + return isLegalAddressScale(S, Ty); + return false; +} + +/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale +/// and GV works for isLegalAddressImmediate _and_ both can be applied +/// simultaneously to the same instruction. +bool ARMTargetLowering::isLegalAddressScaleAndImm(int64_t S, + GlobalValue *GV) const { + return false; +} + static bool getIndexedAddressParts(SDNode *Ptr, MVT::ValueType VT, bool isSEXTLoad, SDOperand &Base, SDOperand &Offset, bool &isInc, diff --git a/lib/Target/ARM/ARMISelLowering.h b/lib/Target/ARM/ARMISelLowering.h index dc146ba0d5..1675e9cffe 100644 --- a/lib/Target/ARM/ARMISelLowering.h +++ b/lib/Target/ARM/ARMISelLowering.h @@ -100,6 +100,17 @@ namespace llvm { /// type. virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; + /// isLegalAddressScaleAndImm - Return true if S works for + /// IsLegalAddressScale and V works for isLegalAddressImmediate _and_ + /// both can be applied simultaneously to the same instruction. + virtual bool isLegalAddressScaleAndImm(int64_t S, int64_t V, + const Type *Ty) const; + + /// isLegalAddressScaleAndImm - Return true if S works for + /// IsLegalAddressScale and GV works for isLegalAddressImmediate _and_ + /// both can be applied simultaneously to the same instruction. + virtual bool isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV) const; + /// 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. |