Added isLegalAddressExpression hook to test if the given expression can be
authorEvan Cheng <evan.cheng@apple.com>
Fri, 16 Mar 2007 08:42:32 +0000 (08:42 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 16 Mar 2007 08:42:32 +0000 (08:42 +0000)
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
lib/CodeGen/SelectionDAG/TargetLowering.cpp

index 7fedc386a76af66f2dfd7e0361599df8f9f6331a..dc023c8c1f03f4f4cbaa70d31d783a9da680c301 100644 (file)
@@ -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.
index faa50295690f4321737cfdfc3e3efff7f881590e..8df7d8da39968dbc516edbaea2e078aa13ab8a74 100644 (file)
@@ -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.