[llvm-commits] [llvm] r49666 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h

Dan Gohman gohman at apple.com
Mon Apr 14 10:55:49 PDT 2008


Author: djg
Date: Mon Apr 14 12:55:48 2008
New Revision: 49666

URL: http://llvm.org/viewvc/llvm-project?rev=49666&view=rev
Log:
Fix const-correctness issues with the SrcValue handling in the
memory intrinsic expansion code.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
    llvm/trunk/include/llvm/Target/TargetLowering.h
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
    llvm/trunk/lib/Target/ARM/ARMISelLowering.h
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=49666&r1=49665&r2=49666&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Apr 14 12:55:48 2008
@@ -326,17 +326,17 @@
   SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src,
                       SDOperand Size, unsigned Align,
                       bool AlwaysInline,
-                      Value *DstSV, uint64_t DstOff,
-                      Value *SrcSV, uint64_t SrcOff);
+                      const Value *DstSV, uint64_t DstOff,
+                      const Value *SrcSV, uint64_t SrcOff);
 
   SDOperand getMemmove(SDOperand Chain, SDOperand Dst, SDOperand Src,
                       SDOperand Size, unsigned Align,
-                      Value *DstSV, uint64_t DstOff,
-                      Value *SrcSV, uint64_t SrcOff);
+                      const Value *DstSV, uint64_t DstOff,
+                      const Value *SrcSV, uint64_t SrcOff);
 
   SDOperand getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src,
                       SDOperand Size, unsigned Align,
-                      Value *DstSV, uint64_t DstOff);
+                      const Value *DstSV, uint64_t DstOff);
 
   /// getSetCC - Helper function to make it easier to build SetCC's if you just
   /// have an ISD::CondCode instead of an SDOperand.

Modified: llvm/trunk/include/llvm/Target/TargetLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=49666&r1=49665&r2=49666&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)
+++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Apr 14 12:55:48 2008
@@ -967,8 +967,8 @@
                           SDOperand Op1, SDOperand Op2,
                           SDOperand Op3, unsigned Align,
                           bool AlwaysInline,
-                          Value *DstSV, uint64_t DstOff,
-                          Value *SrcSV, uint64_t SrcOff) {
+                          const Value *DstSV, uint64_t DstOff,
+                          const Value *SrcSV, uint64_t SrcOff) {
     return SDOperand();
   }
 
@@ -983,8 +983,8 @@
                            SDOperand Chain,
                            SDOperand Op1, SDOperand Op2,
                            SDOperand Op3, unsigned Align,
-                           Value *DstSV, uint64_t DstOff,
-                           Value *SrcSV, uint64_t SrcOff) {
+                           const Value *DstSV, uint64_t DstOff,
+                           const Value *SrcSV, uint64_t SrcOff) {
     return SDOperand();
   }
 
@@ -999,7 +999,7 @@
                           SDOperand Chain,
                           SDOperand Op1, SDOperand Op2,
                           SDOperand Op3, unsigned Align,
-                          Value *DstSV, uint64_t DstOff) {
+                          const Value *DstSV, uint64_t DstOff) {
     return SDOperand();
   }
 

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49666&r1=49665&r2=49666&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Apr 14 12:55:48 2008
@@ -2500,8 +2500,8 @@
                                          SDOperand Src, uint64_t Size,
                                          unsigned Align,
                                          bool AlwaysInline,
-                                         Value *DstSV, uint64_t DstOff,
-                                         Value *SrcSV, uint64_t SrcOff) {
+                                         const Value *DstSV, uint64_t DstOff,
+                                         const Value *SrcSV, uint64_t SrcOff) {
   const TargetLowering &TLI = DAG.getTargetLoweringInfo();
 
   // Expand memcpy to a series of store ops if the size operand falls below
@@ -2573,7 +2573,7 @@
                                  SDOperand Chain, SDOperand Dst,
                                  SDOperand Src, uint64_t Size,
                                  unsigned Align,
-                                 Value *DstSV, uint64_t DstOff) {
+                                 const Value *DstSV, uint64_t DstOff) {
   const TargetLowering &TLI = DAG.getTargetLoweringInfo();
 
   // Expand memset to a series of load/store ops if the size operand
@@ -2604,8 +2604,8 @@
 SDOperand SelectionDAG::getMemcpy(SDOperand Chain, SDOperand Dst,
                                   SDOperand Src, SDOperand Size,
                                   unsigned Align, bool AlwaysInline,
-                                  Value *DstSV, uint64_t DstOff,
-                                  Value *SrcSV, uint64_t SrcOff) {
+                                  const Value *DstSV, uint64_t DstOff,
+                                  const Value *SrcSV, uint64_t SrcOff) {
 
   // Check to see if we should lower the memcpy to loads and stores first.
   // For cases within the target-specified limits, this is the best choice.
@@ -2658,8 +2658,8 @@
 SDOperand SelectionDAG::getMemmove(SDOperand Chain, SDOperand Dst,
                                    SDOperand Src, SDOperand Size,
                                    unsigned Align,
-                                   Value *DstSV, uint64_t DstOff,
-                                   Value *SrcSV, uint64_t SrcOff) {
+                                   const Value *DstSV, uint64_t DstOff,
+                                   const Value *SrcSV, uint64_t SrcOff) {
 
   // TODO: Optimize small memmove cases with simple loads and stores,
   // ensuring that all loads precede all stores. This can cause severe
@@ -2691,7 +2691,7 @@
 SDOperand SelectionDAG::getMemset(SDOperand Chain, SDOperand Dst,
                                   SDOperand Src, SDOperand Size,
                                   unsigned Align,
-                                  Value *DstSV, uint64_t DstOff) {
+                                  const Value *DstSV, uint64_t DstOff) {
 
   // Check to see if we should lower the memset to stores first.
   // For cases within the target-specified limits, this is the best choice.

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=49666&r1=49665&r2=49666&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Apr 14 12:55:48 2008
@@ -1247,8 +1247,8 @@
                                            SDOperand Dst, SDOperand Src,
                                            SDOperand Size, unsigned Align,
                                            bool AlwaysInline,
-                                           Value *DstSV, uint64_t DstOff,
-                                           Value *SrcSV, uint64_t SrcOff){
+                                           const Value *DstSV, uint64_t DstOff,
+                                           const Value *SrcSV, uint64_t SrcOff){
   // Do repeated 4-byte loads and stores. To be improved.
   // This requires 4-byte alignment.
   if ((Align & 3) != 0)

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=49666&r1=49665&r2=49666&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Mon Apr 14 12:55:48 2008
@@ -149,8 +149,8 @@
                                       SDOperand Dst, SDOperand Src,
                                       SDOperand Size, unsigned Align,
                                       bool AlwaysInline,
-                                      Value *DstSV, uint64_t DstOff,
-                                      Value *SrcSV, uint64_t SrcOff);
+                                      const Value *DstSV, uint64_t DstOff,
+                                      const Value *SrcSV, uint64_t SrcOff);
   };
 }
 

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49666&r1=49665&r2=49666&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Apr 14 12:55:48 2008
@@ -4664,7 +4664,7 @@
                                            SDOperand Chain,
                                            SDOperand Dst, SDOperand Src,
                                            SDOperand Size, unsigned Align,
-                                           Value *DstSV, uint64_t DstOff) {
+                                           const Value *DstSV, uint64_t DstOff) {
   ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
 
   /// If not DWORD aligned or size is more than the threshold, call the library.
@@ -4804,8 +4804,8 @@
                                            SDOperand Dst, SDOperand Src,
                                            SDOperand Size, unsigned Align,
                                            bool AlwaysInline,
-                                           Value *DstSV, uint64_t DstOff,
-                                           Value *SrcSV, uint64_t SrcOff){
+                                           const Value *DstSV, uint64_t DstOff,
+                                           const Value *SrcSV, uint64_t SrcOff){
   
   // This requires the copy size to be a constant, preferrably
   // within a subtarget-specific limit.

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=49666&r1=49665&r2=49666&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Apr 14 12:55:48 2008
@@ -550,14 +550,14 @@
                                       SDOperand Chain,
                                       SDOperand Dst, SDOperand Src,
                                       SDOperand Size, unsigned Align,
-                                      Value *DstSV, uint64_t DstOff);
+                                      const Value *DstSV, uint64_t DstOff);
     SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG,
                                       SDOperand Chain,
                                       SDOperand Dst, SDOperand Src,
                                       SDOperand Size, unsigned Align,
                                       bool AlwaysInline,
-                                      Value *DstSV, uint64_t DstOff,
-                                      Value *SrcSV, uint64_t SrcOff);
+                                      const Value *DstSV, uint64_t DstOff,
+                                      const Value *SrcSV, uint64_t SrcOff);
   };
 }
 





More information about the llvm-commits mailing list