Fix const-correctness issues with the SrcValue handling in the
authorDan Gohman <gohman@apple.com>
Mon, 14 Apr 2008 17:55:48 +0000 (17:55 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 14 Apr 2008 17:55:48 +0000 (17:55 +0000)
memory intrinsic expansion code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49666 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 8ea14a5dfdd9200120a30ffbf7b21c92a5649daf..390e44dc53b1d4de03f37704497ef859ebef71d7 100644 (file)
@@ -326,17 +326,17 @@ public:
   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.
index f64ffe2194e49f56244636126ad4f1fa31deb8a1..a105ce696042ba93032967880e76b60865b19d13 100644 (file)
@@ -967,8 +967,8 @@ public:
                           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 @@ public:
                            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 @@ public:
                           SDOperand Chain,
                           SDOperand Op1, SDOperand Op2,
                           SDOperand Op3, unsigned Align,
-                          Value *DstSV, uint64_t DstOff) {
+                          const Value *DstSV, uint64_t DstOff) {
     return SDOperand();
   }
 
index 327a8fe897642c140fb8ae46885efbda4bf191ff..a0f869768093659d2ca7b01919dfc24549e105f4 100644 (file)
@@ -2500,8 +2500,8 @@ static SDOperand getMemcpyLoadsAndStores(SelectionDAG &DAG,
                                          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 @@ static SDOperand getMemsetStores(SelectionDAG &DAG,
                                  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 @@ static SDOperand getMemsetStores(SelectionDAG &DAG,
 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::getMemcpy(SDOperand Chain, SDOperand Dst,
 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::getMemmove(SDOperand Chain, SDOperand Dst,
 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.
index 0095352c41588fb09c07d93aca9d4ff2ef010a21..6a581f715fd7d62bba3298868747474e237bbb1c 100644 (file)
@@ -1247,8 +1247,8 @@ ARMTargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG,
                                            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)
index 58d8d8c6c860811cf474a2949fce073118ac0987..13f5c08375364c88ed2d37d60aa7c561e6b313b0 100644 (file)
@@ -149,8 +149,8 @@ namespace llvm {
                                       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);
   };
 }
 
index ac58ab4f05c1cedd354d687b47b6705455751d31..38e6342ae6544a93babddb6eddd8fc0e08ae7b89 100644 (file)
@@ -4664,7 +4664,7 @@ X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG,
                                            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 @@ X86TargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG,
                                            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.
index fea2d2b357775af8cbdd94af11de5c0bac50e8cf..e3000dbc2cb6d7a764f1e814c07c1da288f22d6f 100644 (file)
@@ -550,14 +550,14 @@ namespace llvm {
                                       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);
   };
 }