Changes in directory llvm/include/llvm/Target:
TargetLowering.h updated: 1.60 -> 1.61 --- Log message: Added a way for TargetLowering to specify what values can be used as the scale component of the target addressing mode. --- Diffs of the changes: (+28 -9) TargetLowering.h | 37 ++++++++++++++++++++++++++++--------- 1 files changed, 28 insertions(+), 9 deletions(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.60 llvm/include/llvm/Target/TargetLowering.h:1.61 --- llvm/include/llvm/Target/TargetLowering.h:1.60 Mon Mar 13 17:15:27 2006 +++ llvm/include/llvm/Target/TargetLowering.h Thu Mar 16 15:47:42 2006 @@ -560,15 +560,6 @@ 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 @@ 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; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits