diff options
| -rw-r--r-- | llvm/include/llvm/Target/TargetTransformImpl.h | 4 | ||||
| -rw-r--r-- | llvm/include/llvm/TargetTransformInfo.h | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/TargetTransformImpl.cpp | 10 |
3 files changed, 14 insertions, 4 deletions
diff --git a/llvm/include/llvm/Target/TargetTransformImpl.h b/llvm/include/llvm/Target/TargetTransformImpl.h index a285f5ba8f4..20699276196 100644 --- a/llvm/include/llvm/Target/TargetTransformImpl.h +++ b/llvm/include/llvm/Target/TargetTransformImpl.h @@ -37,7 +37,9 @@ public: virtual bool isLegalICmpImmediate(int64_t imm) const; - virtual bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const; + virtual bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, + int64_t BaseOffset, bool HasBaseReg, + int64_t Scale) const; virtual bool isTruncateFree(Type *Ty1, Type *Ty2) const; diff --git a/llvm/include/llvm/TargetTransformInfo.h b/llvm/include/llvm/TargetTransformInfo.h index 7dd95a79c2d..9a02e621043 100644 --- a/llvm/include/llvm/TargetTransformInfo.h +++ b/llvm/include/llvm/TargetTransformInfo.h @@ -109,7 +109,9 @@ public: /// The type may be VoidTy, in which case only return true if the addressing /// mode is legal for a load/store of any legal type. /// TODO: Handle pre/postinc as well. - virtual bool isLegalAddressingMode(const AddrMode &AM, Type *Ty) const { + virtual bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, + int64_t BaseOffset, bool HasBaseReg, + int64_t Scale) const { return false; } /// isTruncateFree - Return true if it's free to truncate a value of diff --git a/llvm/lib/Target/TargetTransformImpl.cpp b/llvm/lib/Target/TargetTransformImpl.cpp index 08795fcaf1f..63f34a8c909 100644 --- a/llvm/lib/Target/TargetTransformImpl.cpp +++ b/llvm/lib/Target/TargetTransformImpl.cpp @@ -27,8 +27,14 @@ bool ScalarTargetTransformImpl::isLegalICmpImmediate(int64_t imm) const { return TLI->isLegalICmpImmediate(imm); } -bool ScalarTargetTransformImpl::isLegalAddressingMode(const AddrMode &AM, - Type *Ty) const { +bool ScalarTargetTransformImpl::isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, + int64_t BaseOffset, bool HasBaseReg, + int64_t Scale) const { + AddrMode AM; + AM.BaseGV = BaseGV; + AM.BaseOffs = BaseOffset; + AM.HasBaseReg = HasBaseReg; + AM.Scale = Scale; return TLI->isLegalAddressingMode(AM, Ty); } |

