[llvm-commits] [llvm] r46857 - in /llvm/trunk: include/llvm/CodeGen/PseudoSourceValue.h lib/CodeGen/PseudoSourceValue.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/X86/X86ISelLowering.cpp

Dan Gohman gohman at apple.com
Thu Feb 7 10:41:25 PST 2008


Author: djg
Date: Thu Feb  7 12:41:25 2008
New Revision: 46857

URL: http://llvm.org/viewvc/llvm-project?rev=46857&view=rev
Log:
Follow Chris' suggestion; change the PseudoSourceValue accessors
to return pointers instead of references, since this is always what
is needed.

Modified:
    llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
    llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h?rev=46857&r1=46856&r2=46857&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h (original)
+++ llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h Thu Feb  7 12:41:25 2008
@@ -37,21 +37,21 @@
 
     /// A pseudo source value referencing to the stack frame of a function,
     /// e.g., a spill slot.
-    static const PseudoSourceValue &getFixedStack();
+    static const PseudoSourceValue *getFixedStack();
 
     /// A source value referencing the area below the stack frame of a function,
     /// e.g., the argument space.
-    static const PseudoSourceValue &getStack();
+    static const PseudoSourceValue *getStack();
 
     /// A source value referencing the global offset table (or something the
     /// like).
-    static const PseudoSourceValue &getGOT();
+    static const PseudoSourceValue *getGOT();
 
     /// A SV referencing the constant pool
-    static const PseudoSourceValue &getConstantPool();
+    static const PseudoSourceValue *getConstantPool();
 
     /// A SV referencing the jump table
-    static const PseudoSourceValue &getJumpTable();
+    static const PseudoSourceValue *getJumpTable();
   };
 } // End llvm namespace
 

Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=46857&r1=46856&r2=46857&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (original)
+++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Thu Feb  7 12:41:25 2008
@@ -18,11 +18,11 @@
 namespace llvm {
   static ManagedStatic<PseudoSourceValue[5]> PSVs;
 
-  const PseudoSourceValue &PseudoSourceValue::getFixedStack() { return (*PSVs)[0]; }
-  const PseudoSourceValue &PseudoSourceValue::getStack() { return (*PSVs)[1]; }
-  const PseudoSourceValue &PseudoSourceValue::getGOT() { return (*PSVs)[2]; }
-  const PseudoSourceValue &PseudoSourceValue::getConstantPool() { return (*PSVs)[3]; }
-  const PseudoSourceValue &PseudoSourceValue::getJumpTable() { return (*PSVs)[4]; }
+  const PseudoSourceValue *PseudoSourceValue::getFixedStack() { return &(*PSVs)[0]; }
+  const PseudoSourceValue *PseudoSourceValue::getStack() { return &(*PSVs)[1]; }
+  const PseudoSourceValue *PseudoSourceValue::getGOT() { return &(*PSVs)[2]; }
+  const PseudoSourceValue *PseudoSourceValue::getConstantPool() { return &(*PSVs)[3]; }
+  const PseudoSourceValue *PseudoSourceValue::getJumpTable() { return &(*PSVs)[4]; }
 
   static const char *PSVNames[] = {
     "FixedStack",

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Feb  7 12:41:25 2008
@@ -510,11 +510,11 @@
   SDOperand CPIdx = DAG.getConstantPool(LLVMC, TLI.getPointerTy());
   if (Extend) {
     return DAG.getExtLoad(ISD::EXTLOAD, MVT::f64, DAG.getEntryNode(),
-                          CPIdx, &PseudoSourceValue::getConstantPool(),
+                          CPIdx, PseudoSourceValue::getConstantPool(),
                           0, MVT::f32);
   } else {
     return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
-                       &PseudoSourceValue::getConstantPool(), 0);
+                       PseudoSourceValue::getConstantPool(), 0);
   }
 }
 
@@ -1327,7 +1327,7 @@
 
       // Store the vector.
       SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Tmp1, StackPtr,
-                                  &PseudoSourceValue::getFixedStack(),
+                                  PseudoSourceValue::getFixedStack(),
                                   SPFI);
 
       // Truncate or zero extend offset to target pointer type.
@@ -1339,10 +1339,10 @@
       SDOperand StackPtr2 = DAG.getNode(ISD::ADD, IdxVT, Tmp3, StackPtr);
       // Store the scalar value.
       Ch = DAG.getStore(Ch, Tmp2, StackPtr2,
-                        &PseudoSourceValue::getFixedStack(), SPFI);
+                        PseudoSourceValue::getFixedStack(), SPFI);
       // Load the updated vector.
       Result = DAG.getLoad(VT, Ch, StackPtr,
-                           &PseudoSourceValue::getFixedStack(), SPFI);
+                           PseudoSourceValue::getFixedStack(), SPFI);
       break;
     }
     }
@@ -1692,9 +1692,9 @@
       switch (EntrySize) {
       default: assert(0 && "Size of jump table not supported yet."); break;
       case 4: LD = DAG.getLoad(MVT::i32, Chain, Addr,
-                               &PseudoSourceValue::getJumpTable(), 0); break;
+                               PseudoSourceValue::getJumpTable(), 0); break;
       case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr,
-                               &PseudoSourceValue::getJumpTable(), 0); break;
+                               PseudoSourceValue::getJumpTable(), 0); break;
       }
 
       Addr = LD;
@@ -4772,12 +4772,12 @@
   SDOperand Store;
   if (SrcSize > SlotSize)
     Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr,
-                              &PseudoSourceValue::getFixedStack(),
+                              PseudoSourceValue::getFixedStack(),
                               SPFI, SlotVT);
   else {
     assert(SrcSize == SlotSize && "Invalid store");
     Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr,
-                         &PseudoSourceValue::getFixedStack(),
+                         PseudoSourceValue::getFixedStack(),
                          SPFI, SlotVT);
   }
   
@@ -4799,9 +4799,9 @@
   int SPFI = StackPtrFI->getIndex();
 
   SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Node->getOperand(0), StackPtr,
-                              &PseudoSourceValue::getFixedStack(), SPFI);
+                              PseudoSourceValue::getFixedStack(), SPFI);
   return DAG.getLoad(Node->getValueType(0), Ch, StackPtr,
-                     &PseudoSourceValue::getFixedStack(), SPFI);
+                     PseudoSourceValue::getFixedStack(), SPFI);
 }
 
 
@@ -4866,7 +4866,7 @@
     Constant *CP = ConstantVector::get(CV);
     SDOperand CPIdx = DAG.getConstantPool(CP, TLI.getPointerTy());
     return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
-                       &PseudoSourceValue::getConstantPool(), 0);
+                       PseudoSourceValue::getConstantPool(), 0);
   }
   
   if (SplatValue.Val) {   // Splat of one value?
@@ -5209,12 +5209,12 @@
     SDOperand FudgeInReg;
     if (DestTy == MVT::f32)
       FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
-                               &PseudoSourceValue::getConstantPool(), 0);
+                               PseudoSourceValue::getConstantPool(), 0);
     else if (MVT::getSizeInBits(DestTy) > MVT::getSizeInBits(MVT::f32))
       // FIXME: Avoid the extend by construction the right constantpool?
       FudgeInReg = DAG.getExtLoad(ISD::EXTLOAD, DestTy, DAG.getEntryNode(),
                                   CPIdx,
-                                  &PseudoSourceValue::getConstantPool(), 0,
+                                  PseudoSourceValue::getConstantPool(), 0,
                                   MVT::f32);
     else 
       assert(0 && "Unexpected conversion");
@@ -5358,12 +5358,12 @@
   SDOperand FudgeInReg;
   if (DestVT == MVT::f32)
     FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
-                             &PseudoSourceValue::getConstantPool(), 0);
+                             PseudoSourceValue::getConstantPool(), 0);
   else {
     FudgeInReg =
       LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, DestVT,
                                 DAG.getEntryNode(), CPIdx,
-                                &PseudoSourceValue::getConstantPool(), 0,
+                                PseudoSourceValue::getConstantPool(), 0,
                                 MVT::f32));
   }
 
@@ -6778,10 +6778,10 @@
 
       SDOperand St = DAG.getStore(DAG.getEntryNode(),
                                   InOp, Ptr,
-                                  &PseudoSourceValue::getFixedStack(),
+                                  PseudoSourceValue::getFixedStack(),
                                   FI->getIndex());
       InOp = DAG.getLoad(Op.getValueType(), St, Ptr,
-                         &PseudoSourceValue::getFixedStack(),
+                         PseudoSourceValue::getFixedStack(),
                          FI->getIndex());
     }
     // Split the vector and convert each of the pieces now.

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Feb  7 12:41:25 2008
@@ -3548,7 +3548,7 @@
   const FrameIndexSDNode *FI =
     dyn_cast<const FrameIndexSDNode>(getBasePtr().Val);
   if (!getSrcValue() && FI)
-    return MemOperand(&PseudoSourceValue::getFixedStack(), Flags,
+    return MemOperand(PseudoSourceValue::getFixedStack(), Flags,
                       FI->getIndex(), Size, Alignment);
   else
     return MemOperand(getSrcValue(), Flags,

Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46857&r1=46856&r2=46857&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu Feb  7 12:41:25 2008
@@ -2203,7 +2203,7 @@
                                 Op.getOperand(0));
   
   // STD the extended value into the stack slot.
-  MemOperand MO(&PseudoSourceValue::getFixedStack(),
+  MemOperand MO(PseudoSourceValue::getFixedStack(),
                 MemOperand::MOStore, FrameIdx, 8, 8);
   SDOperand Store = DAG.getNode(PPCISD::STD_32, MVT::Other,
                                 DAG.getEntryNode(), Ext64, FIdx,

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

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Feb  7 12:41:25 2008
@@ -1091,7 +1091,7 @@
   if (isByVal)
     return FIN;
   return DAG.getLoad(VA.getValVT(), Root, FIN,
-                     &PseudoSourceValue::getFixedStack(), FI);
+                     PseudoSourceValue::getFixedStack(), FI);
 }
 
 SDOperand
@@ -1221,7 +1221,7 @@
         SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::i64);
         SDOperand Store =
           DAG.getStore(Val.getValue(1), Val, FIN,
-                       &PseudoSourceValue::getFixedStack(),
+                       PseudoSourceValue::getFixedStack(),
                        RegSaveFrameIndex);
         MemOps.push_back(Store);
         FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
@@ -1237,7 +1237,7 @@
         SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::v4f32);
         SDOperand Store =
           DAG.getStore(Val.getValue(1), Val, FIN,
-                       &PseudoSourceValue::getFixedStack(),
+                       PseudoSourceValue::getFixedStack(),
                        RegSaveFrameIndex);
         MemOps.push_back(Store);
         FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
@@ -1299,7 +1299,7 @@
     return CreateCopyOfByValArgument(Arg, PtrOff, Chain, Flags, DAG);
   }
   return DAG.getStore(Chain, Arg, PtrOff,
-                      &PseudoSourceValue::getStack(), LocMemOffset);
+                      PseudoSourceValue::getStack(), LocMemOffset);
 }
 
 /// ClassifyX86_64SRetCallReturn - Classify how to implement a x86-64
@@ -1571,7 +1571,7 @@
           // Store relative to framepointer.
           MemOpChains2.push_back(
             DAG.getStore(Chain, Source, FIN,
-                         &PseudoSourceValue::getFixedStack(), FI));
+                         PseudoSourceValue::getFixedStack(), FI));
         }            
       }
     }
@@ -3801,7 +3801,7 @@
   // The same applies for external symbols during PIC codegen
   if (Subtarget->GVRequiresExtraLoad(GV, getTargetMachine(), false))
     Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result,
-                         &PseudoSourceValue::getGOT(), 0);
+                         PseudoSourceValue::getGOT(), 0);
 
   return Result;
 }
@@ -3860,7 +3860,7 @@
 
   if (GA->getGlobal()->isDeclaration()) // initial exec TLS model
     Offset = DAG.getLoad(PtrVT, DAG.getEntryNode(), Offset,
-                         &PseudoSourceValue::getGOT(), 0);
+                         PseudoSourceValue::getGOT(), 0);
 
   // The address of the thread local variable is the add of the thread
   // pointer with the offset of the variable.
@@ -3993,7 +3993,7 @@
   SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
   SDOperand Chain = DAG.getStore(DAG.getEntryNode(), Op.getOperand(0),
                                  StackSlot,
-                                 &PseudoSourceValue::getFixedStack(),
+                                 PseudoSourceValue::getFixedStack(),
                                  SSFI);
 
   // These are really Legal; caller falls through into that case.
@@ -4036,7 +4036,7 @@
     Ops.push_back(InFlag);
     Chain = DAG.getNode(X86ISD::FST, Tys, &Ops[0], Ops.size());
     Result = DAG.getLoad(Op.getValueType(), Chain, StackSlot,
-                         &PseudoSourceValue::getFixedStack(), SSFI);
+                         PseudoSourceValue::getFixedStack(), SSFI);
   }
 
   return Result;
@@ -4075,7 +4075,7 @@
   if (isScalarFPTypeInSSEReg(Op.getOperand(0).getValueType())) {
     assert(Op.getValueType() == MVT::i64 && "Invalid FP_TO_SINT to lower!");
     Chain = DAG.getStore(Chain, Value, StackSlot,
-                         &PseudoSourceValue::getFixedStack(), SSFI);
+                         PseudoSourceValue::getFixedStack(), SSFI);
     SDVTList Tys = DAG.getVTList(Op.getOperand(0).getValueType(), MVT::Other);
     SDOperand Ops[] = {
       Chain, StackSlot, DAG.getValueType(Op.getOperand(0).getValueType())
@@ -4135,7 +4135,7 @@
   Constant *C = ConstantVector::get(CV);
   SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
   SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
-                               &PseudoSourceValue::getConstantPool(), 0,
+                               PseudoSourceValue::getConstantPool(), 0,
                                false, 16);
   return DAG.getNode(X86ISD::FAND, VT, Op.getOperand(0), Mask);
 }
@@ -4164,7 +4164,7 @@
   Constant *C = ConstantVector::get(CV);
   SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
   SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
-                               &PseudoSourceValue::getConstantPool(), 0,
+                               PseudoSourceValue::getConstantPool(), 0,
                                false, 16);
   if (MVT::isVector(VT)) {
     return DAG.getNode(ISD::BIT_CONVERT, VT,
@@ -4213,7 +4213,7 @@
   Constant *C = ConstantVector::get(CV);
   SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
   SDOperand Mask1 = DAG.getLoad(SrcVT, DAG.getEntryNode(), CPIdx,
-                                &PseudoSourceValue::getConstantPool(), 0,
+                                PseudoSourceValue::getConstantPool(), 0,
                                 false, 16);
   SDOperand SignBit = DAG.getNode(X86ISD::FAND, SrcVT, Op1, Mask1);
 
@@ -4242,7 +4242,7 @@
   C = ConstantVector::get(CV);
   CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
   SDOperand Mask2 = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
-                                &PseudoSourceValue::getConstantPool(), 0,
+                                PseudoSourceValue::getConstantPool(), 0,
                                 false, 16);
   SDOperand Val = DAG.getNode(X86ISD::FAND, VT, Op0, Mask2);
 





More information about the llvm-commits mailing list