diff options
author | Chris Lattner <sabre@nondot.org> | 2007-03-30 23:14:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-03-30 23:14:50 +0000 |
commit | 1436bb657d22b01fd9a526ee7f9b2cb880c064a7 (patch) | |
tree | 7abf3bb09d672ebbd60d48d202c637a1ab892782 /include | |
parent | 00ef8d45e2b17717d1c25ccb0c967325bf23b506 (diff) | |
download | external_llvm-1436bb657d22b01fd9a526ee7f9b2cb880c064a7.zip external_llvm-1436bb657d22b01fd9a526ee7f9b2cb880c064a7.tar.gz external_llvm-1436bb657d22b01fd9a526ee7f9b2cb880c064a7.tar.bz2 |
add one addressing mode description hook to rule them all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 4af25d8..5cdad25 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -853,9 +853,29 @@ public: MachineBasicBlock *MBB); //===--------------------------------------------------------------------===// - // Loop Strength Reduction hooks + // Addressing mode description hooks (used by LSR etc). // + /// AddrMode - This represents an addressing mode of: + /// BaseGV + BaseOffs + BaseReg + Scale*ScaleReg + /// If BaseGV is null, there is no BaseGV. + /// If BaseOffs is zero, there is no base offset. + /// If HasBaseReg is false, there is no base register. + /// If Scale is zero, there is no ScaleReg. Scale of 1 indicates a reg with + /// no scale. + /// + struct AddrMode { + GlobalValue *BaseGV; + int64_t BaseOffs; + bool HasBaseReg; + int64_t Scale; + }; + + /// isLegalAddressingMode - Return true if the addressing mode represented by + /// AM is legal for this target, for a load/store of the specified type. + /// TODO: Handle pre/postinc as well. + virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty) 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. |