From 148c69a3f608cf1687dcf661ddc1e3aa282e262a Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 16 Apr 2010 20:11:05 +0000 Subject: [PATCH] Eliminate an unnecessary SelectionDAG dependency in getOptimalMemOpType. llvm-svn: 101531 --- llvm/include/llvm/Target/TargetLowering.h | 6 +++--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 6 +++--- llvm/lib/Target/PowerPC/PPCISelLowering.h | 6 +++--- llvm/lib/Target/X86/X86ISelLowering.cpp | 8 ++++---- llvm/lib/Target/X86/X86ISelLowering.h | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h index 1272c608939c..811f173cd534 100644 --- a/llvm/include/llvm/Target/TargetLowering.h +++ b/llvm/include/llvm/Target/TargetLowering.h @@ -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; } diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index c903b08602a3..a36e94b76369 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -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 { diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h index f7d629b9980e..13c57e64b8e8 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.h +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h @@ -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; diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 440f55b69ab5..2693f9b49aeb 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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 && diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h index 7fa65cb4735c..ca1a2598034e 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.h +++ b/llvm/lib/Target/X86/X86ISelLowering.h @@ -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.