From 14245a9d62d9a785a5d6590516380b300bab4957 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 16 Mar 2007 08:42:32 +0000 Subject: [PATCH] Added isLegalAddressExpression hook to test if the given expression can be folded into target addressing mode for the given type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35121 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetLowering.h | 8 +++++++- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 7fedc386a76..dc023c8c1f0 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -855,7 +855,13 @@ public: //===--------------------------------------------------------------------===// // Loop Strength Reduction hooks // - + + /// isLegalAddressExpression - Return true if the binary expression made up of + /// specified opcode, operands, and type can be folded into target addressing + /// mode for load / store of the given type. + virtual bool isLegalAddressExpression(unsigned Opc, Value *Op0, Value *Op1, + 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. diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index faa50295690..8df7d8da399 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1931,6 +1931,14 @@ getRegForInlineAsmConstraint(const std::string &Constraint, // Loop Strength Reduction hooks //===----------------------------------------------------------------------===// +/// isLegalAddressExpression - Return true if the binary expression made up of +/// specified opcode, operands, and type can be folded into target addressing +/// mode for load / store of the given type. +bool TargetLowering::isLegalAddressExpression(unsigned Opc, Value *Op0, + Value *Op1, const Type *Ty) const { + return false; +} + /// 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. -- 2.34.1