Eliminate an unnecessary SelectionDAG dependency in getOptimalMemOpType.
authorDan Gohman <gohman@apple.com>
Fri, 16 Apr 2010 20:11:05 +0000 (20:11 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 16 Apr 2010 20:11:05 +0000 (20:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101531 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h

index 1272c608939c5d273bf102ddb633347511df1b59..811f173cd53488c6151bbcdfc493a6af2ab8ef39 100644 (file)
@@ -632,12 +632,12 @@ public:
   /// non-scalar-integer type, e.g. empty string source, constant, or loaded
   /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
   /// constant so it does not need to be loaded.
-  /// It returns EVT::Other if SelectionDAG should be responsible for
-  /// determining the type.
+  /// It returns EVT::Other if the type should be determined using generic
+  /// target-independent logic.
   virtual EVT getOptimalMemOpType(uint64_t Size,
                                   unsigned DstAlign, unsigned SrcAlign,
                                   bool NonScalarIntSafe, bool MemcpyStrSrc,
-                                  SelectionDAG &DAG) const {
+                                  MachineFunction &MF) const {
     return MVT::Other;
   }
   
index c903b08602a3fd5a5c07e8bed14179953b832d84..a36e94b763698cde33eef301c2ef49d6c46234f0 100644 (file)
@@ -5549,13 +5549,13 @@ PPCTargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const {
 /// non-scalar-integer type, e.g. empty string source, constant, or loaded
 /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
 /// constant so it does not need to be loaded.
-/// It returns EVT::Other if SelectionDAG should be responsible for
-/// determining the type.
+/// It returns EVT::Other if the type should be determined using generic
+/// target-independent logic.
 EVT PPCTargetLowering::getOptimalMemOpType(uint64_t Size,
                                            unsigned DstAlign, unsigned SrcAlign,
                                            bool NonScalarIntSafe,
                                            bool MemcpyStrSrc,
-                                           SelectionDAG &DAG) const {
+                                           MachineFunction &MF) const {
   if (this->PPCSubTarget.isPPC64()) {
     return MVT::i64;
   } else {
index f7d629b9980e71ac6b8b9372e2bbd641072c9df5..13c57e64b8e8de0cf613d7bf1eaa8002ea7dcd05 100644 (file)
@@ -357,12 +357,12 @@ namespace llvm {
     /// non-scalar-integer type, e.g. empty string source, constant, or loaded
     /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
     /// constant so it does not need to be loaded.
-    /// It returns EVT::Other if SelectionDAG should be responsible for
-    /// determining the type.
+    /// It returns EVT::Other if the type should be determined using generic
+    /// target-independent logic.
     virtual EVT
     getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign,
                         bool NonScalarIntSafe, bool MemcpyStrSrc,
-                        SelectionDAG &DAG) const;
+                        MachineFunction &MF) const;
 
     /// getFunctionAlignment - Return the Log2 alignment of this function.
     virtual unsigned getFunctionAlignment(const Function *F) const;
index 440f55b69ab51d94af529e2d609bffc01a8c739e..2693f9b49aebbb4ecef2de8880e9bc6b4c2f64c3 100644 (file)
@@ -1079,18 +1079,18 @@ unsigned X86TargetLowering::getByValTypeAlignment(const Type *Ty) const {
 /// non-scalar-integer type, e.g. empty string source, constant, or loaded
 /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
 /// constant so it does not need to be loaded.
-/// It returns EVT::Other if SelectionDAG should be responsible for
-/// determining the type.
+/// It returns EVT::Other if the type should be determined using generic
+/// target-independent logic.
 EVT
 X86TargetLowering::getOptimalMemOpType(uint64_t Size,
                                        unsigned DstAlign, unsigned SrcAlign,
                                        bool NonScalarIntSafe,
                                        bool MemcpyStrSrc,
-                                       SelectionDAG &DAG) const {
+                                       MachineFunction &MF) const {
   // FIXME: This turns off use of xmm stores for memset/memcpy on targets like
   // linux.  This is because the stack realignment code can't handle certain
   // cases like PR2962.  This should be removed when PR2962 is fixed.
-  const Function *F = DAG.getMachineFunction().getFunction();
+  const Function *F = MF.getFunction();
   if (NonScalarIntSafe &&
       !F->hasFnAttr(Attribute::NoImplicitFloat)) {
     if (Size >= 16 &&
index 7fa65cb4735cb534d4ac3e9eb90cba76422b165f..ca1a2598034e69ad14959352357ed1c9c0fb1aa3 100644 (file)
@@ -426,12 +426,12 @@ namespace llvm {
     /// non-scalar-integer type, e.g. empty string source, constant, or loaded
     /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
     /// constant so it does not need to be loaded.
-    /// It returns EVT::Other if SelectionDAG should be responsible for
-    /// determining the type.
+    /// It returns EVT::Other if the type should be determined using generic
+    /// target-independent logic.
     virtual EVT
     getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign,
                         bool NonScalarIntSafe, bool MemcpyStrSrc,
-                        SelectionDAG &DAG) const;
+                        MachineFunction &MF) const;
 
     /// allowsUnalignedMemoryAccesses - Returns true if the target allows
     /// unaligned memory accesses. of the specified type.