diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-03-16 21:47:42 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-16 21:47:42 +0000 |
| commit | 714554d70717c73e0542ca93df36fa78765f87af (patch) | |
| tree | 19e23365fbd8f5341a24f7cdffec9ad0688cddfc /include/llvm/Target | |
| parent | 8aa777d5ea8e73e2edf79fd35fd6b5c4e9949ca7 (diff) | |
Added a way for TargetLowering to specify what values can be used as the
scale component of the target addressing mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
| -rw-r--r-- | include/llvm/Target/TargetLowering.h | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 0ec98a26c8..2f950b01a2 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -560,15 +560,6 @@ public: virtual bool isOperandValidForConstraint(SDOperand Op, char ConstraintLetter); //===--------------------------------------------------------------------===// - // 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; - virtual bool isLegalAddressImmediate(GlobalValue *GV) const; - - //===--------------------------------------------------------------------===// // Scheduler hooks // @@ -580,6 +571,34 @@ public: virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, MachineBasicBlock *MBB); + //===--------------------------------------------------------------------===// + // 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; + 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(); + } + +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; + private: TargetMachine &TM; const TargetData &TD; |
