diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-03-12 23:26:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-03-12 23:26:27 +0000 |
commit | 4603b402eb5929870026f60d11c068432d2c9b85 (patch) | |
tree | a432a4d6cc4f18843eb70a1c9e42444f03c72aec /include/llvm/Target/TargetLowering.h | |
parent | 37e8856f74905b664a6506a8ce8f145e3f36184c (diff) | |
download | external_llvm-4603b402eb5929870026f60d11c068432d2c9b85.zip external_llvm-4603b402eb5929870026f60d11c068432d2c9b85.tar.gz external_llvm-4603b402eb5929870026f60d11c068432d2c9b85.tar.bz2 |
More flexible TargetLowering LSR hooks for testing whether an immediate is
a legal target address immediate or scale.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetLowering.h')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index fa67e0c..7fedc38 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -856,18 +856,18 @@ public: // Loop Strength Reduction hooks // - /// isLegalAddressImmediate - Return true if the integer value or GlobalValue - /// can be used as the offset of the target addressing mode. - virtual bool isLegalAddressImmediate(int64_t V) 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. + 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; - typedef std::vector<unsigned>::const_iterator legal_am_scale_iterator; - legal_am_scale_iterator legal_am_scale_begin() const { - return LegalAddressScales.begin(); - } - legal_am_scale_iterator legal_am_scale_end() const { - return LegalAddressScales.end(); - } + /// isLegalAddressScale - Return true if the integer value can be used as the + /// scale of the target addressing mode for load / store of the given type. + virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; //===--------------------------------------------------------------------===// // Div utility functions @@ -906,17 +906,7 @@ public: return CmpLibcallCCs[Call]; } -protected: - /// addLegalAddressScale - Add a integer (> 1) value which can be used as - /// scale in the target addressing mode. Note: the ordering matters so the - /// least efficient ones should be entered first. - void addLegalAddressScale(unsigned Scale) { - LegalAddressScales.push_back(Scale); - } - private: - std::vector<unsigned> LegalAddressScales; - TargetMachine &TM; const TargetData *TD; |