[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h
Evan Cheng
evan.cheng at apple.com
Mon Mar 12 16:26:44 PDT 2007
Changes in directory llvm/include/llvm/Target:
TargetLowering.h updated: 1.111 -> 1.112
---
Log message:
More flexible TargetLowering LSR hooks for testing whether an immediate is
a legal target address immediate or scale.
---
Diffs of the changes: (+10 -20)
TargetLowering.h | 30 ++++++++++--------------------
1 files changed, 10 insertions(+), 20 deletions(-)
Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.111 llvm/include/llvm/Target/TargetLowering.h:1.112
--- llvm/include/llvm/Target/TargetLowering.h:1.111 Wed Mar 7 10:25:08 2007
+++ llvm/include/llvm/Target/TargetLowering.h Mon Mar 12 18:26:27 2007
@@ -856,18 +856,18 @@
// 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 @@
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;
More information about the llvm-commits
mailing list